
27 May
2010
27 May
'10
7:28 p.m.
Oliver Kowalke wrote:
I get an linker error (private: __thiscall X::X(class X &) is unresolved symbol) with msvc-9.0 on XP. AFAIL (docu) implementing the copy-ctor isn't required and passing values from static memeber functions are allowed.
What's wrong? [snip] X X::create() { X x; return x; // passing value form static memeber-fn }
The statement "return x" must make some constructor call. As x is not a temporary, the compiler must call the copy constructor. It will probably work if you write "return boost::move(x)" or "return X()". Regards, Thomas