最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

make

运维笔记admin14浏览0评论

make

make

War*_*ers 7

正如 yksisarvinen 在评论中提出的那样,解决此问题的一种方法是替换make_unique<T>为std::unique_ptr<T>(new T(S)).

class S { public: S() {}};class T { private: std::unique_ptr<S> a; T(S); public: static std::unique_ptr<T> make_item() { // Create S std::unique_ptr<S> s_instance = std::make_unique<S>(); return std::unique_ptr<T>(new T(s_instance)); }};

发布评论

评论列表(0)

  1. 暂无评论