I
Ioannis Vranos
Unless I missing something, I think this is a bug.
ref class A
{
};
ref class B
{
public:
B(A) { }
B() {}
};
int main()
{
A a;
B b(a);
}
C:\c>cl /clr:safe temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
temp.cpp(18) : error C2664: 'B::B(A)' : cannot convert parameter 1 from
'A' to '
A'
Cannot copy construct class 'A' due to ambiguous copy
constructors or no
available copy constructor
C:\c>
Am I making some mistake?
ref class A
{
};
ref class B
{
public:
B(A) { }
B() {}
};
int main()
{
A a;
B b(a);
}
C:\c>cl /clr:safe temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
temp.cpp(18) : error C2664: 'B::B(A)' : cannot convert parameter 1 from
'A' to '
A'
Cannot copy construct class 'A' due to ambiguous copy
constructors or no
available copy constructor
C:\c>
Am I making some mistake?