Erro do Compilador C3673
'type' : a classe não tem um construtor de cópia
Um construtor definido pelo usuário é necessário para copiar objetos de tipos de referência CLR. Para obter mais informações, consulte Semântica de Pilha do C++ para tipos de referência.
Exemplos
A seguinte amostra gera o erro C3673.
// C3673.cpp
// compile with: /clr
public ref struct R {
public:
R() {}
// Uncomment the following line to resolve.
// R(R% p) {}
};
int main() {
R r;
R s = r; // C3673
}
A seguinte amostra gera o erro C3673.
// C3673_b.cpp
// compile with: /clr /c
// C3673 expected
using namespace System;
[AttributeUsage(AttributeTargets::Class)]
ref class MyAttr : public Attribute {
public:
MyAttr() {}
// Uncomment the following line to resolve.
// MyAttr(int i) {}
property int Priority;
property int Version;
};
[MyAttr]
ref class ClassA {}; // OK, no arguments
[MyAttr(Priority = 1)]
ref class ClassB {}; // OK, named argument
[MyAttr(123)]
ref class ClassC {}; // Positional argument
[MyAttr(123, Version = 1)]
ref class ClassD {}; // Positional and named