可能重复: make_unique和完美转发
为什么C++ 11有make_shared模板,但不是make_unique模板?
make_shared
make_unique
这使得代码非常不一致.
auto x = make_shared<string>("abc"); auto y = unique_ptr<string>(new string("abc"));
c++ c++11
c++ ×1
c++11 ×1