{"id":9159,"date":"2024-02-26T11:44:01","date_gmt":"2024-02-26T11:44:01","guid":{"rendered":"https:\/\/www.modernescpp.com\/?p=9159"},"modified":"2024-02-26T11:44:02","modified_gmt":"2024-02-26T11:44:02","slug":"more-details-to-formatting-user-defined-types-in-c20","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/more-details-to-formatting-user-defined-types-in-c20\/","title":{"rendered":"More Details to Formatting User-Defined Types in C++20"},"content":{"rendered":"\n<p>Implementing a formatter for a user-defined type having more than one value in C++20 is challenging. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"955\" height=\"392\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/01\/TimelineCpp20CoreLanguage.png\" alt=\"\" class=\"wp-image-8964\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/01\/TimelineCpp20CoreLanguage.png 955w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/01\/TimelineCpp20CoreLanguage-300x123.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/01\/TimelineCpp20CoreLanguage-768x315.png 768w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/01\/TimelineCpp20CoreLanguage-705x289.png 705w\" sizes=\"auto, (max-width: 955px) 100vw, 955px\" \/><\/figure>\n\n\n\n<p>This post is the 5th post in my miniseries about formatting in C++20. Read the previous ones here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.modernescpp.com\/index.php\/the-formatting-library-in-c20\/\">The Formatting Library in C++20<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.modernescpp.com\/index.php\/the-formatting-library-in-c20-the-format-string\/\">The Formatting Library in C++20: The Format String<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.modernescpp.com\/index.php\/the-formatting-library-in-c20-the-format-string-2\/\">The Formatting Library in C++20: The Format String (2)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.modernescpp.com\/index.php\/formatting-user-defined-types-in-c20\/\">Formatting User-Defined Types in C++20<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">A Formatter for More Values<\/h2>\n\n\n\n<p><code>Point <\/code>is a class with three members.<\/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\">\/\/ formatPoint.cpp<\/span>\n\n<span style=\"color: #009999\">#include &lt;format&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: #006699; font-weight: bold\">struct<\/span> Point {\n    <span style=\"color: #007788; font-weight: bold\">int<\/span> x{<span style=\"color: #FF6600\">2017<\/span>};\n    <span style=\"color: #007788; font-weight: bold\">int<\/span> y{<span style=\"color: #FF6600\">2020<\/span>};\n    <span style=\"color: #007788; font-weight: bold\">int<\/span> z{<span style=\"color: #FF6600\">2023<\/span>};\n};\n\n<span style=\"color: #006699; font-weight: bold\">template<\/span> <span style=\"color: #555555\">&lt;&gt;<\/span>\n<span style=\"color: #006699; font-weight: bold\">struct<\/span> std<span style=\"color: #555555\">::<\/span>formatter<span style=\"color: #555555\">&lt;<\/span>Point<span style=\"color: #555555\">&gt;<\/span> <span style=\"color: #555555\">:<\/span> std<span style=\"color: #555555\">::<\/span>formatter<span style=\"color: #555555\">&lt;<\/span>std<span style=\"color: #555555\">::<\/span>string<span style=\"color: #555555\">&gt;<\/span> {\n    <span style=\"color: #006699; font-weight: bold\">auto<\/span> format(Point point, format_context<span style=\"color: #555555\">&amp;<\/span> context) <span style=\"color: #006699; font-weight: bold\">const<\/span> {\n        <span style=\"color: #006699; font-weight: bold\">return<\/span> formatter<span style=\"color: #555555\">&lt;<\/span>string<span style=\"color: #555555\">&gt;::<\/span>format(\n               std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;({}, {}, {})&quot;<\/span>, point.x, point.y, point.y), context);\n  }\n};\n\n<span style=\"color: #007788; font-weight: bold\">int<\/span> <span style=\"color: #CC00FF\">main<\/span>() {\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n    Point point;\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{:*&lt;25}&quot;<\/span>, point) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;        <span style=\"color: #0099FF; font-style: italic\">\/\/ (1)<\/span>\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{:*^25}&quot;<\/span>, point) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;        <span style=\"color: #0099FF; font-style: italic\">\/\/ (2)<\/span>\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{:*&gt;25}&quot;<\/span>, point) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;        <span style=\"color: #0099FF; font-style: italic\">\/\/ (3)<\/span>\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{} {} {}&quot;<\/span>, point.x, point.y, point.z) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;  <span style=\"color: #0099FF; font-style: italic\">\/\/ (4)<\/span>\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{0:*&lt;10} {0:*^10} {0:*&gt;10}&quot;<\/span>, point.x) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;  <span style=\"color: #0099FF; font-style: italic\">\/\/ (5)<\/span>\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n}\n<\/pre><\/div>\n\n\n\n<p>In this case, I derive from the standard formatter<code> std::formatter&lt;std::string&gt;<\/code>. A <code>std::string_view<\/code> is also possible. <code>std::formatter&lt;Point&gt;<\/code> creates the formatted output by calling format on <code>std::formatter<\/code>. This function call already gets a formatted string as a value. Consequentially, all format specifiers of<code> std::string<\/code> are applicable (lines 1 &#8211; 3). On the contrary, you can also format each value of <code>Point<\/code>. This is precisely happening in lines (4) and (5).<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"466\" height=\"267\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/02\/formatPoint.png\" alt=\"\" class=\"wp-image-9166\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/02\/formatPoint.png 466w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/02\/formatPoint-300x172.png 300w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Internationalization<\/strong><\/h2>\n\n\n\n<p>The formatting functions <code>std::format*<\/code>, and <code>std::vformat*<\/code> have overloads accepting a locale. These overloads allow you to localize your format string.<\/p>\n\n\n\n<p>The following code snippet shows the corresponding overload of <code>std::format<\/code>:<\/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: #006699; font-weight: bold\">template<\/span><span style=\"color: #555555\">&lt;<\/span> class... Args <span style=\"color: #555555\">&gt;<\/span>\nstd<span style=\"color: #555555\">::<\/span>string format( <span style=\"color: #006699; font-weight: bold\">const<\/span> std<span style=\"color: #555555\">::<\/span>locale<span style=\"color: #555555\">&amp;<\/span> loc,\n                    std<span style=\"color: #555555\">::<\/span>format_string<span style=\"color: #555555\">&lt;<\/span>Args...<span style=\"color: #555555\">&gt;<\/span> fmt, Args<span style=\"color: #555555\">&amp;&amp;<\/span>... args );\n<\/pre><\/div>\n\n\n\n<p>To use a given locale, specify<code> L <\/code>before the type specifier in the format string. Now, you apply the locale in each call of <code>std::format<\/code> or set it globally with<code> <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/locale\/locale\/global\">std::locale::global<\/a>.<\/code><\/p>\n\n\n\n<p>In the following example, I explicitly apply the German locale to each<code> std::format<\/code> call.<\/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\">\/\/ internationalization.cpp<\/span>\n\n<span style=\"color: #009999\">#include &lt;chrono&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;exception&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;iostream&gt;<\/span>\n<span style=\"color: #009999\">#include &lt;thread&gt;<\/span>\n\nstd<span style=\"color: #555555\">::<\/span>locale createLocale(<span style=\"color: #006699; font-weight: bold\">const<\/span> std<span style=\"color: #555555\">::<\/span>string<span style=\"color: #555555\">&amp;<\/span> localString) {                         <span style=\"color: #0099FF; font-style: italic\">\/\/ (1)<\/span>\n  try {\n    <span style=\"color: #006699; font-weight: bold\">return<\/span> std<span style=\"color: #555555\">::<\/span>locale{localString};       \n  }\n  <span style=\"color: #006699; font-weight: bold\">catch<\/span> (<span style=\"color: #006699; font-weight: bold\">const<\/span> std<span style=\"color: #555555\">::<\/span>exception<span style=\"color: #555555\">&amp;<\/span> e) {\n    <span style=\"color: #006699; font-weight: bold\">return<\/span> std<span style=\"color: #555555\">::<\/span>locale{<span style=\"color: #CC3300\">&quot;&quot;<\/span>};\n  }\n}\n\n<span style=\"color: #007788; font-weight: bold\">int<\/span> main() {\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n    <span style=\"color: #006699; font-weight: bold\">using<\/span> <span style=\"color: #006699; font-weight: bold\">namespace<\/span> std<span style=\"color: #555555\">::<\/span>literals;\n\n    std<span style=\"color: #555555\">::<\/span>locale loc <span style=\"color: #555555\">=<\/span> createLocale(<span style=\"color: #CC3300\">&quot;de_DE&quot;<\/span>);\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;Default locale: &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{:}&quot;<\/span>, <span style=\"color: #FF6600\">2023<\/span>) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;German locale:  &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(loc, <span style=\"color: #CC3300\">&quot;{:L}&quot;<\/span>, <span style=\"color: #FF6600\">2023<\/span>) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;    <span style=\"color: #0099FF; font-style: italic\">\/\/ (2)<\/span>\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;Default locale: &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{:}&quot;<\/span>, <span style=\"color: #FF6600\">2023.05<\/span>) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;German locale:  &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(loc, <span style=\"color: #CC3300\">&quot;{:L}&quot;<\/span>, <span style=\"color: #FF6600\">2023.05<\/span>) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>; <span style=\"color: #0099FF; font-style: italic\">\/\/ (3)<\/span>\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n    <span style=\"color: #006699; font-weight: bold\">auto<\/span> start <span style=\"color: #555555\">=<\/span> std<span style=\"color: #555555\">::<\/span>chrono<span style=\"color: #555555\">::<\/span>steady_clock<span style=\"color: #555555\">::<\/span>now();\n    std<span style=\"color: #555555\">::<\/span>this_thread<span style=\"color: #555555\">::<\/span>sleep_for(<span style=\"color: #FF6600\">33<\/span>ms);\n    <span style=\"color: #006699; font-weight: bold\">auto<\/span> end <span style=\"color: #555555\">=<\/span> std<span style=\"color: #555555\">::<\/span>chrono<span style=\"color: #555555\">::<\/span>steady_clock<span style=\"color: #555555\">::<\/span>now();\n\n    <span style=\"color: #006699; font-weight: bold\">const<\/span> <span style=\"color: #006699; font-weight: bold\">auto<\/span> duration <span style=\"color: #555555\">=<\/span> end <span style=\"color: #555555\">-<\/span> start;\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;Default locale: &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{:}&quot;<\/span>, duration) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;German locale:  &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(loc, <span style=\"color: #CC3300\">&quot;{:L}&quot;<\/span>, duration) <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>; <span style=\"color: #0099FF; font-style: italic\">\/\/ (4)<\/span>\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n    <span style=\"color: #006699; font-weight: bold\">const<\/span> <span style=\"color: #006699; font-weight: bold\">auto<\/span> now <span style=\"color: #555555\">=<\/span> std<span style=\"color: #555555\">::<\/span>chrono<span style=\"color: #555555\">::<\/span>system_clock<span style=\"color: #555555\">::<\/span>now();\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;Default locale: &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(<span style=\"color: #CC3300\">&quot;{}<\/span><span style=\"color: #CC3300; font-weight: bold\">\\n<\/span><span style=\"color: #CC3300\">&quot;<\/span>, now);\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&quot;German locale:  &quot;<\/span> <span style=\"color: #555555\">&lt;&lt;<\/span> std<span style=\"color: #555555\">::<\/span>format(loc, <span style=\"color: #CC3300\">&quot;{:L}<\/span><span style=\"color: #CC3300; font-weight: bold\">\\n<\/span><span style=\"color: #CC3300\">&quot;<\/span>, now);            <span style=\"color: #0099FF; font-style: italic\">\/\/ (5)<\/span>\n\n    std<span style=\"color: #555555\">::<\/span>cout <span style=\"color: #555555\">&lt;&lt;<\/span> <span style=\"color: #CC3300\">&#39;\\n&#39;<\/span>;\n\n}\n<\/pre><\/div>\n\n\n\n<p>The function <code>createLocale<\/code> (line 1) creates the German locale. If this fails, it returns the default locale that uses American formatting. I use the German locale in lines (2), (3), (4), and (5). To see the difference, I also applied the <code>std::format<\/code> calls immediately afterward. Consequentially, the local-dependent thousand separator is used for the integral value (line 2), and the locale-dependent decimal point and thousand separator for the floating-point value (line 3). Accordingly, the time duration (line 4) and the time point (line 5) use the given German locale.<\/p>\n\n\n\n<p>The following screenshot shows the program&#8217;s output.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"475\" height=\"362\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/02\/internationalization.png\" alt=\"\" class=\"wp-image-9176\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/02\/internationalization.png 475w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2024\/02\/internationalization-300x229.png 300w\" sizes=\"auto, (max-width: 475px) 100vw, 475px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p><code>std::formatter<\/code> and its specializations also define the format specification for the chrono types. Before I  write about them, I will dive deeper into the chrono extension of C++20.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Implementing a formatter for a user-defined type having more than one value in C++20 is challenging. This post is the 5th post in my miniseries about formatting in C++20. Read the previous ones here: A Formatter for More Values Point is a class with three members. \/\/ formatPoint.cpp #include &lt;format&gt; #include &lt;iostream&gt; #include &lt;string&gt; struct [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":8964,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[375],"tags":[454],"class_list":["post-9159","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-20","tag-format"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/9159","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=9159"}],"version-history":[{"count":21,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/9159\/revisions"}],"predecessor-version":[{"id":9185,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/9159\/revisions\/9185"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/8964"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=9159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=9159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=9159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}