{"id":278,"date":"2007-11-29T01:58:39","date_gmt":"2007-11-29T05:58:39","guid":{"rendered":"http:\/\/www.rakkar.org\/blog\/?p=278"},"modified":"2007-11-29T01:58:39","modified_gmt":"2007-11-29T05:58:39","slug":"smart-pointer-system","status":"publish","type":"post","link":"https:\/\/rakkar.org\/blog\/index.php\/2007\/11\/29\/smart-pointer-system\/","title":{"rendered":"Smart Pointer System"},"content":{"rendered":"<p>\t\t\t\tI&#8217;ve taken a liking to smart pointers lately.  The overhead is negligible and it&#8217;s vastly easier than having to keep track of pointers all over the place.<\/p>\n<p>I read a bit about the std smart pointer.  I don&#8217;t understand why the articles on smart pointers are so long or complicated, or why the boost library made a smart pointer.  To me this seems the easiest thing in the world.  Perhaps I don&#8217;t understand all the issues involved?<\/p>\n<p><a HREF=\"http:\/\/www.rakkar.org\/sourcecode\/RakSmartObj.h.txt\">Smart Object<\/a><\/p>\n<p><a HREF=\"http:\/\/www.rakkar.org\/sourcecode\/RakSmartPtr.h.txt\">Smart Pointer<\/a><\/p>\n<p>To use it, just derive your class from RakSmartObj.  When instantiating your class, assign the pointer to an instance of RakSmartPtr.  When all instances of RakSmartPtr are deleted or assigned to 0, then the class instance is automatically deleted.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve taken a liking to smart pointers lately. The overhead is negligible and it&#8217;s vastly easier than having to keep track of pointers all over the place. I read a bit about the std smart pointer. I don&#8217;t understand why the articles on smart pointers are so long or complicated, or why the boost library [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/278"}],"collection":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":0,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"wp:attachment":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}