{"id":2399,"date":"2017-12-06T08:48:24","date_gmt":"2017-12-06T00:48:24","guid":{"rendered":"https:\/\/www.csslayer.info\/wordpress\/?p=2399"},"modified":"2017-12-06T08:48:24","modified_gmt":"2017-12-06T00:48:24","slug":"a-small-pitfall-with-std-unique_ptr","status":"publish","type":"post","link":"https:\/\/www.csslayer.info\/wordpress\/linux\/a-small-pitfall-with-std-unique_ptr\/","title":{"rendered":"\u6700\u8fd1\u8e29\u7684\u4e00\u4e2a\u5173\u4e8e std::unique_ptr \u7684\u5c0f\u5751\u3002"},"content":{"rendered":"<p>\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u8fd9\u6837\u4e00\u4ef6\u4e8b\uff0cstd::unique_ptr \u5728\u6790\u6784\u9014\u4e2d\u8c03\u7528\u4e86 .get() \u4f1a\u53d1\u751f\u4ec0\u4e48\u8fd9\u6837\u4e00\u4e2a\u95ee\u9898\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u4f60\u662f\u4e0d\u5e94\u8be5\u5199\u51fa\u8fd9\u6837\u7684\u4ee3\u7801\u7684\u2026\u2026\u4f46\u662f\u6709\u65f6\u5019\u8fd9\u6837\u7684\u884c\u4e3a\u53ef\u80fd\u5e76\u4e0d\u662f\u975e\u5e38\u660e\u663e\u3002\u6240\u4ee5\u5c31\u4f1a\u5bfc\u81f4\u95ee\u9898\u2026<\/p>\n<p>\u4e00\u4e2a FreeBSD \u4e0a\u7684\u4eba\u6c47\u62a5\u4e86\u5728 Linux \u4e0a\u6ca1\u6709\u7684 crash\u3002\u4f30\u8ba1\u662f libc++ \u548c libstdc++ \u7684\u884c\u4e3a\u5dee\u522b\u3002\u4e00\u4e2a\u5728\u6790\u6784\u9014\u4e2d\u5c31\u8fd4\u56de null \u4e86\uff0c\u4e00\u4e2a\u8fd8\u662f\u8fd4\u56de\u539f\u59cb\u7684\u6307\u9488\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u5c0f\u5fc3\u907f\u514d\u5199\u51fa\u8fd9\u6837\u7684\u4ee3\u7801\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u8fd9\u6837\u4e00\u4ef6\u4e8b\uff0cstd::unique_ptr \u5728\u6790\u6784\u9014\u4e2d\u8c03\u7528\u4e86 .get() \u4f1a\u53d1\u751f\u4ec0\u4e48\u8fd9\u6837\u4e00\u4e2a\u95ee\u9898\u3002 \u5f53\u7136\uff0c\u4f60\u662f\u4e0d\u5e94\u8be5\u5199\u51fa\u8fd9\u6837\u7684\u4ee3\u7801\u7684\u2026\u2026\u4f46\u662f\u6709\u65f6\u5019\u8fd9\u6837\u7684\u884c\u4e3a\u53ef\u80fd\u5e76\u4e0d\u662f\u975e\u5e38\u660e\u663e\u3002\u6240\u4ee5\u5c31\u4f1a\u5bfc\u81f4\u95ee\u9898\u2026 \u4e00\u4e2a FreeBSD \u4e0a\u7684\u4eba\u6c47\u62a5\u4e86\u5728 Linux \u4e0a\u6ca1\u6709\u7684 crash\u3002\u4f30\u8ba1\u662f libc++ \u548c libstdc++ \u7684\u884c\u4e3a\u5dee\u522b\u3002\u4e00\u4e2a\u5728\u6790\u6784\u9014\u4e2d\u5c31\u8fd4\u56de null \u4e86\uff0c\u4e00\u4e2a\u8fd8\u662f\u8fd4\u56de\u539f\u59cb\u7684\u6307\u9488\u3002 \u603b\u4e4b\uff0c\u5c0f\u5fc3\u907f\u514d\u5199\u51fa\u8fd9\u6837\u7684\u4ee3\u7801\u5427\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[229,208],"class_list":["post-2399","post","type-post","status-publish","format-standard","hentry","category-linux","tag-c","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/2399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/comments?post=2399"}],"version-history":[{"count":1,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/2399\/revisions"}],"predecessor-version":[{"id":2400,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/2399\/revisions\/2400"}],"wp:attachment":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/media?parent=2399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/categories?post=2399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/tags?post=2399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}