{"id":309635,"date":"2020-09-08T15:00:28","date_gmt":"2020-09-08T15:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=309635"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=309635","title":{"rendered":"\u041a\u043e\u043c\u0438\u0442\u0435\u0442 ISO \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u00abC++20\u00bb"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/selectel\/blog\/518270\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-i\/lj\/b-\/-iljb-624vq2qqds36grdii8g1m.png\"><\/p>\n<p>  \u041d\u0430 \u0434\u043d\u044f\u0445 \u043a\u043e\u043c\u0438\u0442\u0435\u0442 ISO \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0421++ (\u0434\u0430, \u0435\u0441\u0442\u044c \u0438 \u0442\u0430\u043a\u043e\u0439) <a href=\"https:\/\/herbsutter.com\/2020\/09\/06\/c20-approved-c23-meetings-and-schedule-update\/\">\u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b<\/a> \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u00ab\u0421++20\u00bb. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 GCC, Clang \u0438 Microsoft Visual C++. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u00ab\u0421++20\u00bb \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Boost.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u0430\u043f \u2014 <a href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=53670\">\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/a> \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0417\u0430\u0442\u0435\u043c, \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u043e\u044f\u0431\u0440\u044f, \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 ISO, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c ISO\/IEC 14882:2020. \u0421\u0435\u0439\u0447\u0430\u0441 \u043a\u043e\u043c\u0438\u0442\u0435\u0442 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u00abC++23\u00bb (C++2b). \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u00ab\u0421++20\u00bb \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u0434\u0430.<br \/>  <a name=\"habracut\"><\/a> <br \/>  <font color=\"#EB4247\"><\/p>\n<h3>\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?<\/h3>\n<p><\/font> <br \/>  <b>\u041a\u043e\u043c\u0438\u0442\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u00ab\u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438\u00bb<\/b>, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043e\u043d\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<pre><code class=\"cpp\"> template&lt;typename T&gt;    concept EqualityComparable = requires(T a, T b) {        { a == b } -&gt; std::boolean;        { a != b } -&gt; std::boolean;    };<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043d\u044f\u0442\u044b <a href=\"https:\/\/isocpp.org\/files\/papers\/n4720.pdf\">\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/a><\/b> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041c\u043e\u0434\u0443\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u043d\u0438\u0446 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0431\u0435\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 &quot;#include&quot; \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>  <b>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043c\u0430\u043a\u0440\u043e\u0441 <\/b>__VA_OPT__ \u0434\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0432 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p>  <b>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430<\/b> \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &lt;=&gt; \u0434\u043b\u044f \u0442\u0440\u0435\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <b>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b<\/b> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p>  <b>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/b> \u043b\u044f\u043c\u0431\u0434\u0430-\u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 *this.<\/p>\n<pre><code class=\"cpp\">   struct int_value {      int n = 0;      auto getter_fn() {        \/\/ BAD:        \/\/ return [=]() { return n; };          \/\/ GOOD:        return [=, *this]() { return n; };      }    };  <\/code><\/pre>\n<p>  <b>\u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0442\u0435\u043f\u0435\u0440\u044c<\/b> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0431\u0435\u0437 \u0442\u0438\u043f\u0430.<\/p>\n<pre><code class=\"cpp\">   struct foo {      foo() = default;      constexpr foo(int) {}    };      template &lt;foo f&gt;    auto get_foo() {      return f;     }      get_foo(); \/\/ uses implicit constructor    get_foo&lt;foo{123}&gt;();<\/code><\/pre>\n<p>  <b>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0441\u0442\u0438\u043b\u0435 \u0421\u0438. \u0422\u0435, \u0447\u0442\u043e \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044f, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"cpp\">struct A {      int x;      int y;      int z = 123;    };      A a {.x = 1, .z = 2}; \/\/ a.x == 1, a.y == 0, a.z == 2<\/code><\/pre>\n<p>  <b>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b<\/b> \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <b>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b likely \u0438 unlikely<\/b> \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (&quot;[[likely]] if (random &gt; 0) {&quot;).<\/p>\n<p>  <b>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <\/b>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0446\u0438\u043a\u043b\u0435 for<\/p>\n<pre><code class=\"cpp\">   for (auto v = std::vector{1, 2, 3}; auto&amp; e : v) {<\/code><\/pre>\n<p>  <b>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f immediate \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438.<\/p>\n<pre><code class=\"cpp\"> consteval int sqr(int n) {      return n * n;    }      constexpr int r = sqr(100); \/\/ OK    int x = 100;    int r2 = sqr(x); \/\/ ERROR:  'x' \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430<\/code><\/pre>\n<p>  \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b:  <\/p>\n<ul>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0438\u043f\u0430 char8_t \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a UTF-8.<\/li>\n<li>\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b bit (\u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438) \u0438 version.<\/li>\n<li>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 \u0438 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u0430 \u0441\u0442\u0440\u043e\u043a (starts_with, ends_with).<\/li>\n<li>\u0442\u0438\u043f\u0430\u0436\u0438 std::remove_cvref, std::unwrap_reference, std::unwrap_decay_ref, std::is_nothrow_convertible \u0438 std::type_identity.<\/li>\n<li>\u0444\u0443\u043d\u043a\u0446\u0438\u0438 std::midpoint, std::lerp, std::bind_front, std::source_location, std::visit, std::is_constant_evaluated \u0438 std::assume_aligned.<\/li>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0432 std::make_shared.<\/li>\n<li>\u0444\u0443\u043d\u043a\u0446\u0438\u044f std::to_array \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 std::array.<\/li>\n<\/ul>\n<p>  <b>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/b> \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u0435\u043d:  <\/p>\n<pre><code class=\"cpp\">   enum class rgba_color_channel { red, green, blue, alpha };      std::string_view to_string(rgba_color_channel my_channel) {      switch (my_channel) {        using enum rgba_color_channel;        case red:   return &quot;red&quot;;        case green: return &quot;green&quot;;        case blue:  return &quot;blue&quot;;        case alpha: return &quot;alpha&quot;;     }    }<\/code><\/pre>\n<p>  <b>\u0412 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0445 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &quot;,&quot; (\u00aba[b,c]\u00bb). \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c violate, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &quot;++&quot; \u0438 &quot;&#8212;&quot; \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  <a href=\"http:\/\/slc.tl\/vOasl\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1h\/dq\/mj\/1hdqmj1bvguax5hnugdz0ci_jbw.jpeg\"><\/div>\n<p><\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/selectel\/blog\/518270\/\"> https:\/\/habr.com\/ru\/company\/selectel\/blog\/518270\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/selectel\/blog\/518270\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-i\/lj\/b-\/-iljb-624vq2qqds36grdii8g1m.png\"><\/p>\n<p>  \u041d\u0430 \u0434\u043d\u044f\u0445 \u043a\u043e\u043c\u0438\u0442\u0435\u0442 ISO \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0421++ (\u0434\u0430, \u0435\u0441\u0442\u044c \u0438 \u0442\u0430\u043a\u043e\u0439) <a href=\"https:\/\/herbsutter.com\/2020\/09\/06\/c20-approved-c23-meetings-and-schedule-update\/\">\u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b<\/a> \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u00ab\u0421++20\u00bb. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 GCC, Clang \u0438 Microsoft Visual C++. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u00ab\u0421++20\u00bb \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Boost.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u0430\u043f \u2014 <a href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=53670\">\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/a> \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0417\u0430\u0442\u0435\u043c, \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u043e\u044f\u0431\u0440\u044f, \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 ISO, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c ISO\/IEC 14882:2020. \u0421\u0435\u0439\u0447\u0430\u0441 \u043a\u043e\u043c\u0438\u0442\u0435\u0442 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u00abC++23\u00bb (C++2b). \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u00ab\u0421++20\u00bb \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u0434\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-309635","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309635"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309635\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}