{"id":767,"date":"2008-10-07T10:44:51","date_gmt":"2008-10-07T01:44:51","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=767"},"modified":"2017-02-06T14:34:20","modified_gmt":"2017-02-06T05:34:20","slug":"c-template-summary-33","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=767","title":{"rendered":"[C++] Template Summary &#8211; 3\/3"},"content":{"rendered":"<p><strong>\ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\ub3c4 \ud2b9\uc218\ud654<\/strong>\uac00 \uac00\ub2a5\ud558\uba70, \ud2b9\uc218\ud654\ub97c \uc704\ud574\uc11c\ub294 \ud2b9\uc218\ud654 \ub300\uc0c1\uc774 \ub418\ub294 \ud15c\ud50c\ub9bf \ud074\ub798\uc2a4\uac00 \ud544\uc694\ud558\ub2e4. \uc544\ub798\ub294 \ub300\uc0c1\uc774 \ub418\ub294 \ud15c\ud50c\ub9bf \ud074\ub798\uc2a4\uc640 \uc774\ub97c \ud2b9\uc815 \ud0c0\uc785(double)\uc5d0 \ub300\ud574 \ud2b9\uc218\ud654 \uc2dc\ud0a8 \uc608\uc774\ub2e4.<\/p>\n<pre>template class BASE {\r\npublic:\r\n\tT func() {};\r\n};\r\n\r\ntemplate<> class BASE {\r\npublic:\r\n\tint FuNc(float v) {};\r\n};\r\n<\/pre>\n<p>\uc8fc\uc9c0\ud560 \uc810\uc740 \u00a0\uae30\ubcf8 \ub300\uc0c1\uc774 \ub418\ub294 \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\uc778 BASE\uc640 double \ud0c0\uc785\uc5d0 \ub300\ud574 \ud2b9\uc218\ud654\ub41c \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf BASE\ub294 \uc644\uc804\ud788 \ubcc4\uac1c\uc758 \ud074\ub798\uc2a4\ub77c\ub294 \uc810\uc73c\ub85c, \uc704\ucc98\ub7fc \uc11c\ub85c \uac00\uc9c0\uace0 \uc788\ub294 \ub9f4\ubc84\uc5d0 \uacf5\ud1b5\uc810\uc774 \uc5c6\ub2e4.<\/p>\n<p>\ud15c\ud50c\ub9bf \ud074\ub798\uc2a4 \uc790\uccb4\ub97c \ud2b9\uc218\ud654\ud558\ub294 \uacbd\uc6b0 \ubfd0\ub9cc \uc544\ub2c8\ub77c, \uac00\uc9c0\uace0 \uc788\ub294 \ub9f4\ubc84 \ud568\uc218\ub9cc\uc744 \ucf55&#8230; \uc9c0\uc815\ud574\uc11c \ud2b9\uc218\ud654 \ud558\ub294 \uac83\ub3c4 \uac00\ub2a5\ud558\ub2e4. \uc544\ub798\ub294 \uadf8 \uc608\uc774\ub2e4.<\/p>\n<pre>template class BASE {\r\npublic:\r\n    T func() {};\r\n};\r\n\r\ntemplate<> int BASE::func()\r\n{\r\n\t\/\/ another implementation for int type\r\n}<\/pre>\n<p>\uc704\uc758 \uc608\ub294 BASE \ud568\uc218\uc758 func \ud568\uc218\uc5d0 \ub300\ud574 T\uac00 int\uc77c\ub54c\uc5d0 \ub300\ud55c \ud2b9\uc218\ud654\uc758 \uc608\uc774\ub2e4.<\/p>\n<p>\ud15c\ud50c\ub9bf \uc778\uc790\uc5f4 \ubcc0\ud615\uc744 \ud1b5\ud55c \ud2b9\uc218\ud654, \uc989 <strong>\ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf \ubd80\ubd84 \ud2b9\uc218\ud654<\/strong>\uc758 \uc608<\/p>\n<pre>template class CLASS_NAME {}; \/\/\r\ntemplate class CLASS_NAME&lt;T*, T, i&gt; {};     \/\/\r\ntemplate class CLASS_NAME&lt;char, T, 5&gt; {};          \/\/\r\ntemplate class CLASS_NAME&lt;T*, T, 0&gt; {};            \/\/\r\n<\/pre>\n<p>\uc774 \ud2b9\uc218\ud654 \ub300\uc0c1\uc774 \ub418\ub294 \uc6d0\ub798 \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\uc774\uba70, , , \uac00 \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf \ubd80\ubd84 \ud2b9\uc218\ud654\uc758 \uacbd\uc6b0\uc774\ub2e4.<\/p>\n<p>\ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\uc774 \uc0ac\uc6a9\ub418\ub294 \uacbd\uc6b0\ub294 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n<pre>CLASS_NAME&lt;int, double, 10&gt; a;<\/pre>\n<p>, , \uc5d0 \ub300\ud55c \uc2e4\uc81c \uc0ac\uc6a9 \uc608\ub294 \uc544\ub798\uc640 \uac19\uc73c\uba70 \uc21c\uc11c\ub300\ub85c \uac01 , , \uc5d0 \uc77c\uce58\ud55c\ub2e4.<\/p>\n<pre>CLASS_NAME&lt;int*, int, 20&gt; b;\r\nCLASS_NAME&lt;char, float, 5&gt; c;\r\nCLASS_NAME&lt;char*, char, 3&gt; d;\r\n<\/pre>\n<p>\uc8fc\ubaa9\ud560 \uc810\uc740 \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf \ubd80\ubd84 \ud2b9\ud654\uc758 \uacbd\uc6b0 \ud2b9\uc218\ud654 \ub300\uc0c1\uc774 \ub418\ub294 \uc6d0\ub798 \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\uacfc \ud15c\ud50c\ub9bf \uc778\uc790\uc758 \uac1c\uc218\uac00 \uc815\ud655\ud788 \uc77c\uce58\ud574\uc57c\ud55c\ub2e4. \uc704\uc758 \uacbd\uc6b0 3\uac1c\ub85c\uc368 &lt;type, type, int value&gt;\uc774\ub2e4. \ub610\ud55c , , , \uc758 \ud15c\ud50c\ub9bf \ud074\ub798\uc2a4\ub294 \uc11c\ub85c \uc644\uc804\uc774 \ub2e4\ub978 \ud074\ub798\uc2a4 \ub77c\ub294 \uc810\uc774\uba70, \ub2e8\uc9c0 \ud15c\ud50c\ub9bf\uc744 \ud1b5\ud55c \uad00\uacc4\ub97c \uc720\uc77c\ud55c \uacf5\ud1b5\uc810\uc73c\ub85c \uac00\uc9c0\uace0 \uc788\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\ub3c4 \ud2b9\uc218\ud654\uac00 \uac00\ub2a5\ud558\uba70, \ud2b9\uc218\ud654\ub97c \uc704\ud574\uc11c\ub294 \ud2b9\uc218\ud654 \ub300\uc0c1\uc774 \ub418\ub294 \ud15c\ud50c\ub9bf \ud074\ub798\uc2a4\uac00 \ud544\uc694\ud558\ub2e4. \uc544\ub798\ub294 \ub300\uc0c1\uc774 \ub418\ub294 \ud15c\ud50c\ub9bf \ud074\ub798\uc2a4\uc640 \uc774\ub97c \ud2b9\uc815 \ud0c0\uc785(double)\uc5d0 \ub300\ud574 \ud2b9\uc218\ud654 \uc2dc\ud0a8 \uc608\uc774\ub2e4. template class BASE { public: T func() {}; }; template class BASE { public: int FuNc(float v) {}; }; \uc8fc\uc9c0\ud560 \uc810\uc740 \u00a0\uae30\ubcf8 \ub300\uc0c1\uc774 \ub418\ub294 \ud074\ub798\uc2a4 \ud15c\ud50c\ub9bf\uc778 BASE\uc640 double \ud0c0\uc785\uc5d0 \ub300\ud574 \ud2b9\uc218\ud654\ub41c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=767\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[C++] Template Summary &#8211; 3\/3&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,8],"tags":[14,17],"class_list":["post-767","post","type-post","status-publish","format-standard","hentry","category-cpp","category-programming","tag-c","tag-template"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=767"}],"version-history":[{"count":2,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/767\/revisions"}],"predecessor-version":[{"id":4417,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/767\/revisions\/4417"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=767"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}