Error C2582 when creating a new struct  
Author Message
FritzPoll2006





PostPosted: Visual C++ General, Error C2582 when creating a new struct Top

Hi,

Within a namespace, have declared a new struct like so:

public ref struct moveLine

{

int moveCount;

array<move^> ^moves;

};

Have declared a member of a class with this data type like so:

moveLine m; // note that putting "^" brings up a compile error

and in the constructor of the class, I try to implement it with the following code:

m = gcnew moveLine;

Have also tried this with moveLine(). This line raises the following error:

Error 2 error C2582: 'operator =' function is unavailable in 'moveLine' progHead.h 57

Am very tired, and can't figure this out - can't work it out from MSDN documentation either. Hope you can help.

Cheers,

Fritz




Visual C++1  
 
 
Andreas Johansson





PostPosted: Visual C++ General, Error C2582 when creating a new struct Top

gcnew returns a handle ^ so this might work

moveLine^ m;
m = gcnew moveLine();