{"id":93049,"date":"2020-03-27T00:21:08","date_gmt":"2020-03-26T16:21:08","guid":{"rendered":"http:\/\/4563.org\/?p=93049"},"modified":"2020-03-27T00:21:08","modified_gmt":"2020-03-26T16:21:08","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f%e9%87%8c%e6%8a%bd%e8%b1%a1%e5%b7%a5%e5%8e%82%e5%8f%aa%e8%b4%9f%e8%b4%a3%e5%88%9b%e5%bb%ba%e8%80%8c%e4%b8%8d%e8%b4%9f%e8%b4%a3%e8%b5%84","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=93049","title":{"rendered":"\u4e3a\u4ec0\u4e48\u8bbe\u8ba1\u6a21\u5f0f\u91cc\u62bd\u8c61\u5de5\u5382\u53ea\u8d1f\u8d23\u521b\u5efa\u800c\u4e0d\u8d1f\u8d23\u8d44\u6e90\u7ba1\u7406\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e3a\u4ec0\u4e48\u8bbe\u8ba1\u6a21\u5f0f\u91cc\u62bd\u8c61\u5de5\u5382\u53ea\u8d1f\u8d23\u521b\u5efa\u800c\u4e0d\u8d1f\u8d23\u8d44\u6e90\u7ba1\u7406\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fyyz <\/span>  <span><i><\/i> 27<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u62bd\u8c61\u5de5\u5382\u53ea\u662f\u5b9e\u73b0\u4e86 CRUD \u4e2d\u7684 C\uff0c\u6211\u60f3\u5b9e\u73b0\u8fd9\u6837\u7684\u5de5\u5382:<\/p>\n<pre><code>\/* C++ *\/  class abstract_factory { };  template&lt;typename T&gt; class factory\uff1apublic abstract_factory { public:  std::weak_ptr&lt;T&gt; create();  std::weak_ptr&lt;T&gt; retrieve(const std::uint64_t&amp; product_id);  void destroy(const std::uint64_t&amp; product_id);  private:  std::uint64_t increment_serial_id_ = 0;  std::map&lt;std::uint32_t, std::shared_ptr&lt;T&gt; products_;   std::uint64_t generate_id(); }; <\/code><\/pre>\n<p>\u8fd9\u79cd\u5199\u6cd5\u76f4\u63a5\u5305\u542b\u4e86 CRUD\uff0c\u540c\u65f6\u5185\u90e8\u4e5f\u6301\u6709\u4e86\u5bf9\u8c61\u3002\u6211\u89c9\u5f97\u8fd9\u79cd\u5199\u6cd5\u660e\u663e\u6bd4\u53ea\u6709 create() \u7684\u62bd\u8c61\u5de5\u5382\u66f4\u597d\u554a\u3002\u4e3a\u4ec0\u4e48\u5f88\u5c11\u6709\u4eba\u5199\u8fd9\u79cd\u6a21\u5f0f\u5462\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1000818\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u4e0d\u8fd8\u662f\u8981\u663e\u5f0f destroy \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1000819\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : fyyz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @binux \u663e\u793a\u5220\u9664\uff0c\u4e0d\u5c31\u662f CRUD \u7684 D \u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1000820\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @fyyz \u6211\u662f\u8bf4\u4f60\u90fd\u663e\u5f0f destroy \u4e86\u8fd8\u8981\u5de5\u5382\u7ba1\u7406\u4ec0\u4e48\u8d44\u6e90\uff1f\u96be\u9053\u6784\u5efa\u51fa\u6765\u7684\u5b9e\u4f8b\u81ea\u5df1\u4e0d\u77e5\u9053\u4ec0\u4e48\u5220\u9664\u81ea\u5df1\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1000821\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : fyyz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u660e\u767d\u4e86\uff0c\u539f\u6765\u8fd9\u4e2a\u662f\u4eab\u5143\u6a21\u5f0f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1000822\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : TransAM <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6240\u4ee5\u5b83\u53eb\u5de5\u5382\uff0c\u800c\u4e0d\u662f\u5bb9\u5668 \/\u5bf9\u8c61\u6c60\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u8bbe\u8ba1\u6a21\u5f0f\u91cc\u62bd\u8c61\u5de5\u5382\u53ea\u8d1f\u8d23\u521b\u5efa&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/93049"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93049"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/93049\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93049"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}