C++11智能指针之优先使用std::make_unique和std::make_shared而不是直接使用new

         在初始化一个unique_ptr或者shared_ptr时,咱们最好优先使用std::make_unique和std::make_shared。缘由有一下几点:安全 异常安全性函数 假设有以下函数声明:spa   intcomputePriority();orm void processInvestment(std::shared_ptr<Investment> ptr,in
相关文章
相关标签/搜索