Problem with non-copyable classes
- by DeadMG
I've got some non-copyable classes. I don't invoke any of the copy operators or constructor, and this code compiles fine. But then I upgraded to Visual Studio 2010 Ultimate instead of Professional. Now the compiler is calling the copy constructor- even when the move constructor should be invoked. For example, in the following snippet:
inline D3D9Mesh CreateSphere(D3D9Render& render, float radius, float slices) {
D3D9Mesh retval(render);
/* ... */
return std::move(retval);
}
Error: Cannot create copy constructor, because the class is non-copyable. However, I quite explicitly moved it.