This was an r-value experiment but it mutated when gcc whined to me about lack of move-constructor (I\'d deleted it) and didn\'t fall-back to the copy constructor (as I expe
To prevent copy illision implement the assignment operator with the copy/swap algorithm like:
Object &operator =(Object other)
{
std::swap(*this, other);
return *this;
}
And then try:
Object a;
a = test();
That way the copy (or move) ctor will be called by the compiler when it passes the object into the assignment operator.