{"id":2448,"date":"2016-01-03T22:20:15","date_gmt":"2016-01-03T21:20:15","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=2448"},"modified":"2016-01-03T22:20:15","modified_gmt":"2016-01-03T21:20:15","slug":"xkcd-1188-bounding","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=2448","title":{"rendered":"XKCD 1188 BOUNDING"},"content":{"rendered":"<p><a href=\"http:\/\/xkcd.com\/1188\/\">http:\/\/xkcd.com\/1188\/<\/a><\/p>\n<p>Lame Segfault.<\/p>\n<pre><code>\r\n#include &lt;exception>\r\nusing namespace std;\r\nstruct Ball : public exception {\r\n};\r\n\r\nstruct P {\r\n  P* target;\r\n  void aim(const Ball& ball) {\r\n    try {\r\n      throw ball;\r\n    }\r\n    catch(Ball& ball) {\r\n      target->aim(ball);\r\n    }    \r\n  }\r\n};\r\n\r\nint main() {\r\n  P parent;\r\n  P child{&parent};\r\n  parent.target = &child;\r\n  parent.aim(Ball());\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/xkcd.com\/1188\/ Lame Segfault. #include &lt;exception> using namespace std; struct Ball : public exception { }; struct P { P* target; void aim(const Ball&#038; ball) { try { throw ball; } catch(Ball&#038; ball) { target->aim(ball); } } }; int main() { P parent; P child{&#038;parent}; parent.target = &child; parent.aim(Ball()); }<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[17],"class_list":["post-2448","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-cpp"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2448"}],"version-history":[{"count":2,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2448\/revisions"}],"predecessor-version":[{"id":2450,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2448\/revisions\/2450"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2448"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}