Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
"type_or_member" : markerad som föråldrad
Anmärkningar
En medlem eller typ har markerats som föråldrad med ObsoleteAttribute klassen.
Example
I följande exempel genereras C4947:
// C4947.cpp
// compile with: /clr /W1
// C4947 expected
using namespace System;
[System::ObsoleteAttribute]
ref struct S {
[System::ObsoleteAttribute]
int i;
[System::ObsoleteAttribute]
void mFunc(){}
};
// Any reference to Func1 should generate a warning
[System::ObsoleteAttribute]
Int32 Func1(Int32 a, Int32 b) {
return (a + b);
}
// Any reference to Func2 should generate a warning with message
[System::ObsoleteAttribute("Will be removed in next version")]
Int32 Func2(Int32 a, Int32 b) {
return (a + b);
}
int main() {
Int32 MyInt1 = ::Func1(2, 2);
Int32 MyInt2 = ::Func2(2, 2);
S^ s = gcnew S();
s->i = 10;
s->mFunc();
}