Why is this copy constructor called rather than the move constructor?

前端 未结 1 1559
闹比i
闹比i 2020-12-11 03:44

The following code snippet causes the copy constructor to be called where I expected the move constructor to be called:

#include 

struct Foo
{         


        
相关标签:
1条回答
  • 2020-12-11 04:28

    Unfortunately, VS11 doesn't provide a default move constructor. See Move Semantics in the Remarks section - to quote:

    Unlike the default copy constructor, the compiler does not provide a default move constructor.

    0 讨论(0)
提交回复
热议问题