creating a shared_ptr from unique_ptr
问题 In a piece of code I reviewed lately, which compiled fine with g++-4.6 , I encountered a strange try to create a std::shared_ptr from std::unique_ptr : std::unique_ptr<Foo> foo... std::make_shared<Foo>(std::move(foo)); This seems rather odd to me. This should be std::shared_ptr<Foo>(std::move(foo)); afaik, though I'm not perfectly familiar with moves (and I know std::move is only a cast, nothing get's moved). Checking with different compilers on this SSC(NUC*)E #include <memory> int main() {