{"id":9797,"date":"2024-08-05T09:02:39","date_gmt":"2024-08-05T09:02:39","guid":{"rendered":"https:\/\/www.modernescpp.com\/?p=9797"},"modified":"2024-08-05T09:02:39","modified_gmt":"2024-08-05T09:02:39","slug":"feature-testing-macros","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/feature-testing-macros\/","title":{"rendered":"Feature Testing Macros"},"content":{"rendered":"\n<p>The feature testing macros is a relatively unknown feature in C + + 20. They give you the definitive answer to which C++ feature your compiler supports.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"399\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/TimelineCpp20.png\" alt=\"\" class=\"wp-image-9801\" style=\"width:800px;height:auto\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/TimelineCpp20.png 964w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/TimelineCpp20-300x124.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/TimelineCpp20-768x318.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/TimelineCpp20-705x292.png 705w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><\/figure>\n\n\n\n<p>When you try out the latest C++ features, you often get errors. Now the question is: who is to blame?<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Did you make a mistake?<\/li>\n\n\n\n<li>Does your compiler support this feature?<\/li>\n\n\n\n<li>Did you find a compiler bug?<\/li>\n<\/ol>\n\n\n\n<p>Option 3 occurs rarely, so you have only one question to answer: Does your compiler support this feature?<\/p>\n\n\n\n<p>This question is easy to answer thanks to the cppreference and the feature testing macros.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C++ Compiler Support<\/h2>\n\n\n\n<p>As so often, <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/compiler_support\">cppreference.com\/compiler_support<\/a> answers questions about the core language and library, including the C++11 standards up to C++ 26.<\/p>\n\n\n\n<p>The following tables give you an overview of the core language and library support for the C++26 standard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> C++26 Core Language<\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1030\" height=\"620\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Core-1030x620.png\" alt=\"\" class=\"wp-image-9806\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Core-1030x620.png 1030w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Core-300x181.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Core-768x462.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Core-705x424.png 705w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Core.png 1198w\" sizes=\"auto, (max-width: 1030px) 100vw, 1030px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"> C++26 Library<\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"841\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Library.png\" alt=\"\" class=\"wp-image-9807\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Library.png 1012w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Library-300x249.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Library-768x638.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/Library-705x586.png 705w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/figure>\n\n\n\n<p> Are the answers not specific enough? Let me jump to the feature testing macros in C++20.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"> Feature Testing macros<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>The header <code>&lt;version><\/code> allows you to ask your compiler for its C++11 or later support. You can ask for attributes, features of the core language, or the library. <code>&lt;version><\/code> has more than 300 macros defined, which expand to a number when the feature is implemented. The number represents the year and month the feature was added to the C++ draft standard. These are the numbers for static_assert, lambdas, and <code>concepts<\/code>.<\/p>\n\n\n\n__cpp_static_assert  200410L\n__cpp_lambdas  200907L\n__cpp_concepts 201907L\n\n\n\n<p> The <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/feature_test\">page feature testing <\/a>macros shows all macros.<\/p>\n\n\n\n<p>The following program, adopted from the cppreference, displays all C++20 core language macros. The flag <code>\/Zc:__cplusplus<\/code> enables the feature testing macro on Windows.<\/p>\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f3f3; overflow:auto;width:auto;gray;border-width:.1em .1em .1em .8em\"><pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #0099FF; font-style: italic\">\/\/ featureTesting20.cpp<\/span>\n<span style=\"color: #0099FF; font-style: italic\">\/\/ from cppreference.com<\/span>\n\n<span style=\"color: #009999\">#if __cplusplus &lt; 201100<\/span>\n<span style=\"color: #009999\">#  error &quot;C++11 or better is required&quot;<\/span>\n<span style=\"color: #009999\">#endif<\/span>\n \n<span style=\"color: #009999\">#include &lt;algorithm&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;cstring&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;iomanip&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;iostream&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;string&gt;<\/span>\n \n<span style=\"color: #009999\">#ifdef __has_include<\/span>\n<span style=\"color: #009999\"># if __has_include(&lt;version&gt;)<\/span>\n<span style=\"color: #009999\">#   include &lt;version&gt;<\/span>\n<span style=\"color: #009999\"># endif<\/span>\n<span style=\"color: #009999\">#endif<\/span>\n \n<span style=\"color: #009999\">#define COMPILER_FEATURE_VALUE(value) #value<\/span>\n<span style=\"color: #009999\">#define COMPILER_FEATURE_ENTRY(name) { #name, COMPILER_FEATURE_VALUE(name) },<\/span>\n \n<span style=\"color: #009999\">#ifdef __has_cpp_attribute<\/span>\n<span style=\"color: #009999\"># define COMPILER_ATTRIBUTE_VALUE_AS_STRING(s) #s<\/span>\n<span style=\"color: #009999\"># define COMPILER_ATTRIBUTE_AS_NUMBER(x) COMPILER_ATTRIBUTE_VALUE_AS_STRING(x)<\/span>\n<span style=\"color: #009999\"># define COMPILER_ATTRIBUTE_ENTRY(attr) \\<\/span>\n<span style=\"color: #009999\">  { #attr, COMPILER_ATTRIBUTE_AS_NUMBER(__has_cpp_attribute(attr)) },<\/span>\n<span style=\"color: #009999\">#else<\/span>\n<span style=\"color: #009999\"># define COMPILER_ATTRIBUTE_ENTRY(attr) { #attr, &quot;_&quot; },<\/span>\n<span style=\"color: #009999\">#endif<\/span>\n \n<span style=\"color: #0099FF; font-style: italic\">\/\/ Change these options to print out only necessary info.<\/span>\n<span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #006699; font-weight: bold\">struct<\/span> PrintOptions {\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> titles               <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> attributes           <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> general_features     <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> core_features        <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> lib_features         <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> supported_features   <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> unsupported_features <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> sorted_by_value      <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">0<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> cxx11                <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> cxx14                <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> cxx17                <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> cxx20                <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">1<\/span>;\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">bool<\/span> cxx23                <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">0<\/span>;\n}   print;\n \n<span style=\"color: #006699; font-weight: bold\">struct<\/span> CompilerFeature {\n    CompilerFeature(<span style=\"color: #006699; font-weight: bold\">const<\/span> <span style=\"color: #007788; font-weight: bold\">char<\/span><span style=\"color: #555555\">*<\/span> name <span style=\"color: #555555\">=<\/span> nullptr, <span style=\"color: #006699; font-weight: bold\">const<\/span> <span style=\"color: #007788; font-weight: bold\">char<\/span><span style=\"color: #555555\">*<\/span> value <span style=\"color: #555555\">=<\/span> nullptr)\n        <span style=\"color: #555555\">:<\/span> name(name), value(value) {}\n    <span style=\"color: #006699; font-weight: bold\">const<\/span> <span style=\"color: #007788; font-weight: bold\">char<\/span><span style=\"color: #555555\">*<\/span> name; <span style=\"color: #006699; font-weight: bold\">const<\/span> <span style=\"color: #007788; font-weight: bold\">char<\/span><span style=\"color: #555555\">*<\/span> value;\n};\n \n<span style=\"color: #006699; font-weight: bold\">static<\/span> CompilerFeature cxx20[] <span style=\"color: #555555\">=<\/span> {\nCOMPILER_FEATURE_ENTRY(__cpp_aggregate_paren_init)\nCOMPILER_FEATURE_ENTRY(<span style=\"color: #007788; font-weight: bold\">__cpp_char8_t<\/span>)\nCOMPILER_FEATURE_ENTRY(__cpp_concepts)\nCOMPILER_FEATURE_ENTRY(__cpp_conditional_explicit)\nCOMPILER_FEATURE_ENTRY(__cpp_consteval)\nCOMPILER_FEATURE_ENTRY(__cpp_constexpr)\nCOMPILER_FEATURE_ENTRY(__cpp_constexpr_dynamic_alloc)\nCOMPILER_FEATURE_ENTRY(__cpp_constexpr_in_decltype)\nCOMPILER_FEATURE_ENTRY(__cpp_constinit)\nCOMPILER_FEATURE_ENTRY(__cpp_deduction_guides)\nCOMPILER_FEATURE_ENTRY(__cpp_designated_initializers)\nCOMPILER_FEATURE_ENTRY(__cpp_generic_lambdas)\nCOMPILER_FEATURE_ENTRY(__cpp_impl_coroutine)\nCOMPILER_FEATURE_ENTRY(__cpp_impl_destroying_delete)\nCOMPILER_FEATURE_ENTRY(__cpp_impl_three_way_comparison)\nCOMPILER_FEATURE_ENTRY(__cpp_init_captures)\nCOMPILER_FEATURE_ENTRY(__cpp_modules)\nCOMPILER_FEATURE_ENTRY(__cpp_nontype_template_args)\nCOMPILER_FEATURE_ENTRY(__cpp_using_enum)\n};\n\n\nconstexpr <span style=\"color: #007788; font-weight: bold\">bool<\/span> <span style=\"color: #CC00FF\">is_feature_supported<\/span>(<span style=\"color: #006699; font-weight: bold\">const<\/span> CompilerFeature<span style=\"color: #555555\">&amp;<\/span> x) {\n    <span style=\"color: #006699; font-weight: bold\">return<\/span> x.value[<span style=\"color: #FF6600\">0<\/span>] <span style=\"color: #555555\">!=<\/span> <span style=\"color: #CC3300\">&#39;_&#39;<\/span> <span style=\"color: #555555\">&amp;&amp;<\/span> x.value[<span style=\"color: #FF6600\">0<\/span>] <span style=\"color: #555555\">!=<\/span> <span style=\"color: #CC3300\">&#39;0&#39;<\/span> ;\n}\n \n<span style=\"color: #006699; font-weight: bold\">inline<\/span> <span style=\"color: #007788; font-weight: bold\">void<\/span> <span style=\"color: #CC00FF\">print_compiler_feature<\/span>(<span style=\"color: #006699; font-weight: bold\">const<\/span> CompilerFeature<span style=\"color: #555555\">&amp;<\/span> x) {\n    constexpr <span style=\"color: #006699; font-weight: bold\">static<\/span> <span style=\"color: #007788; font-weight: bold\">int<\/span> max_name_length <span style=\"color: #555555\">=<\/span> <span style=\"color: #FF6600\">44<\/span>; <span style=\"color: #0099FF; font-style: italic\">\/\/&lt; Update if necessary<\/span>\n    std<span style=\"color: #555555\">::<\/span>string value{ is_feature_supported(x) <span style=\"color: #555555\">?<\/span> x.value <span style=\"color: #555555\">:<\/span> <span style=\"color: #CC3300\">&quot;------&quot;<\/span> };\n    <span style=\"color: #006699; font-weight: bold\">if<\/span> (value.back() <span style=\"color: #555555\">==<\/span> <span style=\"color: #CC3300\">&#39;L&#39;<\/span>) value.pop_back(); <span style=\"color: #0099FF; font-style: italic\">\/\/~ 201603L -&gt; 201603<\/span>\n    <span style=\"color: #0099FF; font-style: italic\">\/\/ value.insert(4, 1, &#39;-&#39;); \/\/~ 201603 -&gt; 2016-03<\/span>\n    <span style=\"color: #006699; font-weight: bold\">if<\/span> ( (print.supported_features <span style=\"color: #555555\">&amp;&amp;<\/span> is_feature_supported(x))\n        <span style=\"color: #555555\">||<\/span> (print.unsupported_features <span style=\"color: #555555\">&amp;&amp;<\/span> <span style=\"color: #555555\">!<\/span>is_feature_supported(x))) {\n            std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>left <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>setw(max_name_length)\n                      <span style=\"color: #555555\">&lt;&lt;<\/span> x.name <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot; &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> value <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    }\n}\n \n<span style=\"color: #006699; font-weight: bold\">template<\/span><span style=\"color: #555555\">&lt;<\/span><span style=\"color: #007788; font-weight: bold\">size_t<\/span> N<span style=\"color: #555555\">&gt;<\/span>\n<span style=\"color: #006699; font-weight: bold\">inline<\/span> <span style=\"color: #007788; font-weight: bold\">void<\/span> show(<span style=\"color: #007788; font-weight: bold\">char<\/span> <span style=\"color: #006699; font-weight: bold\">const<\/span><span style=\"color: #555555\">*<\/span> title, CompilerFeature (<span style=\"color: #555555\">&amp;<\/span>features)[N]) {\n    <span style=\"color: #006699; font-weight: bold\">if<\/span> (print.titles) {\n        std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>left <span style=\"color: #555555\">&lt;&lt;<\/span> title <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    }\n    <span style=\"color: #006699; font-weight: bold\">if<\/span> (print.sorted_by_value) {\n        std<span style=\"color: #555555\">::<\/span>sort(std<span style=\"color: #555555\">::<\/span>begin(features), std<span style=\"color: #555555\">::<\/span>end(features),\n            [](CompilerFeature <span style=\"color: #006699; font-weight: bold\">const<\/span><span style=\"color: #555555\">&amp;<\/span> lhs, CompilerFeature <span style=\"color: #006699; font-weight: bold\">const<\/span><span style=\"color: #555555\">&amp;<\/span> rhs) {\n                <span style=\"color: #006699; font-weight: bold\">return<\/span> std<span style=\"color: #555555\">::<\/span>strcmp(lhs.value, rhs.value) <span style=\"color: #555555\">&lt;<\/span> <span style=\"color: #FF6600\">0<\/span>;\n            });\n    }\n    <span style=\"color: #006699; font-weight: bold\">for<\/span> (<span style=\"color: #006699; font-weight: bold\">const<\/span> CompilerFeature<span style=\"color: #555555\">&amp;<\/span> x <span style=\"color: #555555\">:<\/span> features) {\n        print_compiler_feature(x);\n    }\n}\n \n<span style=\"color: #007788; font-weight: bold\">int<\/span> main() {\n    \n    <span style=\"color: #006699; font-weight: bold\">if<\/span> (print.cxx20 <span style=\"color: #555555\">&amp;&amp;<\/span> print.core_features) show(<span style=\"color: #CC3300\">&quot;C++20 CORE&quot;<\/span>, cxx20);\n   \n}\n<\/pre><\/div>\n\n\n\n<p>The following screenshots from the Compiler Explorer show the C++20 support of GCC 8.1, 10.1, and 14.1 compilers.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GCC 8.1<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"759\" height=\"617\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc8.png\" alt=\"\" class=\"wp-image-9817\" style=\"width:600px\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc8.png 759w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc8-300x244.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc8-705x573.png 705w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GCC 10.1<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"608\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc10.png\" alt=\"\" class=\"wp-image-9818\" style=\"width:600px\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc10.png 718w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc10-300x254.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc10-705x597.png 705w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GCC 14.1<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"711\" height=\"613\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc14.png\" alt=\"\" class=\"wp-image-9819\" style=\"width:600px\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc14.png 711w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc14-300x259.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/07\/gcc14-705x608.png 705w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"> What&#8217;s next?<\/h2>\n\n\n\n<p> With my next post, I continue my journey through C + + 23.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The feature testing macros is a relatively unknown feature in C + + 20. They give you the definitive answer to which C++ feature your compiler supports. When you try out the latest C++ features, you often get errors. Now the question is: who is to blame? Option 3 occurs rarely, so you have only [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":9800,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[375],"tags":[],"class_list":["post-9797","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-20"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/9797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/comments?post=9797"}],"version-history":[{"count":23,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/9797\/revisions"}],"predecessor-version":[{"id":9828,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/9797\/revisions\/9828"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/9800"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=9797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=9797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=9797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}