class C
{
public:
C()
{
std::cout << "C()" << std::endl;
}
C(C &&c)
{
std::cout << "C(C &&)" << std::endl;
}
};
int main()
{
C c = C();
}
I've assumed this would print
C()
C(C &&)
since C() creates a temporary object (rvalue),
but this actually prints only
C()
in MSVC.
Is this because of some kind of optimization?