{"id":5365,"date":"2017-12-29T20:47:42","date_gmt":"2017-12-29T20:47:42","guid":{"rendered":"https:\/\/www.modernescpp.com\/index.php\/c-core-guidelines-rules-for-expressions-and-statements\/"},"modified":"2023-06-26T11:59:36","modified_gmt":"2023-06-26T11:59:36","slug":"c-core-guidelines-rules-for-expressions-and-statements","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/c-core-guidelines-rules-for-expressions-and-statements\/","title":{"rendered":"C++ Core Guidelines: Rules for Expressions and Statements"},"content":{"rendered":"<p>There are many rules in the C++ Core Guidelines dealing with expressions and statements. To be precise, there are more than 50 rules about declarations, expressions, statements, and arithmetic expressions.<\/p>\n<p><!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-5364\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/12\/naming-standards-clean-code-24-728.png\" alt=\"naming standards clean code 24 728\" width=\"600\" height=\"450\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/12\/naming-standards-clean-code-24-728.png 728w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/12\/naming-standards-clean-code-24-728-300x225.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>I forget to mention two rules that are just called general. Here we are.<\/p>\n<h3><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-lib\">ES.1: Prefer the standard library to other libraries and to \u201chandcrafted code\u201d<\/a><\/h3>\n<p>There is no reason to write a raw loop to sum up a vector of doubles:<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007788; font-weight: bold;\">int<\/span> max <span style=\"color: #555555;\">=<\/span> v.size();             <span style=\"color: #0099ff; font-style: italic;\">\/\/ bad: verbose, purpose unstated<\/span>\r\n<span style=\"color: #007788; font-weight: bold;\">double<\/span> sum <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">0.0<\/span>;\r\n<span style=\"color: #006699; font-weight: bold;\">for<\/span> (<span style=\"color: #007788; font-weight: bold;\">int<\/span> i <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">0<\/span>; i <span style=\"color: #555555;\">&lt;<\/span> max; <span style=\"color: #555555;\">++<\/span>i)\r\n    sum <span style=\"color: #555555;\">=<\/span> sum <span style=\"color: #555555;\">+<\/span> v[i];\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>You should just use the<span style=\"font-family: courier new,courier;\"> std::accumulate<\/span> algorithm from the STL.<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">auto<\/span> sum <span style=\"color: #555555;\">=<\/span> std<span style=\"color: #555555;\">::<\/span>accumulate(begin(a), end(a), <span style=\"color: #ff6600;\">0.0<\/span>);   <span style=\"color: #0099ff; font-style: italic;\">\/\/ good<\/span>\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>This rule reminds me to a sentence from Sean Parent at CppCon 2013: &#8220;If you want to improve the code quality in your organization, replace all your coding guidelines with one goal: No raw loops!&#8221;<\/p>\n<p>Or to say it more directly: If you write a raw loop, you probably don&#8217;t know the algorithms of the STL.<\/p>\n<\/p>\n<h3><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-abstr\">ES.2: Prefer suitable abstractions to direct use of language features<\/a><\/h3>\n<p>The next d\u00e9j\u00e0 vu. In one of my last C++ seminars, I had a long discussion followed by an even longer analysis of a few quite sophisticated and handmade functions for reading and writing <a href=\"http:\/\/en.cppreference.com\/w\/cpp\/io\/strstream\">strstream<\/a>s. The participants had to maintain these functions and had, after one week, no idea what was going on.<\/p>\n<p>The main obstacle to don&#8217;t understanding the functionality was that the functionality was not based on the right abstraction.<\/p>\n<p>For example, compare the handmade function for reading a <span style=\"font-family: courier new,courier;\">std::istream. <\/span> <!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007788; font-weight: bold;\">char<\/span><span style=\"color: #555555;\">**<\/span> <span style=\"color: #cc00ff;\">read1<\/span>(istream<span style=\"color: #555555;\">&amp;<\/span> is, <span style=\"color: #007788; font-weight: bold;\">int<\/span> maxelem, <span style=\"color: #007788; font-weight: bold;\">int<\/span> maxstring, <span style=\"color: #007788; font-weight: bold;\">int<\/span><span style=\"color: #555555;\">*<\/span> nread)   <span style=\"color: #0099ff; font-style: italic;\">\/\/ bad: verbose and incomplete<\/span>\r\n{\r\n    <span style=\"color: #006699; font-weight: bold;\">auto<\/span> res <span style=\"color: #555555;\">=<\/span> <span style=\"color: #006699; font-weight: bold;\">new<\/span> <span style=\"color: #007788; font-weight: bold;\">char<\/span><span style=\"color: #555555;\">*<\/span>[maxelem];\r\n    <span style=\"color: #007788; font-weight: bold;\">int<\/span> elemcount <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">0<\/span>;\r\n    <span style=\"color: #006699; font-weight: bold;\">while<\/span> (is <span style=\"color: #555555;\">&amp;&amp;<\/span> elemcount <span style=\"color: #555555;\">&lt;<\/span> maxelem) {\r\n        <span style=\"color: #006699; font-weight: bold;\">auto<\/span> s <span style=\"color: #555555;\">=<\/span> <span style=\"color: #006699; font-weight: bold;\">new<\/span> <span style=\"color: #007788; font-weight: bold;\">char<\/span>[maxstring];\r\n        is.read(s, maxstring);\r\n        res[elemcount<span style=\"color: #555555;\">++<\/span>] <span style=\"color: #555555;\">=<\/span> s;\r\n    }\r\n    nread <span style=\"color: #555555;\">=<\/span> <span style=\"color: #555555;\">&amp;<\/span>elemcount;\r\n    <span style=\"color: #006699; font-weight: bold;\">return<\/span> res;\r\n}\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>In contrast, how easy is the following function to consume?<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\">vector<span style=\"color: #555555;\">&lt;<\/span>string<span style=\"color: #555555;\">&gt;<\/span> read2(istream<span style=\"color: #555555;\">&amp;<\/span> is)   <span style=\"color: #0099ff; font-style: italic;\">\/\/ good<\/span>\r\n{\r\n    vector<span style=\"color: #555555;\">&lt;<\/span>string<span style=\"color: #555555;\">&gt;<\/span> res;\r\n    <span style=\"color: #006699; font-weight: bold;\">for<\/span> (string s; is <span style=\"color: #555555;\">&gt;&gt;<\/span> s;)\r\n        res.push_back(s);\r\n    <span style=\"color: #006699; font-weight: bold;\">return<\/span> res;\r\n}\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The right abstraction often means you do have not to think about ownership, such as in the function <span style=\"font-family: courier new,courier;\">read1<\/span>. This will not hold for the function read2. The caller of read<span style=\"font-family: courier new,courier;\">1<\/span> is the owner of <span style=\"font-family: courier new,courier;\">result<\/span> and has to delete it.<\/p>\n<p>A declaration introduces a name into a scope. To be honest, I&#8217;m biased. On the one hand, the following rules are a little bit borrowing for you because they are pretty obvious. On the other hand, I know a lot of codebases that permanently break these rules. For example, I had a discussion with a former Fortran programmer, who stated: Each variable should have exactly three characters.<\/p>\n<p>Anyway, I will continue presenting the rules because good names a probably the key to making code readable, understandable, maintainable, and extensible, &#8230;<\/p>\n<p>Here are the first six rules.<\/p>\n<h3><span style=\"font-family: courier new,courier;\"><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-scope\">ES.5: Keep scopes small<\/a><\/span><\/h3>\n<p>If a scope is small, you can put it on a screen and get an idea of what is happening. If a scope becomes too big, you should structure your code into functions or objects with methods. Identify logical entities and use self-explanatory names in your refactoring process. Afterward, it is a lot easier to think about your code.<\/p>\n<h3><span style=\"font-family: courier new,courier;\"><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-cond\">ES.6: Declare names in for-statement initializers and conditions to limit scope<\/a><\/span><\/h3>\n<p>Since the first C++ standard, we can declare a variable in a <span style=\"font-family: courier new,courier;\">for<\/span> statement. Since C++17, we can declare variables in an <span style=\"font-family: courier new,courier;\">if<\/span> or a <span style=\"font-family: courier new,courier;\">switch<\/span> statement.<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\">std<span style=\"color: #555555;\">::<\/span>map<span style=\"color: #555555;\">&lt;<\/span><span style=\"color: #007788; font-weight: bold;\">int<\/span>,std<span style=\"color: #555555;\">::<\/span>string<span style=\"color: #555555;\">&gt;<\/span> myMap;\r\n\r\n<span style=\"color: #006699; font-weight: bold;\">if<\/span> (<span style=\"color: #006699; font-weight: bold;\">auto<\/span> result <span style=\"color: #555555;\">=<\/span> myMap.insert(value); result.second){  <span style=\"color: #0099ff; font-style: italic;\">\/\/ (1)<\/span>\r\n    useResult(result.first);  \r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n} \r\n<span style=\"color: #006699; font-weight: bold;\">else<\/span>{\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n} <span style=\"color: #0099ff; font-style: italic;\">\/\/ result is automatically destroyed                 \/\/ (2)<\/span>\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The variable <span style=\"font-family: courier new,courier;\">result<\/span> (1) is only valid inside the<span style=\"font-family: courier new,courier;\"> if<\/span> and <span style=\"font-family: courier new,courier;\">else<\/span> branches of the <span style=\"font-family: courier new,courier;\">if<\/span> statement. <span style=\"font-family: courier new,courier;\">result<\/span> will not pollute the outer scope and will be automatically destroyed (2). This can not be done before C++17. You have to declare the result in the outer scope (3).<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\">std<span style=\"color: #555555;\">::<\/span>map<span style=\"color: #555555;\">&lt;<\/span><span style=\"color: #007788; font-weight: bold;\">int<\/span>,std<span style=\"color: #555555;\">::<\/span>string<span style=\"color: #555555;\">&gt;<\/span> myMap;\r\n<span style=\"color: #006699; font-weight: bold;\">auto<\/span> result <span style=\"color: #555555;\">=<\/span> myMap.insert(value)   <span style=\"color: #0099ff; font-style: italic;\">\/\/ (3)<\/span>\r\n<span style=\"color: #006699; font-weight: bold;\">if<\/span> (result.second){  <span style=\"color: #0099ff; font-style: italic;\"><\/span>\r\n    useResult(result.first);  \r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n} \r\n<span style=\"color: #006699; font-weight: bold;\">else<\/span>{\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n} \r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: courier new,courier;\"><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-name-length\">ES.7: Keep common and local names short, and keep uncommon and nonlocal names longer<\/a><\/span><\/h3>\n<p>This rule sounds strange, but we are already used to it. Giving a variable the name <span style=\"font-family: courier new,courier;\">i or j <\/span>or giving a variable the name<span style=\"font-family: courier new,courier;\"> T<\/span> will make the code&#8217;s intention immediately clear: <span style=\"font-family: courier new,courier;\">i<\/span> and <span style=\"font-family: courier new,courier;\">j<\/span> are indices, and <span style=\"font-family: courier new,courier;\">T<\/span> is a type parameter of a template.<span style=\"font-family: courier new,courier;\"><br \/><\/span><\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">template<\/span><span style=\"color: #555555;\">&lt;<\/span><span style=\"color: #006699; font-weight: bold;\">typename<\/span> T<span style=\"color: #555555;\">&gt;<\/span>    <span style=\"color: #0099ff; font-style: italic;\">\/\/ good<\/span>\r\n<span style=\"color: #007788; font-weight: bold;\">void<\/span> print(ostream<span style=\"color: #555555;\">&amp;<\/span> os, <span style=\"color: #006699; font-weight: bold;\">const<\/span> vector<span style=\"color: #555555;\">&lt;<\/span>T<span style=\"color: #555555;\">&gt;&amp;<\/span> v)\r\n{\r\n    <span style=\"color: #006699; font-weight: bold;\">for<\/span> (<span style=\"color: #007788; font-weight: bold;\">int<\/span> i <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">0<\/span>; i <span style=\"color: #555555;\">&lt;<\/span> v.size(); <span style=\"color: #555555;\">++<\/span>i)\r\n        os <span style=\"color: #555555;\">&lt;&lt;<\/span> v[i] <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">'\\n'<\/span>;\r\n}\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>There is a meta-rule behind this rule. A name should be self-explanatory. In a short context, you get what the variable means with a glance. This will not automatically hold for more extended contexts; therefore, you should use longer names.&nbsp;<\/p>\n<h3><span style=\"font-family: courier new,courier;\"><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-name-similar\">ES.8: Avoid similar-looking names<\/a><\/span><\/h3>\n<p>Can you read this example without any hesitation?<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">if<\/span> (readable(i1 <span style=\"color: #555555;\">+<\/span> l1 <span style=\"color: #555555;\">+<\/span> ol <span style=\"color: #555555;\">+<\/span> o1 <span style=\"color: #555555;\">+<\/span> o0 <span style=\"color: #555555;\">+<\/span> ol <span style=\"color: #555555;\">+<\/span> o1 <span style=\"color: #555555;\">+<\/span> I0 <span style=\"color: #555555;\">+<\/span> l0)) surprise();\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Honestly, I often have problems with the number <span style=\"font-family: courier new,courier;\">0<\/span> and the significant capital <span style=\"font-family: courier new,courier;\">O<\/span>. Depending on the font used; it looks similar. Two years ago, logging into a server took me quite a while. My automatically generated password had a character <span style=\"font-family: courier new,courier;\"><\/span> <span style=\"font-family: courier new,courier;\">O.<\/span><\/p>\n<h3><span style=\"font-family: courier new,courier;\"><a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-not-CAPS\">ES.9: Avoid <code class=\"highlighter-rouge no-highlight\">ALL_CAPS<\/code> names<\/a><\/span><\/h3>\n<p>If you use, ALL_CAPS macro substitution may kick in because ALL_CAPS is commonly used for macros. The following program snippet may have a little surprise involved.<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0099ff; font-style: italic;\">\/\/ somewhere in some header:<\/span>\r\n<span style=\"color: #009999;\">#define NE !=<\/span>\r\n\r\n<span style=\"color: #0099ff; font-style: italic;\">\/\/ somewhere else in some other header:<\/span>\r\n<span style=\"color: #006699; font-weight: bold;\">enum<\/span> Coord { N, NE, NW, S, SE, SW, E, W };\r\n\r\n<span style=\"color: #0099ff; font-style: italic;\">\/\/ somewhere third in some poor programmer's .cpp:<\/span>\r\n<span style=\"color: #006699; font-weight: bold;\">switch<\/span> (direction) {\r\n<span style=\"color: #006699; font-weight: bold;\">case<\/span> N:\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n<span style=\"color: #006699; font-weight: bold;\">case<\/span> NE:\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n<span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n}\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Res-name-one\">ES.10: Declare one name (only) per declaration<\/a><\/h3>\n<p>Let me give you two examples. Did you spot the two issues?<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007788; font-weight: bold;\">char<\/span><span style=\"color: #555555;\">*<\/span> p, p2;\r\n<span style=\"color: #007788; font-weight: bold;\">char<\/span> a <span style=\"color: #555555;\">=<\/span> <span style=\"color: #cc3300;\">'a'<\/span>;\r\np <span style=\"color: #555555;\">=<\/span> <span style=\"color: #555555;\">&amp;<\/span>a;\r\np2 <span style=\"color: #555555;\">=<\/span> a;                              <span style=\"color: #0099ff; font-style: italic;\">\/\/ (1)<\/span>\r\n\r\n<span style=\"color: #007788; font-weight: bold;\">int<\/span> a <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">7<\/span>, b <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">9<\/span>, c, d <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">10<\/span>, e <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">3<\/span>;  <span style=\"color: #0099ff; font-style: italic;\">\/\/ (2)<\/span>\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new,courier;\">p2<\/span> is just a<span style=\"font-family: courier new,courier;\"> char&nbsp;<\/span> (1), and <span style=\"font-family: courier new,courier;\">c<\/span> is not initialized (2).<\/p>\n<p>With C++17, we got one exception to this rule: structured binding.<\/p>\n<p>Now, I can write the if statement with an initializer in rule ES.6 even cleaner and more readable.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\">std<span style=\"color: #555555;\">::<\/span>map<span style=\"color: #555555;\">&lt;<\/span><span style=\"color: #007788; font-weight: bold;\">int<\/span>,std<span style=\"color: #555555;\">::<\/span>string<span style=\"color: #555555;\">&gt;<\/span> myMap;\r\n\r\n<span style=\"color: #006699; font-weight: bold;\">if<\/span> (<span style=\"color: #006699; font-weight: bold;\">auto<\/span> [iter, succeeded] <span style=\"color: #555555;\">=<\/span> myMap.insert(value); succedded){  <span style=\"color: #0099ff; font-style: italic;\">\/\/ (1)<\/span>\r\n    useResult(iter);  \r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n} \r\n<span style=\"color: #006699; font-weight: bold;\">else<\/span>{\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n} <span style=\"color: #0099ff; font-style: italic;\">\/\/ iter and succeeded are automatically destroyed            \/\/ (2)<\/span>\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>What&#8217;s next?<\/h2>\n<p>Of course, I will continue with the rules regarding declarations in my next post.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are many rules in the C++ Core Guidelines dealing with expressions and statements. To be precise, there are more than 50 rules about declarations, expressions, statements, and arithmetic expressions.<\/p>\n","protected":false},"author":21,"featured_media":5364,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[372],"tags":[497],"class_list":["post-5365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-modern-c","tag-declarations"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5365","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=5365"}],"version-history":[{"count":1,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5365\/revisions"}],"predecessor-version":[{"id":6845,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5365\/revisions\/6845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/5364"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=5365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=5365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=5365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}