{"id":13,"date":"2019-03-30T14:53:45","date_gmt":"2019-03-30T14:53:45","guid":{"rendered":"http:\/\/www.fabricioruch.ch\/?p=13"},"modified":"2025-01-19T16:10:58","modified_gmt":"2025-01-19T16:10:58","slug":"c-class-and-preventing-object-copy","status":"publish","type":"post","link":"https:\/\/www.fabricioruch.ch\/?p=13","title":{"rendered":"C++ Class and Preventing Object Copy"},"content":{"rendered":"\n<p>In some cases, an instance of a C++ class should not be copied at all. There are three ways to prevent such an\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Object_copy\">object copy<\/a>: keeping the copy constructor and assignment operator private, using a special non-copyable mixin, or deleting those special member functions.<\/p>\n\n\n\n<p><a href=\"https:\/\/ariya.io\/2015\/01\/c-class-and-preventing-object-copy\">https:\/\/ariya.io\/2015\/01\/c-class-and-preventing-object-copy<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In some cases, an instance of a C++ class should not be copied at all. There are three ways to prevent such an\u00a0object copy: keeping the copy constructor and assignment operator private, using a special non-copyable mixin, or deleting those&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-cpp"],"_links":{"self":[{"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":2,"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":19,"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions\/19"}],"wp:attachment":[{"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fabricioruch.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}