unique_ptr < int > test () {
unique_ptr<int> ppp(new int(10));
return ppp;
}
As shown in the code above, ppp can successfully return no error. Ppp is a left value, so it must not be moved, so you have to execute the copy constructor, but unique_ptr does not have a copy construction.
who can give me a big explanation?