{"id":330346,"date":"2022-03-05T15:00:13","date_gmt":"2022-03-05T15:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330346"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330346","title":{"rendered":"<span>\u0421\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0421++<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e89\/008\/341\/e8900834168a2d7ef2a99dfdf5958cb4.png\" width=\"800\" height=\"256\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e89\/008\/341\/e8900834168a2d7ef2a99dfdf5958cb4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0447\u0438\u0442\u0430\u044e\u0442 \u043a\u043e\u0434 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0430\u0449\u0435, \u0447\u0435\u043c \u043f\u0438\u0448\u0443\u0442 \u0435\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u043a\u043e\u0434. \u0410\u0432\u0442\u043e\u0440 \u043a\u043d\u0438\u0433\u0438 \u0421++17 in detail \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b. \u0414\u0435\u043b\u0438\u043c\u0441\u044f \u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043a\u0443\u0440\u0441\u0430 \u043f\u043e <a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_050322&amp;utm_term=lead\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 \u0421++<\/a>.<\/p>\n<hr\/>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043c\u043e\u0433\u0443\u0442 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">DoImportantStuff(true, false, true, false);<\/code><\/pre>\n<p>\u041d\u0435\u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 true \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 false? \u041c\u043e\u0436\u043d\u043e \u043b\u0438  \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433.<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u0431\u043b\u043e\u0433\u0435 \u0410\u043d\u0434\u0436\u0435\u044f \u041a\u0440\u0436\u0435\u043c\u0435\u043d\u0441\u043a\u0438: <a href=\"https:\/\/akrzemi1.wordpress.com\/2017\/02\/16\/toggles-in-functions\/\">Toggles in functions<\/a>. \u041a\u0430\u043a \u043f\u0438\u0448\u0435\u0442 <a href=\"https:\/\/akrzemi1.wordpress.com\/about\/\">\u0410\u043d\u0434\u0436\u0435\u0439<\/a>, \u0432\u0435\u0441\u044c \u0441\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">RenderGlyphs(glyphs, true, false, true, false);<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432? \u0422\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442. \u041f\u043e\u0434\u0443\u043c\u0430\u0435\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435: \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">RenderGlyphs(glyphs,              \/*useChache*\/true,               \/*deferred*\/false,               \/*optimize*\/true,               \/*finalRender*\/false);<\/code><\/pre>\n<p>\u0418 \u0445\u043e\u0442\u044f \u043a\u043e\u0434 \u0432\u044b\u0448\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e?<\/p>\n<h3>\u0418\u0434\u0435\u0438<\/h3>\n<p>\u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0434\u0435\u0439:<\/p>\n<h4>\u041a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/h4>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">enum class UseCacheFlag    { False, True }; enum class DeferredFlag    { False, True }; enum class OptimizeFlag    { False, True }; enum class FinalRenderFlag { False, True };  \/\/ \u0438 \u0432\u044b\u0437\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: RenderGlyphs(glyphs,              UseCacheFlag::True,               DeferredFlag::False,               OptimizeFlag::True,               FinalRenderFlag::False);<\/code><\/pre>\n<p>\u0418 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">if (useCache) { } else { } if (deferred) { } else {}<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">if (useCache == UseCacheFlag::True) { } else { } if (deferred == DeferredFlag::True) { } else {}<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f bool. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u043e \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043c\u0451\u043d.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0438\u043f\u044b. \u041d\u0443\u0436\u043d\u043e \u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043e\u0431\u0449\u0438\u0435 \u0444\u043b\u0430\u0433\u0438?<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c Flag::True \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e, \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u044f\u0432\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u2014 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/akrzemi1\/explicit\/blob\/master\/include\/ak_toolkit\/tagged_bool.hpp\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a> \u0410\u043d\u0434\u0436\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0432 bool \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438. \u042f \u0431\u044b\u043b \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0432 \u044f\u0437\u044b\u043a\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041d\u043e \u043f\u043e\u0437\u0436\u0435 \u0441\u0442\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435. <\/p>\n<p>\u042f\u0432\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0442\u0430\u043a \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u044f\u0437\u044b\u043a \u2014 \u043f\u0435\u0440\u0435\u0433\u0438\u0431? \u042f\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439\u2026<\/p>\n<h4>\u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043b\u0430\u0433\u0438<\/h4>\n<p>\u041a\u0430\u043a \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043b\u0430\u0433\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0438\u0445 \u0434\u0440\u0443\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438 \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430.<\/p>\n<p>\u0412\u043e\u0442 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  struct Glyphs { };  enum class RenderGlyphsFlags {     useCache = 1,     deferred = 2,      optimize = 4,     finalRender = 8, };  \/\/ \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435... RenderGlyphsFlags operator | (RenderGlyphsFlags a, RenderGlyphsFlags b) {     using T = std::underlying_type_t &lt;RenderGlyphsFlags>;     return static_cast&lt;RenderGlyphsFlags>(static_cast&lt;T>(a) | static_cast&lt;T>(b));     \/\/ todo: \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435... }  constexpr bool IsSet(RenderGlyphsFlags val, RenderGlyphsFlags check) {     using T = std::underlying_type_t &lt;RenderGlyphsFlags>;     return static_cast&lt;T>(val) &amp; static_cast&lt;T>(check);     \/\/ todo: \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438... }  void RenderGlyphs(Glyphs &amp;glyphs, RenderGlyphsFlags flags) {     if (IsSet(flags, RenderGlyphsFlags::useCache)) { }     else { }      if (IsSet(flags, RenderGlyphsFlags::deferred)) { }     else { }      \/\/ ... }  int main() {     Glyphs glyphs;     RenderGlyphs(glyphs, RenderGlyphsFlags::useCache | RenderGlyphsFlags::optimize);                                       }<\/code><\/pre>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/godbolt.org\/z\/T6zaa9csP\">@Compiler Explorer<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435? \u0421 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e, \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043c\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0432\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0443\u0436\u043d\u044b\u0439 \u0431\u0438\u0442.<\/p>\n<p>\u0421 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421++23 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f std::to_underlying() \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 &lt;utility>. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 GCC, Clang \u0438 MSVC: \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <a href=\"https:\/\/godbolt.org\/z\/KeoGq5EjK\">@Compiler Explorer<\/a>.<\/p>\n<h4>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 4 \u0438\u043b\u0438 5, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b?<\/p>\n<pre><code class=\"cpp\">struct RenderGlyphsParam {     bool useCache;     bool deferred;     bool optimize;     bool finalRender; }; void RenderGlyphs(Glyphs &amp;glyphs, const RenderGlyphsParam &amp;renderParam);  \/\/ \u0432\u044b\u0437\u043e\u0432: RenderGlyphs(glyphs,              {\/*useCache*\/true,               \/*deferred*\/false,               \/*optimize*\/true,               \/*finalRender*\/false});<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u043b\u043e. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0414\u0430, \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p>\u041e\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0447\u043b\u0435\u043d\u0430\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e glyphs \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 RenderGlyphsParam, \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h4>\u0410 \u0447\u0442\u043e \u0432 \u0421++20?<\/h4>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u043c\u044b\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u043c \u0432 \u0421++20, \u043f\u0440\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c, \u043a\u0430\u043a \u0432 \u0438\u043c\u0435\u043d\u0430\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u042199:<\/p>\n<pre><code class=\"cpp\">struct RenderGlyphsParam {     bool useCache;     bool deferred;     bool optimize;     bool finalRender; }; void RenderGlyphs(Glyphs &amp;glyphs, const RenderGlyphsParam &amp;renderParam);  \/\/ \u0432\u044b\u0437\u043e\u0432: RenderGlyphs(glyphs,              {.useCache = true,                .deferred = false,                .optimize = true,                .finalRender = false}); <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0432 <a href=\"https:\/\/godbolt.org\/z\/Yjcbocaza\">@Compiler Explorer<\/a>. <\/p>\n<p>\u041e\u0431 \u044d\u0442\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043c\u043e\u0451\u043c \u043f\u043e\u0441\u0442\u0435 <a href=\"https:\/\/www.cppstories.com\/2021\/designated-init-cpp20\/\">Designated Initializers in C++20<\/a>.<\/p>\n<h4>\u0423\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/h4>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0435\u0449\u0451 \u043f\u0440\u043e\u0449\u0435? \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440?<\/p>\n<p>\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">RenderGlyphsDeferred(glyphs,              \/*useCache*\/true,               \/*optimize*\/true); RenderGlyphsForFinalRender(glyphs,              \/*useCache*\/true,               \/*optimize*\/true;<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445: deferred \u0438 final \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e RenderGlyphsInternal. <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u0431\u044b \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438. \u041d\u043e, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0442\u0430\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0440\u044b\u0442 \u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0437\u0436\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0435\u0451 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041c\u043e\u0436\u0435\u0442, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0440\u0430\u0437\u0431\u0435\u0439\u0442\u0435 \u0435\u0451 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b, \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0432\u0435\u0442 \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u0432 <a href=\"https:\/\/martinfowler.com\/bliki\/FlagArgument.html\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u0433\u0434\u0435 \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u0443\u0435\u0442 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435\u0439. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"http:\/\/www.informit.com\/articles\/article.aspx?p=1392524\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432 <a href=\"http:\/\/amzn.to\/2m3g2LS\">\u043a\u043d\u0438\u0433\u0435<\/a> Clean Code: A Handbook of Agile Software Craftsmanship<strong>.<\/strong><\/p>\n<h4>\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b<\/h4>\n<p>\u041a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0439 \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0443\u0441\u0438\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.cppstories.com\/2021\/strong-types-pesel\/\">Strong Types in C++: A Concrete Example<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/arne-mertz.de\/2016\/11\/stronger-types\/\">Simplify C++: Use Stronger Types!<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.ilikebigbits.com\/blog\/2014\/5\/6\/type-safe-identifiers-in-c\">Type safe handles in C++<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.fluentcpp.com\/2016\/12\/08\/strong-types-for-strong-interfaces\/\">Strong types for strong interfaces<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/foonathan.net\/blog\/2016\/10\/11\/type-safe.html\">Type safe &#8212; Zero overhead utilities for more type safety<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.boost.org\/doc\/libs\/1_61_0\/libs\/serialization\/doc\/strong_typedef.html\">Serialization &#8212; BOOST_STATIC_WARNING<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0421++<\/h3>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0421++, \u043a\u0443\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e. \u0412\u043e\u0442 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445: <a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#i4-make-interfaces-precisely-and-strongly-typed\">I.4: Make interfaces precisely and strongly typed<\/a>, \u0432 \u043d\u0451\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, \u043d\u043e \u0438 \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">draw_rect(100, 200, 100, 500); \/\/ what do the numbers specify?  draw_rect(p.x, p.y, 10, 20); \/\/ what units are 10 and 20 in?<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0447\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e std::chrono::milliseconds, \u0430 \u043d\u0435 int num_msec.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430: \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u043e\u0434\u0438\u043d \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c <a href=\"https:\/\/www.reddit.com\/r\/cpp\/comments\/sxpsxt\/ways_to_refactor_toggleboolean_parameters_in_c\/hxtweel\/?utm_source=share&amp;utm_medium=web2x&amp;context=3\">\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b<\/a> \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 Clang-Tidy, \u043a\u043e\u0442\u043e\u0440\u0430\u044f <a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/checks\/bugprone-argument-comment.html\">\u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442<\/a> \u043f\u0438\u0441\u0430\u0442\u044c &#171;\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432&#187; \u0440\u044f\u0434\u043e\u043c \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f bugprone-argument-comment. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"cpp\">void RenderGlyphs(Glyphs &amp;glyphs,    bool useCache, bool deferred, bool optimize, bool finalRender, int bpp) {   }  int main() {     Glyphs glyphs;     RenderGlyphs(glyphs,              \/*useCha=*\/true,               \/*deferred=*\/false,               \/*optimize=*\/true,               \/*finalRender=*\/false,              \/*bpppp=*\/8);                                      }<\/code><\/pre>\n<p>\u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">&lt;source>:13:14: warning: argument name 'useCha' in comment does not            match parameter name 'useCache' [bugprone-argument-comment]              \/*useCha=*\/true,               ^ &lt;source>:5:8: note: 'useCache' declared here   bool useCache, bool deferred, bool optimize, bool finalRender, int bpp)        ^<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439: <code>\/*arg=*\/<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <a href=\"https:\/\/godbolt.org\/z\/e1Y71z989\">@Compiler Explorer<\/a>.<\/p>\n<h3>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u00a0<\/h3>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0435\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\/\u0443\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0432 \u043c\u043e\u0451\u043c \u043a\u043e\u0434\u0435. \u0412\u043e\u0442 \u0433\u0440\u0443\u0431\u044b\u0439 \u043d\u0430\u0431\u0440\u043e\u0441\u043e\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/ \u0444\u0443\u043d\u043a\u0446\u0438\u0438: bool CreateContainer(Container *pOutContainer, bool *pOutWasReused);  void Process(Container *pContainer, bool bWasReused);  \/\/ \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 bool bWasReused = false; if (!CreateContainer(&amp;myContainer, &amp;bWasReused))    return false;  Process(&amp;myContainer, bWasReused);<\/code><\/pre>\n<p>\u041a\u043e\u0440\u043e\u0442\u043a\u043e: \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u043b, \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u0442. \u0434. \u0414\u0443\u043c\u0430\u044e, \u044d\u0442\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433, \u0437\u0430\u0442\u0435\u043c \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0421++ \u043e\u0431\u0435\u0441\u043a\u0443\u0440\u0430\u0436\u0438\u0432\u0430\u044e\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435? \u0414\u0430. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">enum class ContainerCreateInfo { Err, Created, Reused }; ContainerCreateInfo CreateContainer(Container *pOutContainer);  void Process(Container *pContainer, ContainerCreateInfo createInfo);  \/\/ \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 auto createInfo = CreateContainer(&amp;myContainer) if (createInfo == ContainerCreateInfo::Err);    return false;  Process(&amp;myContainer, createInfo);<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u0415\u0441\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044e CreateInfo \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u043c\u0435\u0441\u0442\u0435; \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e bool, \u043d\u043e \u044d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u041a\u043e\u0434 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0435\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043c\u0435\u0435\u0442\u0441\u044f pOutContainer, \u0447\u0442\u043e \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412 \u043c\u043e\u0451\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e, \u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"cpp\">enum class ContainerCreateInfo { Err, Created, Reused }; std::pair&lt;Container, ContainerCreateInfo> CreateContainer();<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u0430\u0436\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/ \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 auto [myContainer, createInfo] = CreateContainer() if (createInfo == ContainerCreateInfo::Err);    return false;  Process(&amp;myContainer, createInfo);<\/code><\/pre>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0435\u00a0<\/h3>\n<p>\u0427\u0438\u0442\u0430\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e<a href=\"https:\/\/www.cppstories.com\/2017\/03\/on-toggle-parameters\/(https:\/\/akrzemi1.wordpress.com\/2017\/02\/16\/toggles-in-functions\/).\"> \u0441\u0442\u0430\u0442\u044c\u044e <\/a>\u0410\u043d\u0434\u0436\u0435\u044f \u0438 \u044d\u0442\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0442 \u043c\u0435\u043d\u044f, \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438 \u0438\u0434\u0435\u044e \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f\u0445. \u041e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b, \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. <\/p>\n<p>\u041f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0435\u0440\u0435\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0434\u0438\u0437\u0430\u0439\u043d, \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0440\u0438 \u0438\u043b\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 \u0440\u044f\u0434. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435\u0439\/\u0444\u043b\u0430\u0433\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434. <\/p>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/akrzemi1.wordpress.com\/2017\/02\/16\/toggles-in-functions\/\">Toggles in functions<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/understandlegacycode.com\/blog\/what-is-wrong-with-boolean-parameters\/\">What is wrong with boolean parameters?<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/softwareengineering.stackexchange.com\/questions\/194412\/using-scoped-enums-for-bit-flags-in-c\">c++11 &#8212; Using scoped enums for bit flags in C++<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432:<\/h3>\n<ul>\n<li>\n<p>\u0412\u044b \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438?<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043b\u0438 \u0432\u044b \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u0434\u0435?<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u0442\u0437\u044b\u0432\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>\u0410 \u043c\u044b \u043f\u043e\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u0438 \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_050322&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_050322&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e <a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_050322&amp;utm_term=conc\">\u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044e<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0fd\/6a7\/083\/0fd6a708307b3bd1f79b879982fa8989.png\" width=\"1000\" height=\"200\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0fd\/6a7\/083\/0fd6a708307b3bd1f79b879982fa8989.png\"\/><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432 \u0438 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>Data Science \u0438 Machine Learning<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Data Engineering<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438 Deep Learning\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Java \u0438 C#<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430 JAVA<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041e\u0442 \u043e\u0441\u043d\u043e\u0432 \u2014 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_050322&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410 \u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_050322&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_050322&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/skillfactory\/blog\/654253\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/654253\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0447\u0438\u0442\u0430\u044e\u0442 \u043a\u043e\u0434 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0430\u0449\u0435, \u0447\u0435\u043c \u043f\u0438\u0448\u0443\u0442 \u0435\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u043a\u043e\u0434. \u0410\u0432\u0442\u043e\u0440 \u043a\u043d\u0438\u0433\u0438 \u0421++17 in detail \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b. \u0414\u0435\u043b\u0438\u043c\u0441\u044f \u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043a\u0443\u0440\u0441\u0430 \u043f\u043e <a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_050322&amp;utm_term=lead\">\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 \u0421++<\/a>.<\/p>\n<hr\/>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043c\u043e\u0433\u0443\u0442 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">DoImportantStuff(true, false, true, false);<\/code><\/pre>\n<p>\u041d\u0435\u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 true \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 false? \u041c\u043e\u0436\u043d\u043e \u043b\u0438  \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433.<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u0431\u043b\u043e\u0433\u0435 \u0410\u043d\u0434\u0436\u0435\u044f \u041a\u0440\u0436\u0435\u043c\u0435\u043d\u0441\u043a\u0438: <a href=\"https:\/\/akrzemi1.wordpress.com\/2017\/02\/16\/toggles-in-functions\/\">Toggles in functions<\/a>. \u041a\u0430\u043a \u043f\u0438\u0448\u0435\u0442 <a href=\"https:\/\/akrzemi1.wordpress.com\/about\/\">\u0410\u043d\u0434\u0436\u0435\u0439<\/a>, \u0432\u0435\u0441\u044c \u0441\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">RenderGlyphs(glyphs, true, false, true, false);<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432? \u0422\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442. \u041f\u043e\u0434\u0443\u043c\u0430\u0435\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435: \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">RenderGlyphs(glyphs,              \/*useChache*\/true,               \/*deferred*\/false,               \/*optimize*\/true,               \/*finalRender*\/false);<\/code><\/pre>\n<p>\u0418 \u0445\u043e\u0442\u044f \u043a\u043e\u0434 \u0432\u044b\u0448\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e?<\/p>\n<h3>\u0418\u0434\u0435\u0438<\/h3>\n<p>\u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0434\u0435\u0439:<\/p>\n<h4>\u041a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/h4>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">enum class UseCacheFlag    { False, True }; enum class DeferredFlag    { False, True }; enum class OptimizeFlag    { False, True }; enum class FinalRenderFlag { False, True };  \/\/ \u0438 \u0432\u044b\u0437\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: RenderGlyphs(glyphs,              UseCacheFlag::True,               DeferredFlag::False,               OptimizeFlag::True,               FinalRenderFlag::False);<\/code><\/pre>\n<p>\u0418 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">if (useCache) { } else { } if (deferred) { } else {}<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">if (useCache == UseCacheFlag::True) { } else { } if (deferred == DeferredFlag::True) { } else {}<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f bool. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u043e \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043c\u0451\u043d.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0438\u043f\u044b. \u041d\u0443\u0436\u043d\u043e \u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043e\u0431\u0449\u0438\u0435 \u0444\u043b\u0430\u0433\u0438?<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c Flag::True \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e, \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u044f\u0432\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u2014 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/akrzemi1\/explicit\/blob\/master\/include\/ak_toolkit\/tagged_bool.hpp\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a> \u0410\u043d\u0434\u0436\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0432 bool \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438. \u042f \u0431\u044b\u043b \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0432 \u044f\u0437\u044b\u043a\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041d\u043e \u043f\u043e\u0437\u0436\u0435 \u0441\u0442\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435. <\/p>\n<p>\u042f\u0432\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0442\u0430\u043a \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u044f\u0437\u044b\u043a \u2014 \u043f\u0435\u0440\u0435\u0433\u0438\u0431? \u042f\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439\u2026<\/p>\n<h4>\u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043b\u0430\u0433\u0438<\/h4>\n<p>\u041a\u0430\u043a \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043b\u0430\u0433\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0438\u0445 \u0434\u0440\u0443\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438 \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430.<\/p>\n<p>\u0412\u043e\u0442 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  struct Glyphs { };  enum class RenderGlyphsFlags {     useCache = 1,     deferred = 2,      optimize = 4,     finalRender = 8, };  \/\/ \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435... RenderGlyphsFlags operator | (RenderGlyphsFlags a, RenderGlyphsFlags b) {     using T = std::underlying_type_t &lt;RenderGlyphsFlags>;     return static_cast&lt;RenderGlyphsFlags>(static_cast&lt;T>(a) | static_cast&lt;T>(b));     \/\/ todo: \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435... }  constexpr bool IsSet(RenderGlyphsFlags val, RenderGlyphsFlags check) {     using T = std::underlying_type_t &lt;RenderGlyphsFlags>;     return static_cast&lt;T>(val) &amp; static_cast&lt;T>(check);     \/\/ todo: \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438... }  void RenderGlyphs(Glyphs &amp;glyphs, RenderGlyphsFlags flags) {     if (IsSet(flags, RenderGlyphsFlags::useCache)) { }     else { }      if (IsSet(flags, RenderGlyphsFlags::deferred)) { }     else { }      \/\/ ... }  int main() {     Glyphs glyphs;     RenderGlyphs(glyphs, RenderGlyphsFlags::useCache | RenderGlyphsFlags::optimize);                                       }<\/code><\/pre>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/godbolt.org\/z\/T6zaa9csP\">@Compiler Explorer<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435? \u0421 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e, \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043c\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0432\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0443\u0436\u043d\u044b\u0439 \u0431\u0438\u0442.<\/p>\n<p>\u0421 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421++23 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f std::to_underlying() \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 &lt;utility>. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 GCC, Clang \u0438 MSVC: \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <a href=\"https:\/\/godbolt.org\/z\/KeoGq5EjK\">@Compiler Explorer<\/a>.<\/p>\n<h4>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 4 \u0438\u043b\u0438 5, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b?<\/p>\n<pre><code class=\"cpp\">struct RenderGlyphsParam {     bool useCache;     bool deferred;     bool optimize;     bool finalRender; }; void RenderGlyphs(Glyphs &amp;glyphs, const RenderGlyphsParam &amp;renderParam);  \/\/ \u0432\u044b\u0437\u043e\u0432: RenderGlyphs(glyphs,              {\/*useCache*\/true,               \/*deferred*\/false,               \/*optimize*\/true,               \/*finalRender*\/false});<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u043b\u043e. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0414\u0430, \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p>\u041e\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0447\u043b\u0435\u043d\u0430\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e glyphs \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 RenderGlyphsParam, \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h4>\u0410 \u0447\u0442\u043e \u0432 \u0421++20?<\/h4>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u043c\u044b\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u043c \u0432 \u0421++20, \u043f\u0440\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c, \u043a\u0430\u043a \u0432 \u0438\u043c\u0435\u043d\u0430\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u042199:<\/p>\n<pre><code class=\"cpp\">struct RenderGlyphsParam {     bool useCache;     bool deferred;     bool optimize;     bool finalRender; }; void RenderGlyphs(Glyphs &amp;glyphs, const RenderGlyphsParam &amp;renderParam);  \/\/ \u0432\u044b\u0437\u043e\u0432: RenderGlyphs(glyphs,              {.useCache = true,                .deferred = false,                .optimize = true,                .finalRender = false}); <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0432 <a href=\"https:\/\/godbolt.org\/z\/Yjcbocaza\">@Compiler Explorer<\/a>. <\/p>\n<p>\u041e\u0431 \u044d\u0442\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043c\u043e\u0451\u043c \u043f\u043e\u0441\u0442\u0435 <a href=\"https:\/\/www.cppstories.com\/2021\/designated-init-cpp20\/\">Designated Initializers in C++20<\/a>.<\/p>\n<h4>\u0423\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/h4>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0435\u0449\u0451 \u043f\u0440\u043e\u0449\u0435? \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440?<\/p>\n<p>\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">RenderGlyphsDeferred(glyphs,              \/*useCache*\/true,               \/*optimize*\/true); RenderGlyphsForFinalRender(glyphs,              \/*useCache*\/true,               \/*optimize*\/true;<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445: deferred \u0438 final \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e RenderGlyphsInternal. <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u0431\u044b \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438. \u041d\u043e, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0442\u0430\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0440\u044b\u0442 \u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0437\u0436\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0435\u0451 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041c\u043e\u0436\u0435\u0442, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0440\u0430\u0437\u0431\u0435\u0439\u0442\u0435 \u0435\u0451 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b, \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0432\u0435\u0442 \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u0432 <a href=\"https:\/\/martinfowler.com\/bliki\/FlagArgument.html\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u0433\u0434\u0435 \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u0443\u0435\u0442 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435\u0439. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"http:\/\/www.informit.com\/articles\/article.aspx?p=1392524\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432 <a href=\"http:\/\/amzn.to\/2m3g2LS\">\u043a\u043d\u0438\u0433\u0435<\/a> Clean Code: A Handbook of Agile Software Craftsmanship<strong>.<\/strong><\/p>\n<h4>\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b<\/h4>\n<p>\u041a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0439 \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0443\u0441\u0438\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.cppstories.com\/2021\/strong-types-pesel\/\">Strong Types in C++: A Concrete Example<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/arne-mertz.de\/2016\/11\/stronger-types\/\">Simplify C++: Use Stronger Types!<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.ilikebigbits.com\/blog\/2014\/5\/6\/type-safe-identifiers-in-c\">Type safe handles in C++<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.fluentcpp.com\/2016\/12\/08\/strong-types-for-strong-interfaces\/\">Strong types for strong interfaces<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/foonathan.net\/blog\/2016\/10\/11\/type-safe.html\">Type safe &#8212; Zero overhead utilities for more type safety<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.boost.org\/doc\/libs\/1_61_0\/libs\/serialization\/doc\/strong_typedef.html\">Serialization &#8212; BOOST_STATIC_WARNING<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0421++<\/h3>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0421++, \u043a\u0443\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e. \u0412\u043e\u0442 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445: <a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#i4-make-interfaces-precisely-and-strongly-typed\">I.4: Make interfaces precisely and strongly typed<\/a>, \u0432 \u043d\u0451\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, \u043d\u043e \u0438 \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">draw_rect(100, 200, 100, 500); \/\/ what do the numbers specify?  draw_rect(p.x, p.y, 10, 20); \/\/ what units are 10 and 20 in?<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043b\u0443\u0447\u0448\u0435, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0447\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e std::chrono::milliseconds, \u0430 \u043d\u0435 int num_msec.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430: \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u043e\u0434\u0438\u043d \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c <a href=\"https:\/\/www.reddit.com\/r\/cpp\/comments\/sxpsxt\/ways_to_refactor_toggleboolean_parameters_in_c\/hxtweel\/?utm_source=share&amp;utm_medium=web2x&amp;context=3\">\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b<\/a> \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 Clang-Tidy, \u043a\u043e\u0442\u043e\u0440\u0430\u044f <a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/checks\/bugprone-argument-comment.html\">\u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442<\/a> \u043f\u0438\u0441\u0430\u0442\u044c &#171;\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432&#187; \u0440\u044f\u0434\u043e\u043c \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f bugprone-argument-comment. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"cpp\">void RenderGlyphs(Glyphs &amp;glyphs,    bool useCache, bool deferred, bool optimize, bool finalRender, int bpp) {   }  int main() {     Glyphs glyphs;     RenderGlyphs(glyphs,              \/*useCha=*\/true,               \/*deferred=*\/false,               \/*optimize=*\/true,               \/*finalRender=*\/false,              \/*bpppp=*\/8);                                      }<\/code><\/pre>\n<p>\u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">&lt;source>:13:14: warning: argument name 'useCha' in comment does not            match parameter name 'useCache' [bugprone-argument-comment]              \/*useCha=*\/true,               ^ &lt;source>:5:8: note: 'useCache' declared here   bool useCache, bool deferred, bool optimize, bool finalRender, int bpp)        ^<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439: <code>\/*arg=*\/<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <a href=\"https:\/\/godbolt.org\/z\/e1Y71z989\">@Compiler Explorer<\/a>.<\/p>\n<h3>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u00a0<\/h3>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-330346","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330346","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=330346"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330346\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}