Nota
O acesso a esta página requer autorização. Pode tentar iniciar sessão ou alterar os diretórios.
O acesso a esta página requer autorização. Pode tentar alterar os diretórios.
'type' : só pode lançar ou pegar alça para uma classe gerenciada com /clr:safe
Observações
Ao usar /clr:safe, você só pode lançar ou pegar um tipo de referência.
Para obter mais informações, consulte /clr (Common Language Runtime Compilation).
Exemplo
O exemplo a seguir gera C2749:
// C2749.cpp
// compile with: /clr:safe
ref struct MyStruct {
public:
int i;
};
int main() {
MyStruct ^x = gcnew MyStruct;
// Delete the following 4 lines to resolve.
try {
throw (1); // C2749
}
catch(int){}
// OK
try {
throw (x);
}
catch(MyStruct ^){}
}