{"published":"2017-03-20 13:11:19","provider_name":"Hatena Blog","blog_title":"\u4e88\u5b9a\u306f\u672a\u5b9a","height":"190","categories":["C++","unique_ptr","shared_ptr","vector"],"author_url":"https://blog.hatena.ne.jp/konishih/","description":"\u524d\u56de\u306f\u30b3\u30d4\u30fc\u3059\u3079\u304d\u3068\u3053\u308d\u3067\u30e0\u30fc\u30d6\u3059\u3079\u304d\u3067\u306f\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002 \u30b3\u30fc\u30c9\u306fshared_ptr\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u3059\u3079\u3066\u304c\u3046\u307e\u304f\u3044\u304f\u3088\u3046\u306b\u306a\u308b\u3002 class C { public: shared_ptr<int> d; C() : d(new int(0)) {} C( const int n ) : d(new int(n)) {} // \u30b3\u30d4\u30fc\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3001\u30aa\u30da\u30ec\u30fc\u30bf=\u306f\u81ea\u52d5\u751f\u6210\u3067ok ~C() {} }; bool operator<(const C& lhs, const C& rhs ) { return lhs.d.get() < rhs.d.get(); } void test_co\u2026","blog_url":"https://konishih.hateblo.jp/","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkonishih.hateblo.jp%2Fentry%2F2017%2F03%2F20%2F131119\" title=\"vector\u3068unique_ptr \u305d\u306e2 - \u4e88\u5b9a\u306f\u672a\u5b9a\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://konishih.hateblo.jp/entry/2017/03/20/131119","version":"1.0","author_name":"konishih","type":"rich","provider_url":"https://hatena.blog","title":"vector\u3068unique_ptr \u305d\u306e2","image_url":null}