{"id":3045,"date":"2019-04-15T03:07:07","date_gmt":"2019-04-15T03:07:07","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=3045"},"modified":"2019-05-16T12:57:48","modified_gmt":"2019-05-16T03:57:48","slug":"cpp-__pretty_function__","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/3045","title":{"rendered":"[CPP] __PRETTY_FUNCTION__"},"content":{"rendered":"<h3>\u75c7\u72b6<\/h3>\n<p>Visual Studio \u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<pre class=\"lang:default highlight:0 decode:true \" >C3861 `__PRETTY_FUNCTION__`: \u8b58\u5225\u5b50\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f<\/pre>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h3>\u539f\u56e0<\/h3>\n<p><code>__PRETTY_FUNCTION__<\/code> \u30de\u30af\u30ed\u306f\u51e6\u7406\u7cfb\u4f9d\u5b58\u3067 Visual Studio \u306b\u306f\u5b58\u5728\u3057\u306a\u3044\uff08\u672a\u5b9a\u7fa9\u3067\u3042\u308b\uff09\u305f\u3081\u3002<\/p>\n<p>\u985e\u4f3c\u306eC\u8a00\u8a9e\u306e\u30de\u30af\u30ed\u306b <code>__FUNCTION__<\/code> \u304c\u3042\u308b\u3002<br \/>\n<code>__PRETTY_FUNCTION__<\/code> \u306f <code>__FUNCTION__<\/code> \u30de\u30af\u30ed\u306eC++\u9ad8\u6a5f\u80fd\u7248\u3068\u307f\u306a\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Visual Studio\u306b\u304a\u3051\u308b\u89e3\u6c7a\u7b56<\/h3>\n<p><code>__FUNCSIG__<\/code> \u307e\u305f\u306f <code>__func__<\/code> \u306b\u7f6e\u304d\u63db\u3048\u308b\u3002<\/p>\n<pre class=\"lang:c++ decode:true \" >#define __PRETTY_FUNCTION__    __FUNCSIG__<\/pre>\n<p>&nbsp;<\/p>\n<h3>GCC\u306e\u304a\u3051\u308b __PRETTY_FUNCTION__ \u306e\u30de\u30af\u30ed\u5c55\u958b\u4f8b<\/h3>\n<pre class=\"lang:c++ decode:true \" >#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\nclass Dog\r\n{\r\npublic:\r\n\tvoid bark() {\r\n\t\tcout &lt;&lt; __FUNCTION__ &lt;&lt; endl;\t\t\t\/\/ =&gt; \"bark\"\r\n\t\tcout &lt;&lt; __PRETTY_FUNCTION__ &lt;&lt; endl;\t\/\/ =&gt; \"void Dog::bark()\r\n\t\tcout &lt;&lt; \"Bow-wow\" &lt;&lt; endl;\t\t\t\t\/\/ =&gt; \"Bow-wow\"\r\n\t};\r\n};\r\n\r\nint main()\r\n{\r\n\tcout &lt;&lt; __FUNCTION__ &lt;&lt; endl;\t\t\t\t\/\/ =&gt; \"main\"\r\n\tcout &lt;&lt; __PRETTY_FUNCTION__ &lt;&lt; endl;\t\t\/\/ =&gt; \"int main()\"\r\n\t\r\n\tDog myDog;\t\r\n\tmyDog.bark();\r\n\t\r\n\treturn 0;\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u75c7\u72b6 Visual Studio \u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002 C3861 `__PRETTY_FUNCTION__`: \u8b58\u5225\u5b50\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[84],"class_list":["post-3045","post","type-post","status-publish","format-standard","hentry","category-memo","tag-cpp"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=3045"}],"version-history":[{"count":7,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3045\/revisions"}],"predecessor-version":[{"id":3087,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3045\/revisions\/3087"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=3045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=3045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=3045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}