{"id":1652,"date":"2020-04-06T20:15:12","date_gmt":"2020-04-06T12:15:12","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=1652"},"modified":"2020-04-06T20:29:23","modified_gmt":"2020-04-06T12:29:23","slug":"cdefault-delete","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=1652","title":{"rendered":"[c++11]=default \/ = delete"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>class student\n{\nprivate:\n\tint age;\npublic:\n\tstudent() = default;\n\tstudent(int v) = delete;\n<\/code><\/pre>\n\n\n\n<p>=default\uff0c\u4ee3\u8868\u8ba9\u7f16\u8bd1\u5668\u81ea\u52a8\u4ea7\u751f\u7248\u672c<br>=delete\uff0c\u4ee3\u8868\u8ba9\u7f16\u8bd1\u5668\u5220\u9664\u6b64\u7248\u672c\uff08\u76f8\u5f53\u4e8eprivate\uff0c\u4e0d\u8ba9\u522b\u4eba\u7528\uff09<\/p>\n\n\n\n<p>\u5168\u5c40\u7684\u6784\u9020\u548c\u8d4b\u503c\u51fd\u6570<br>1\uff09\u6784\u9020\u51fd\u6570<br>2\uff09\u6790\u6784\u51fd\u6570<br>3\uff09\u62f7\u8d1d\u6784\u9020\u51fd\u6570<br>4\uff09\u62f7\u8d1d\u8d4b\u503c\u51fd\u6570\uff08operator=\uff09<br>5\uff09\u79fb\u52a8\u6784\u9020\u51fd\u6570<\/p>\n\n\n\n<p>\u5168\u5c40\u7684\u9ed8\u8ba4\u64cd\u4f5c\u7b26\u51fd\u6570<br>1\uff09operator,<br>2\uff09operator &amp;<br>3\uff09operator &amp;&amp;<br>4\uff09operator *<br>5\uff09operator-><br>6\uff09operator->*<br>7)  operator new<br>8)  operator delete<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=default\uff0c\u4ee3\u8868\u8ba9\u7f16\u8bd1\u5668\u81ea\u52a8\u4ea7\u751f\u7248\u672c=delete\uff0c\u4ee3\u8868\u8ba9\u7f16\u8bd1\u5668\u5220\u9664\u6b64\u7248\u672c\uff08\u76f8\u5f53\u4e8eprivate\uff0c\u4e0d\u8ba9\u522b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1652"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1652"}],"version-history":[{"count":3,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1652\/revisions"}],"predecessor-version":[{"id":1655,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1652\/revisions\/1655"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}