Effective Modern C++ 条款21 比起直接使用new,更偏心使用std::make_unique和std::make_shared

比起直接使用new,更偏心使用std::make_unique和std::make_shared 让咱们从std::make_unique和std::make_shared之间的比较开始讲起吧。std::make_shared是C++11的一部分,惋惜的是,std::make_unique不是,它在C++14才归入标准库。若是你使用的是C++11,不用忧伤,由于std::make_unique的简
相关文章
相关标签/搜索