{"id":409,"date":"2009-08-12T11:04:12","date_gmt":"2009-08-12T02:04:12","guid":{"rendered":"http:\/\/mk.miko.jp\/blog\/?p=409"},"modified":"2011-03-05T13:53:58","modified_gmt":"2011-03-05T04:53:58","slug":"%e3%82%b9%e3%83%ac%e3%83%83%e3%83%89%e9%96%93%e9%80%9a%e4%bf%a1%e9%a3%bd%e3%81%8d%e3%81%9f","status":"publish","type":"post","link":"http:\/\/mk.miko.jp\/blog\/archives\/409","title":{"rendered":"\u30b9\u30ec\u30c3\u30c9\u9593\u901a\u4fe1\u98fd\u304d\u305f"},"content":{"rendered":"<p>\u3000\u4f55\u304b\u3053\u3053\u306f\u901f\u5ea6\u8981\u308b\u3082\u3093\u3089\u3057\u3044\u304b\u3089\u3001\u901f\u5ea6\u51fa\u308b\u3088\u3046\u306b\u9811\u5f35\u3063\u3066\u66f8\u3044\u3066\u308b\u3093\u3060\u3051\u3069\u98fd\u304d\u305f\u3002<br \/>\n\u3000\u623b\u308a\u5024\u304c\u6b32\u3057\u3044\u3068\u3053\u306a\u3093\u3066\u3001\u6f14\u7b97\u8981\u6c42\u6295\u3052\u3066\u3057\u3070\u3089\u304f\u5f8c\u306b\u53d7\u3051\u53d6\u308a\u51e6\u7406\u7f6e\u3044\u305f\u308a\u3001\u3068\u304b8087\u81ed\u304c\u3057\u3066\u6271\u3044\u306b\u304f\u305d\u3046\u3067\u56f0\u308b\u3002\u623b\u308a\u5024\u3084\u5f15\u6570\u306e\u578b\u3092\u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u9762\u5012\u898b\u3066\u304f\u308c\u306a\u3044\u3088\u3046\u306a\u4e16\u754c\u306b\u7a81\u3063\u8fbc\u3093\u3067\u3044\u3044\u306e\u304b\u3069\u3046\u304b\u3002\u307e\u30fc\u3001\u3084\u3063\u3066\u3057\u307e\u3048\u3070\u554f\u984c\u7121\u304f\u66f8\u3051\u308b\u3093\u3060\u308d\u3046\u3068\u306f\u601d\u3046\u304c\u3002<\/p>\n<p>\u3000\u4f8b\u306et2t_pipe\u306f\u3001pop()\u3068pop_and_clear()\u3092\u5206\u3051\u3066\u3001<\/p>\n<pre class=\"brush:cpp\">  T pop () {\r\n    assert( ! empty() );\r\n    RMB();\r\n    T result = buf_[index_to_pop_];\r\n    index_to_pop_ = next_index_of( index_to_pop_ );\r\n    WMB();\r\n    return result;\r\n  }\r\n  T pop_and_clear () {\r\n    assert( ! empty() );\r\n    T result;\r\n    RMB();\r\n    { using namespace std;\r\n      swap( result, buf_[index_to_pop_] );\r\n    }\r\n    index_to_pop_ = next_index_of( index_to_pop_ );\r\n    WMB();\r\n    return result;\r\n  }<\/pre>\n<p>\u3053\u3093\u306a\u3093\u306b\u306a\u3063\u305f\u3002POD\u306a\u3093\u304b\u306fpop()\u3067\u3044\u3044\u3057\u3001shared_ptr\u307f\u305f\u3044\u306a\u306e\u306fpop_and_clear()\u3067\u5373\u524a\u9664\u3055\u305b\u308b\u611f\u3058\u3002\u30af\u30ea\u30a2\u3057\u305f\u3044\u304b\u306f\u8272\u3005\u306a\u72b6\u6cc1\u304c\u3042\u308b\u304b\u3089\u3001SFINAE\u3067\u5206\u3051\u308b\u306e\u306f\u7121\u7406\u3002\u30d1\u30a4\u30d7\u30af\u30e9\u30b9\u81ea\u4f53\u3092\u4e8c\u3064\u4f5c\u308b\u624b\u3082\u3042\u308b\u3051\u3069\u3001\u307e\u3042\u3053\u308c\u3067\u3082\u3044\u3044\u3060\u308d\u3002<br \/>\n\u3000\u51fa\u6765\u308c\u3070\u3001\u9001\u4fe1\u5c02\u7528\u306e\u95a2\u6570\u306f\u9001\u4fe1\u5074\u306b\u3057\u304b\u898b\u3048\u306a\u3044\u3088\u3046\u306a\u8a2d\u8a08\u306b\u3057\u305f\u3044\u3093\u3060\u3051\u3069\u3001\u601d\u3044\u3064\u304b\u306a\u304f\u3066\u3081\u3093\u3069\u304f\u3055\u3044\u304b\u3089\u3057\u3066\u306a\u3044\u3002\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3068\u304b\u52c9\u5f37\u3059\u308a\u3083\u51fa\u3066\u304f\u308b\u306e\u304b\u306a\u3042\u3002\u307e\u30fc\u3044\u3044\u304b\u4eca\u306f\u3053\u308c\u3067\u3082\u3002<br \/>\n\u3000\u3053\u308c\u3067\u5927\u4f53\u5b8c\u6210\u306a\u306e\u304b\u306a\u3042\u3002\u91cd\u304f\u3057\u305f\u304f\u306a\u3044\u3057\u306a\u3042\u3002\u547c\u3073\u51fa\u3057\u5074\u304c\u3044\u3061\u3044\u3061\u5f85\u6a5f\u30eb\u30fc\u30d7\u3092\u7d44\u3080\u306e\u304c\u3081\u3093\u3069\u304f\u3055\u3044\u304c\u3001\u30d0\u30eb\u30af\u5316\u3059\u308b\u6642\u306f\u9006\u306b\u697d\u305d\u3046\u306a\u611f\u3058\u304c\u3059\u308b\u3002<br \/>\n\u3000\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u3060\u304b\u3089full()\u306a\u3093\u304b\u30c1\u30a7\u30c3\u30af\u3057\u306a\u304d\u3083\u306a\u3089\u306a\u3044\u3093\u3060\u3088\u3001\u3063\u3066\u8003\u3048\u65b9\u3082\u3042\u308b\u3002\u3064\u307e\u308a\u6a19\u6e96\u306equeue\u304bdeque\u8fba\u308a\u306b\u7a81\u3063\u8fbc\u3081\u3070\u3001\u3068\u3002\u591a\u5206\u3069\u3046\u305b\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306a\u30b3\u30f3\u30c6\u30ca\u3067\u306f\u306a\u3044\u304b\u3089\u3001full()\u304c\u8d77\u304d\u305f\u3089\u30b9\u30ec\u30c3\u30c9\u30ed\u30fc\u30ab\u30eb\u306astd::queue\u306b\u7a81\u3063\u8fbc\u3093\u3067\u304a\u304f\u65b9\u5f0f\u3068\u304b\u3060\u306a\u3002<br \/>\n\u3000\u3046\u3093\u3002\u30dc\u30c4\u3060\uff08\u7b11\uff09\u3002\u3076\u3063\u3061\u3083\u3051\u3001full()\u304c\u8d77\u304d\u308b\u3088\u3046\u306a\u72b6\u6cc1\u306b\u306a\u3063\u305f\u3089\u9001\u4fe1\u5074\u306f\u3061\u3087\u3063\u3068\u4f11\u3093\u3067\u308d\u3002\u983b\u767a\u3059\u308b\u3088\u3046\u306a\u3089\u5171\u6709\u30d1\u30a4\u30d7\u5c0f\u3055\u3059\u304e\u3060\u308d\u3046\u3057\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u306f\u4f11\u307f\u7121\u304f\u6c38\u4e45\u306bpush()\u3057\u7d9a\u3051\u308b\u53ef\u80fd\u6027\u3082\u3042\u308b\u3057\u3002\u3084\u3063\u3071\u3053\u306e\u307e\u307e\u3067\u3044\u3044\u3079\u3002<\/p>\n<p>\u3000\u3093\u3058\u3083\u3001t2t_pipe&lt;int&gt;\u3067\u3082\u4f5c\u3063\u3066\u3001\u3069\u3046\u6700\u9069\u5316\u3055\u308c\u308b\u304b\u898b\u3066\u307f\u3088\u3046\u305c\u30fc\u3002<br \/>\n\u3000\u898b\u3066\u307f\u305f\u3002\u5927\u4f53\u30ac\u30c1\u3067\u524a\u3089\u308c\u3066\u305f\u3002\u3081\u3067\u305f\u3057\u3081\u3067\u305f\u3057\u3002t2t_pipe&lt; shared_ptr&lt;new T&gt; &gt;\u3068\u304b\u306b\u6bd4\u3079\u305f\u3089\u96f2\u6ce5\u306e\u30bd\u30ec\u3060\u306a\u3002<br \/>\n\u3000\u3060\u304c\u30e1\u30e2\u30ea\u30a2\u30af\u30bb\u30b9\u306f\u305d\u308c\u306a\u308a\u306b\u6b8b\u308b\u306a\u2026\u3002\u5225\u30b9\u30ec\u30c3\u30c9\u3078\u306e\u9ad8\u901f\u306a\u901a\u4fe1\u3063\u3066\u30e1\u30e2\u30ea\u4ee5\u5916\u7121\u3044\u3088\u306a\u3042\u3002\u30b3\u30a2\u9593\u306eP2P\u901a\u4fe1\u30ec\u30b8\u30b9\u30bf\u3068\u304b\u7121\u3044\u3067\u3059\u304b\u3002<br \/>\n\u3000\u3064\u30fc\u304b\u305d\u3046\u3044\u3046\u9811\u5f35\u308b\u30a2\u30d7\u30ea\u66f8\u3044\u3066\u308b\u8a33\u3058\u3083\u306a\u3044\u3093\u3060\u3063\u3066\u306e\u306b\u4ffa\u306f\u3002\u307e\u3042\u7121\u99c4\u306a\u30d1\u30ba\u30eb\u904a\u3073\u306e\u7656\u306f\u76f4\u3089\u306a\u3044\u3093\u3060\u308d\u3046\u306a\u3042\uff08\u7b11\uff09\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u4f55\u304b\u3053\u3053\u306f\u901f\u5ea6\u8981\u308b\u3082\u3093\u3089\u3057\u3044\u304b\u3089\u3001\u901f\u5ea6\u51fa\u308b\u3088\u3046\u306b\u9811\u5f35\u3063\u3066\u66f8\u3044\u3066\u308b\u3093\u3060\u3051\u3069\u98fd\u304d\u305f\u3002 \u3000\u623b\u308a\u5024\u304c\u6b32\u3057\u3044\u3068\u3053\u306a\u3093\u3066\u3001\u6f14\u7b97\u8981\u6c42\u6295\u3052\u3066\u3057\u3070\u3089\u304f\u5f8c\u306b\u53d7\u3051\u53d6\u308a\u51e6\u7406\u7f6e\u3044\u305f\u308a\u3001\u3068\u304b8087\u81ed\u304c\u3057\u3066\u6271\u3044\u306b\u304f\u305d\u3046\u3067\u56f0\u308b\u3002\u623b\u308a\u5024\u3084\u5f15\u6570\u306e\u578b\u3092\u30b3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts\/409"}],"collection":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/comments?post=409"}],"version-history":[{"count":0,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/posts\/409\/revisions"}],"wp:attachment":[{"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/media?parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/categories?post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mk.miko.jp\/blog\/wp-json\/wp\/v2\/tags?post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}