{"id":5957,"date":"2016-06-04T23:47:19","date_gmt":"2016-06-04T14:47:19","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5957"},"modified":"2017-09-05T09:21:08","modified_gmt":"2017-09-05T00:21:08","slug":"%e3%82%b0%e3%83%ad%e3%83%bc%e3%83%90%e3%83%ab%e5%a4%89%e6%95%b0%e3%81%ae%e5%88%9d%e6%9c%9f%e5%8c%96%e9%a0%86%e5%ba%8f%e3%82%92%e5%88%b6%e5%be%a1%e3%81%99%e3%82%8b%ef%bc%88%e3%81%9d%e3%81%ae%ef%bc%92","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5957","title":{"rendered":"\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e\u521d\u671f\u5316\u9806\u5e8f\u3092\u5236\u5fa1\u3059\u308b\uff08\u305d\u306e\uff12\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5939\">\u305d\u306e\uff11<\/a>\u306e\u7d9a\u304d\u3002\u4eca\u5ea6\u306f\u4ee3\u66ff\u65b9\u6cd5\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u300c\u6700\u521d\u306b\u521d\u671f\u5316\u3057\u305f\u3044\u300d\u304c\u5b9f\u969b\u306b\u306f\u300c\u4ed6\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u304b\u3089\u3044\u3064\u4f7f\u308f\u308c\u308b\u304b\u5206\u304b\u3089\u306a\u3044\u304b\u3089\u305d\u308c\u307e\u3067\u306b\u521d\u671f\u5316\u3057\u305f\u3044\u300d\u3067\u3042\u308b\u306e\u306a\u3089\u3001\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u3067\u3088\u304f\u3042\u308b\u3088\u3046\u306b\u6700\u521d\u306b\u4f7f\u3046\u6642\u306b\u521d\u671f\u5316\u3059\u308c\u3070\u3088\u3044\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u306e\u6642\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306f\u66f8\u3051\u307e\u305b\u3093\u3002<code>VEC::VEC()<\/code> \u304c\u3044\u3064\u547c\u3070\u308c\u308b\u304b\u5206\u304b\u3089\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<blockquote>\n<pre>class VEC\r\n{\r\npublic:\r\n    std::vector&lt;int&gt; *v;\r\n    VEC() { v = NULL; }\r\n    ~VEC()\r\n    {\r\n        if (v != NULL) \r\n            delete v;\r\n    }\r\n    std::vector&lt;int&gt;& vec()\r\n    {\r\n        if (v == NULL)\r\n            v = new std::vector&lt;int&gt;({ 1, 2 });\r\n        return *v;\r\n    }\r\n} vec;<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>\r\nstd::vector&lt;int&gt; other = vec.get();\r\n<\/pre>\n<\/blockquote>\n<p>\u521d\u671f\u5316\u304c\u52d5\u7684\u3067\u306a\u3051\u308c\u3070\u3044\u3044\u306e\u3067\u3001\u3053\u3046\u3044\u3046\u306e\u306a\u3089\u5927\u4e08\u592b\u306a\u306f\u305a\u3067\u3059\u3002<\/p>\n<blockquote>\n<pre>class VEC\r\n{\r\npublic:\r\n    static std::vector&lt;int&gt; *v;\r\n    ~VEC()\r\n    {\r\n        if (v != NULL) \r\n            delete v;\r\n    }\r\n    std::vector&lt;int&gt;& vec()\r\n    {\r\n        if (v == NULL)\r\n            v = new std::vector&lt;int&gt;({ 1, 2 });\r\n        return *v;\r\n    }\r\n} vec;\r\n\r\nstd::vector&lt;int&gt; *VEC::v = NULL;\r\n<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>\r\nstd::vector&lt;int&gt; other = vec.get();\r\n<\/pre>\n<\/blockquote>\n<p>\u3042\u308b\u3044\u306f\u3001\u3053\u3046\u3044\u3046\u306e\u3067\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<blockquote>\n<pre>std::vector&lt;int&gt;& vec()\r\n{\r\n    static std::vector&lt;int&gt; v = { 1, 2 };\r\n    return v;\r\n}<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>\r\nstd::vector&lt;int&gt; other = vec();\r\n<\/pre>\n<\/blockquote>\n<p>\u95a2\u6570\u306e static \u306a\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306f\u3001\u6700\u521d\u306b\u5b9f\u884c\u304c\u305d\u306e\u884c\u306b\u5230\u9054\u3057\u305f\u6642\u306b\u4e00\u5ea6\u3060\u3051\u521d\u671f\u5316\u3055\u308c\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u304c\u547c\u3070\u308c\u305f\u5834\u5408\u306b\u306e\u307f\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u304c\u547c\u3070\u308c\u307e\u3059\u3002\u306a\u304a\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\uff08\u51e6\u7406\u7cfb\u304c\u9811\u5f35\u3063\u3066\u304f\u308c\u308c\u3070\u6d88\u6ec5\u3059\u308b\uff09\u306e\u4ed6\u306b\u3001\u521d\u671f\u5316\u3092\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306b\u3059\u308b\u305f\u3081\u306b\u6392\u4ed6\u5236\u5fa1\u3059\u308b\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u304c\u767a\u751f\u3057\u307e\u3059\uff08C++11 \u3067\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u3067\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3053\u3068\u306b\u306a\u3063\u305f\uff09\u3002<\/p>\n<p>\u3042\u3001\u3067\u3082\u3053\u308c\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u304c\u3044\u3064\u547c\u3070\u308c\u308b\u304b\u5206\u304b\u3089\u306a\u3044\u305e\u2026<\/p>\n<p><a href=\"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5966\">\u305d\u306e\uff13<\/a>\u306b\u7d9a\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff11\u306e\u7d9a\u304d\u3002\u4eca\u5ea6\u306f\u4ee3\u66ff\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-5957","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5957"}],"version-history":[{"count":8,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5957\/revisions"}],"predecessor-version":[{"id":6626,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5957\/revisions\/6626"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5957"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}