Hey, I'm having a problem with auto_ptr. Heres the code I normaly use to create an instance of a class:
Code:
CONNECTION * NewConn = new CONNECTION(Arg->SFD, Arg->CLA);
And heres when I tried to make it into an auto_ptr:
Code:
auto_ptr<CONNECTION> NewConn (new CONNECTION(Arg->SFD, Arg->CLA) );
When I compile I get the error:
C:\SWEBS\SWEBSEngine\Source\SWEBSMain.cpp(441) : error C2451: conditional expression of type 'class std::auto_ptr<class CONNECTION>' is illegal
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
Is there any changes I need to make to my CONNECTION class? Or have I just declared this wrong?