please look at the following example code:
class testo
{
public:
testo()
{
cout << " default " << endl;
}
testo(const testo & src)
{
cout << "copy " << endl;
}
testo(const testo && src)
{
cout << "move" << endl;
}
testo & operator=(const testo & rhs)
{
cout << " assigment" << endl;
return *this;
}
testo & operator= (const testo && rhs)
{
cout << "move" << endl;
}
};
and this is my function and main code :
testo nothing(testo & input)
{
return input;
}
int main ()
{
testo boj1 ;
testo obj2(nothing(obj1) );
return 1;
}
when i compile and run this code i expect to see :
default // default constructor
copy // returning from the function
move // moving to the obj2
but when the code is getting execute it just show :
default
copy
the compiler is Visual C++ 2015