{"id":156026,"date":"2020-09-12T08:50:23","date_gmt":"2020-09-12T00:50:23","guid":{"rendered":"http:\/\/4563.org\/?p=156026"},"modified":"2020-09-12T08:50:23","modified_gmt":"2020-09-12T00:50:23","slug":"c-%e5%b8%b8%e9%87%8f%e5%8f%b3%e5%80%bc%e6%9c%89%e6%b2%a1%e6%9c%89%e5%95%a5%e6%84%8f%e4%b9%89%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=156026","title":{"rendered":"C++ \u5e38\u91cf\u53f3\u503c\u6709\u6ca1\u6709\u5565\u610f\u4e49\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  C++ \u5e38\u91cf\u53f3\u503c\u6709\u6ca1\u6709\u5565\u610f\u4e49\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : by73 <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4f8b\u5982 <code>void f(const T&amp;&amp; val)<\/code> \u8fd9\u6837\u7684\u5e38\u91cf\u53f3\u503c\uff0c\u867d\u7136\u7f16\u8bd1\u80fd\u901a\u8fc7\uff0c\u4f46\u603b\u89c9\u5f97\u8bed\u4e49\u4e0a\u602a\u602a\u7684\uff0c\u5c31\u60f3\u95ee\u95ee\u8fd9\u79cd\u5199\u6cd5\u5230\u5e95\u6709\u6ca1\u6709\u610f\u4e49\uff0c\u8fd8\u662f\u53ea\u662f\u5355\u7eaf\u7684\u56e0\u4e3a reference collapsing \u6240\u4ee5\u624d\u4fdd\u7559\u8fd9\u79cd\u5199\u6cd5\uff1f<\/p>\n<p>\uff08\u65e5\u5e38\u6c34\uff0c\u8f7b\u55b7\u3002\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3312692\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dangyuluo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             The semantics of getting a const rvalue reference (and not for =delete) is for saying:<\/p>\n<p>1. we do not support the operation for lvalues!<br \/>2. even though, we still copy, because we can&#8217;t move the passed resource, or because there is no actual meaning for &#8220;moving&#8221; it.<\/p>\n<p>\u771f\u7ea0\u7ed3                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3312693\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : amosasas <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dangyuluo C++\u7684\u65e5\u5e38&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3312694\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Wirbelwind <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u4ec0\u4e48\u610f\u4e49\uff0c\u6709\u65f6\u5019\u53ef\u4ee5\u963b\u6b62\u91cd\u8f7d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>C++ \u5e38\u91cf\u53f3\u503c\u6709\u6ca1\u6709\u5565\u610f\u4e49\uff1f \u8cc7&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\/156026"}],"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=156026"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/156026\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156026"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}