{"id":33,"date":"2015-03-10T11:03:16","date_gmt":"2015-03-10T02:03:16","guid":{"rendered":"http:\/\/milennium9.godohosting.com\/wordpress\/?p=33"},"modified":"2015-03-10T11:03:16","modified_gmt":"2015-03-10T02:03:16","slug":"is_function-%ec%97%90%ec%84%9c-%ed%95%a8%ec%88%98%eb%a5%bc-%ea%b5%ac%eb%b6%84%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/milennium9.godohosting.com\/wordpress\/?p=33","title":{"rendered":"is_function \uc5d0\uc11c \ud568\uc218\ub97c \uad6c\ubd84\ud558\uae30"},"content":{"rendered":"<p>C++\uc5d0\uc11c std::is_function \ud568\uc218\ub97c \ub2e4\uc74c\uacfc \uac19\uc774 \uc0ac\uc6a9\ud574 \ubcf4\uba74 \uc608\uc0c1\ub41c \uacb0\uacfc\ub97c \ubc18\ud658\ud574 \uc8fc\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"lang:c++ decode:true\" title=\"is_function\">#include &lt;iostream&gt;\r\n#include &lt;type_traits&gt;\r\n\r\nusing namespace std;\r\n\r\nclass A {\r\n\tpublic:\r\n\tstatic void static_member_function() {\r\n\t\tcout &lt;&lt; \"hello world!!\" &lt;&lt; endl;\r\n\t}\r\n};\r\n\r\nint main() {\r\n\tcout &lt;&lt; (is_function&lt;decltype(&amp;A::static_member_function)&gt;::value ? \"true\" : \"false\") &lt;&lt; endl;\r\n\treturn 0;\r\n}<\/pre>\n<p>\uc704 \ucf54\ub4dc\uc758 \uacb0\uacfc\ub294 \"false\" \uc785\ub2c8\ub2e4.\u00a0\ud568\uc218\uc640 \ud568\uc218 \ud3ec\uc778\ud130\uc758 \ucc28\uc774\ub85c \uc778\ud574\uc11c \uc0dd\uae30\ub294 \uc774\uc288 \uc785\ub2c8\ub2e4.<\/p>\n<p>is_pointer\ub294 true\ub97c \ubc18\ud658\ud558\uc9c0\ub9cc is_function\uc740 false\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. \ub530\ub77c\uc11c \ud544\uc694\ud558\ub2e4\uba74 is_function_pointer \uac19\uc740 \ud15c\ud50c\ub9bf \ud568\uc218\ub97c \ub9cc\ub4e4\uc5b4 \uc904 \ud544\uc694\uac00 \uc788\uc2b5\ub2c8\ub2e4. \ubb3c\ub860 \uc608\uc81c\ucf54\ub4dc\uc5d0\uc11c &amp;A::static_member_function \uc5d0\uc11c &amp;\ub97c \ube80 A::static_member_function\uc744 \ub118\uae38 \uacbd\uc6b0\uc5d0\ub294 is_function\uc774 true\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. \ubb38\uc81c\ub294 \ud568\uc218 \ud3ec\uc778\ud130\ub97c \ub118\uae30\ub294 \ub9ce\uc740 \uacbd\uc6b0 \ud568\uc218 \ud3ec\uc778\ud130\ub97c \ubc1b\uc544\uc11c \ub2e4\ub978 \uc704\uce58\uc5d0\uc11c \ud568\uc218 \ud3ec\uc778\ud130\ub97c \uc774\uc6a9\ud55c \ud638\ucd9c\uc744 \ud558\uae30 \uc704\ud568\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc81c\uac00 \ub9cc\ub09c \ucf00\uc774\uc2a4\ub294 Lua\uc5d0 \uac12\uc744 \ubc14\uc778\ub529 \ud560 \ub54c \ud568\uc218\uc77c \uacbd\uc6b0\uc640 \uac12\uc77c \uacbd\uc6b0\ub97c \uad6c\ubd84\ud558\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud558\ub294 \uacfc\uc815\uc5d0\uc11c \ub9cc\ub09c \uc774\uc288\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"lang:default decode:true\">template&lt;typename T&gt;\r\nvoid SetGlobal(const char* name, T arg) {\r\n    std::_If&lt;std::is_function&lt;T&gt;::value,\r\n        FunctionBinder&lt;T&gt;,  \/\/ lua\uc5d0 \ud568\uc218\ub97c \ubc14\uc778\ub529 \ud558\ub294 functor\r\n        ValueBinder&lt;T&gt;      \/\/ lua\uc5d0 \ubcc0\uc218\ub97c \ubc14\uc778\ub529 \ud558\ub294 functor\r\n    &gt;::type() (L, name, arg);\r\n}<\/pre>\n<p>\uc704\uc758 \uacbd\uc6b0 T\ub85c \ud568\uc218 \ud3ec\uc778\ud130\uac00 \ub118\uc5b4\uc624\uac8c \ub418\ub294\ub370 \ub9cc\ub4e4\uace0 \ubcf4\ub2c8 is_function\uc5d0\uc11c false\uac00 \ub118\uc5b4\uc624\uae38\ub798 \ub2e4\uc74c\uacfc \uac19\uc774 \uc218\uc815\ud558\uc5ec \ud574\uacb0\ud558\uc600\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"lang:c++ decode:true \">template&lt;typename T&gt;\r\nvoid SetGlobal(const char* name, T arg) {\r\n    std::_If&lt;std::is_pinter&lt;T&gt;::value&amp;&amp;std::is_function&lt;std::remove_pointer&lt;T&gt;::type&gt;::value,\r\n        FunctionBinder&lt;T&gt;,  \/\/ lua\uc5d0 \ud568\uc218\ub97c \ubc14\uc778\ub529 \ud558\ub294 functor\r\n        ValueBinder&lt;T&gt;      \/\/ lua\uc5d0 \ubcc0\uc218\ub97c \ubc14\uc778\ub529 \ud558\ub294 functor\r\n    &gt;::type() (L, name, arg);\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++\uc5d0\uc11c std::is_function \ud568\uc218\ub97c \ub2e4\uc74c\uacfc \uac19\uc774 \uc0ac\uc6a9\ud574 \ubcf4\uba74 \uc608\uc0c1\ub41c \uacb0\uacfc\ub97c \ubc18\ud658\ud574 \uc8fc\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. #include &lt;iostream&gt; #include &lt;type_traits&gt; using namespace std; class A { public: static void static_member_function() { cout &lt;&lt; &#8220;hello world!!&#8221; &lt;&lt; endl; } }; int main() { cout &lt;&lt; (is_function&lt;decltype(&amp;A::static_member_function)&gt;::value ? &#8220;true&#8221; : &#8220;false&#8221;) &lt;&lt; endl; return 0; } \uc704 \ucf54\ub4dc\uc758 \uacb0\uacfc\ub294 &#8220;false&#8221; \uc785\ub2c8\ub2e4.\u00a0\ud568\uc218\uc640 &hellip; <a href=\"http:\/\/milennium9.godohosting.com\/wordpress\/?p=33\" class=\"more-link\"><span class=\"screen-reader-text\">is_function \uc5d0\uc11c \ud568\uc218\ub97c \uad6c\ubd84\ud558\uae30<\/span> \ub354\ubcf4\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0},"categories":[4],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5PypW-x","_links":{"self":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/33"}],"collection":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":1,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":34,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/34"}],"wp:attachment":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}