{"id":501063,"date":"2026-10-30T16:31:34","date_gmt":"2026-10-30T13:31:34","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=501063"},"modified":"2026-10-30T16:31:34","modified_gmt":"2026-10-30T13:31:34","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=501063","title":{"rendered":"\u041f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 C++"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e C++ \u2014 \u044f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u043b\u0447\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043a\u0430\u043a \u0432\u044b \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c. \u041e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043c\u044b\u0441\u043b\u0438\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c\u0438 \u0431\u0430\u0439\u0442\u043e\u0432, \u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430 \u0442\u0438\u043f\u043e\u0432 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0440\u0430\u0441\u0442\u043e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439? \u041a\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0441\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f. \u0417\u0430\u0447\u0435\u043c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u201c\u0434\u0430\/\u043d\u0435\u0442\u201d \u0446\u0435\u043b\u044b\u0439 \u0432\u043e\u0441\u044c\u043c\u0438\u0431\u0438\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u044e\u0432\u0435\u043b\u0438\u0440\u043d\u043e \u043e\u0442\u0440\u0435\u0437\u0430\u0442\u044c \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0431\u0438\u0442? \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u2014 \u0438 \u0442\u044b \u043f\u043e\u0432\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043d\u0430 \u043e\u0434\u0438\u043d \u0441 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043c\u0435\u0441\u0442\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 C++ \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c, \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/16\/11\/e7\/1611e77e0eb91a67fb15d92fb2fe73be.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/16\/11\/e7\/1611e77e0eb91a67fb15d92fb2fe73be.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/16\/11\/e7\/1611e77e0eb91a67fb15d92fb2fe73be.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u0430\u043a \u044f \u0434\u043e\u043a\u0430\u0442\u0438\u043b\u0430\u0441\u044c \u0434\u043e \u0436\u0438\u0437\u043d\u0438 \u0442\u0430\u043a\u043e\u0439 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443?<\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b MISRA C++ 2023. \u0414\u0430-\u0434\u0430, PVS-Studio \u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0430\u0448\u0438 \u043a\u043e\u0434\u043e\u0432\u044b\u0435 \u0431\u0430\u0437\u044b \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443. \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b, \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0412 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e: \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0443\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>enum<\/code> \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0431\u0438\u0442.<\/p>\n<p>\u0417\u043d\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u043e\u0431\u043c\u0430\u043d\u0447\u0438\u0432\u043e\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u043e, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u043f\u0430\u0440\u0443 \u0447\u0430\u0441\u043e\u0432, \u0430 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0441 \u0432 \u043f\u0443\u0447\u0438\u043d\u0443 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u043d\u0430 \u043d\u0435\u0434\u0435\u043b\u044e? \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0441\u043e \u043c\u043d\u043e\u0439. \u042f \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u043b\u0430 \u043d\u0430\u0434 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<p>\u041f\u044b\u0442\u0430\u044f\u0441\u044c \u0440\u0430\u0441\u043f\u0443\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0443\u0431\u043e\u043a, \u044f \u043f\u043e\u043d\u044f\u043b\u0430 \u043e\u0434\u043d\u0443 \u0432\u0435\u0449\u044c: \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0432 C++ \u2014 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0451\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c.<\/p>\n<h3>\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0433\u043b\u0430\u0432\u043d\u043e\u043c: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f?<\/h3>\n<p>\u0411\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 C++ \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0439 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0431\u0430\u0439\u0442\u0430\u043c\u0438, \u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442, \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u0441\u0430\u043c\u0438 \u0440\u0435\u0448\u0430\u0435\u0442\u0435, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e. \u042d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u043e \u043f\u0440\u0438 \u0436\u0451\u0441\u0442\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0444\u043b\u0430\u0433\u043e\u0432.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u043d\u043e \u043e\u0431\u0449\u0430\u044f \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">type-specifier declarator : constant-expression ;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p>\u0413\u0434\u0435 <code>constant-expression<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442\u043e\u0432, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435.<\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435: \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u043c C++ \u043a\u043e\u0434\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 <code>CHAR_BIT<\/code> \u0431\u0438\u0442. \u041c\u0430\u043a\u0440\u043e\u0441 <code>CHAR_BIT<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, \u043d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f 8. \u0414\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0435\u0451 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u201c\u0440\u0435\u0437\u0430\u0442\u044c\u201d \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u043a\u043e\u043f\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043f\u0430\u043c\u044f\u0442\u044c. \u041a\u0430\u043a? \u0417\u0430 \u0441\u0447\u0451\u0442 \u043b\u0438\u043a\u0432\u0438\u0434\u0430\u0446\u0438\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u201c\u043f\u0443\u0441\u0442\u044b\u0445\u201d \u0438\u043b\u0438 \u201c\u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445\u201d \u0431\u0438\u0442\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0432\u043e\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0432\u0435\u0440\u0445 \u0434\u043e \u0446\u0435\u043b\u044b\u0445 \u0431\u0430\u0439\u0442\u043e\u0432. \u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u044f\u0442 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0432 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u044f\u0442 \u043c\u0435\u0441\u0442\u043e, \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 (\u0432\u043a\u043b\u044e\u0447\u0451\u043d\/\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d) \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 1 \u0431\u0438\u0442\u0430 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0438\u043b\u0438 1);<\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b (4 \u0440\u0435\u0436\u0438\u043c\u0430) \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 2 \u0431\u0438\u0442\u0430 (\u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 00, 01, 10, 11);<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 (\u043e\u0442 0 \u0434\u043e 7) \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 3 \u0431\u0438\u0442\u043e\u0432 (\u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u043e\u0442 000 \u0434\u043e 111).<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0442\u043e\u0433\u043e \u0432\u0441\u044f \u0432\u0430\u0436\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e 6 \u0431\u0438\u0442.<\/p>\n<p><strong>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1. \u041e\u0431\u044b\u0447\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C++, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0435\u043b\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">struct StandardStruct {  bool is_active;     char mode;          char error_code; };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/godbolt.org\/z\/1s9v7hhc9\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a><\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt;struct StandardStruct {  bool is_active;     char mode;          char error_code; }; int main(){  StandardStruct stStruct;  std::cout &lt;&lt; \"Sizeof stStruct: \" &lt;&lt; sizeof(stStruct)            &lt;&lt; \"byte(s)\" &lt;&lt; std::endl;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">Sizeof stStruct: 3 byte(s)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u043d\u044f\u043b\u0430 24 \u0431\u0438\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0448\u0435\u0441\u0442\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e 24 \u044f\u0447\u0435\u0439\u043a\u0438, \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 18 \u044f\u0447\u0435\u0435\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430.<\/p>\n<p><strong>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u044f. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0435\u0442 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043e\u0434\u0438\u043d \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>unsigned char<\/code> \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1 \u0431\u0430\u0439\u0442 (8 \u0431\u0438\u0442), \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043b\u043e\u0442\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u044c \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"cpp\">struct BitFieldStruct{  unsigned char is_active  : 1;   unsigned char mode       : 2;   unsigned char error_code : 3; };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/godbolt.org\/z\/9PqjcvoT8\">\u041f\u0440\u0438\u043c\u0435\u0440<\/a><\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt;struct BitFieldStruct{  unsigned char is_active  : 1;   unsigned char mode       : 2;   unsigned char error_code : 3; };int main(){  BitFieldStruct stStruct;  std::cout &lt;&lt; \"Sizeof stStruct: \" &lt;&lt; sizeof(stStruct)            &lt;&lt; \" byte(s)\" &lt;&lt; std::endl;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">Sizeof stStruct: 1 byte(s)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0432\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0434\u043e 1 \u0431\u0430\u0439\u0442\u0430. \u0412 \u043f\u0430\u043c\u044f\u0442\u0438 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 8 \u0431\u0438\u0442, \u043f\u043e\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u0441\u0435\u043a\u0442\u043e\u0440\u0430:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/ab\/e7\/3c\/abe73cb97b638606b2e5efb286f3a889.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/ab\/e7\/3c\/abe73cb97b638606b2e5efb286f3a889.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/ab\/e7\/3c\/abe73cb97b638606b2e5efb286f3a889.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0451\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443: \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>mode<\/code> \u043e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u0441\u0434\u0432\u0438\u0433\u0438 \u0438 \u043c\u0430\u0441\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 2 \u0431\u0438\u0442\u0430 \u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438\u043b\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c (\u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432) \u0442\u0430\u043a\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u0430\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/p>\n<p>\u041c\u044b \u0443\u0436\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043c\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u044f\u0437\u044b\u043a.<\/p>\n<p>\u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0441\u0440\u0435\u0434\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b <code>const<\/code> \u0438\/\u0438\u043b\u0438 <code>volatile<\/code> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\/\u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<h4>\u0422\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438<\/h4>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u2014 \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a <em>\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u0430\u043c<\/em> (<em>integral types<\/em>) \u0438 <em>\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c<\/em> (<em>enumerations<\/em>). \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043f\u043e \u0431\u0438\u0442\u0430\u043c \u0442\u0438\u043f\u044b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 (<code>float<\/code>, <code>double<\/code>) \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b (<code>std::string<\/code>) \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b:<\/p>\n<p><em>1. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (<\/em><code><em>char<\/em><\/code><em>, <\/em><code><em>wchar_t<\/em><\/code><em>, <\/em><code><em>char8_t<\/em><\/code><em>, <\/em><code><em>char16_t<\/em><\/code><em>, <\/em><code><em>char32_t<\/em><\/code><em>, <\/em><code><em>bool<\/em><\/code><em>, <\/em><code><em>short<\/em><\/code><em>, <\/em><code><em>int<\/em><\/code><em>, <\/em><code><em>long<\/em><\/code><em>, <\/em><code><em>long long<\/em><\/code><em>).<\/em><\/p>\n<p>\u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u043e\u043a \u0438 \u0444\u043b\u0430\u0433\u043e\u0432. \u0414\u043e C++ 14 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>int<\/code> \u0431\u044b\u043b\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b <code>signed<\/code> \u0438\u043b\u0438 <code>unsigned<\/code>, \u0438\u043d\u0430\u0447\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u043d\u043e\u0431\u0438\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 <code>int<\/code> \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e <code>unsigned<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0438 -1 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 0 \u0438 1. \u0414\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e <code>bool<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u043e\u0432\u043d\u043e 1 \u0431\u0438\u0442.<\/p>\n<p><em>2. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (<\/em><code><em>enum<\/em><\/code><em> \u0438 <\/em><code><em>enum class<\/em><\/code><em>).<\/em><\/p>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 <code>enum<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c 2 \u0431\u0438\u0442\u0430.<\/p>\n<p>_3. <code><em>std::byte<\/em><\/code> _(<em>C++20).<\/em><\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/cstddef.syn#lib:byte\">C++ 20<\/a>, \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u043b <code>std::byte<\/code>. \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u044b\u0440\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>std::byte<\/code> \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<h4>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438<\/h4>\n<p>\u0422\u0440\u0435\u0442\u044c\u0435, \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0432 C++ \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b <strong>\u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0437\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0436\u0438\u0432\u0451\u0442 \u043f\u043e \u0442\u0430\u043a\u0438\u043c \u0437\u0430\u043a\u043e\u043d\u0430\u043c \u0438 \u043a \u0447\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0438\u0445 \u043e\u0431\u043e\u0439\u0442\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"cpp\">struct HardwareFlags{  unsigned int mode   : 3;  unsigned int status : 1;};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h3>\u0422\u0430\u0431\u0443 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044e \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438<\/h3>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u043f\u0440\u0435\u0442\u0430 \u043d\u0430 \u0432\u0437\u044f\u0442\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043b\u0435\u0436\u0438\u0442 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b: \u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043d\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443, \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 (<code>CHAR_BIT<\/code> \u0431\u0438\u0442). \u0423 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 3-\u0439 \u0431\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0439\u0442\u0430.<\/p>\n<p>\u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0432\u0437\u044f\u0442\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430 <code>&amp;<\/code> \u043a \u0431\u0438\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044e:<\/p>\n<pre><code class=\"cpp\">HardwareFlags flags;auto address = &amp;flags.mode;int* ptr = &amp;flags.mode;     \/\/ doesn't compile<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u0442 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041d\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430, \u043d\u0435\u0442 \u0438 \u0441\u0441\u044b\u043b\u043e\u043a<\/p>\n<p>\u0418\u0437 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0437\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 <code>&amp;<\/code> \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435. \u0421\u0441\u044b\u043b\u043a\u0430 \u0432 \u044f\u0437\u044b\u043a\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044e, \u0430 \u0440\u0430\u0437 \u043d\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430, \u0442\u043e \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0435\u0451 \u043d\u0435 \u043a \u0447\u0435\u043c\u0443:<\/p>\n<pre><code class=\"cpp\">HardwareFlags flags;void checkMode(const unsigned int&amp; m);unsigned int&amp; ref = flags.mode;        \/\/ doesn't compilecheckMode(flags.mode);                 \/\/ doesn't compile<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432\u044b: \u043f\u043e\u0447\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0431\u0435\u0441\u0441\u0438\u043b\u044c\u043d\u0430<\/p>\n<p>\u041e\u0433\u043e\u0440\u0447\u0443 \u0432\u0430\u0441: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0435. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043b\u0435\u0436\u0430\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. \u041f\u0440\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 <code>i<\/code>-\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>arr[i]<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 \u0430\u0434\u0440\u0435\u0441\u043d\u0443\u044e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">struct BrokenStruct{  unsigned int items[5] : 2; \/\/ doesn't compile};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0410\u043d\u0430\u0442\u043e\u043c\u0438\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f<\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u043d\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u044f\u0437\u044b\u043a\u0435. \u0423 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u0430 \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0431\u0438\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0422\u0430\u043a\u0430\u044f \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442, \u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0435\u0451 \u043f\u0440\u0438\u0447\u0438\u043d\u044b, \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/class.bit#1\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442<\/a>:<\/p>\n<blockquote>\n<p>Allocation of bit-fields within a class object is implementation-defined. Alignment of bit-fields is implementation-defined. Bit-fields are packed into some addressable allocation unit.<\/p>\n<p>[Note 1:\u2002Bit-fields straddle allocation units on some machines and not on others. Bit-fields are assigned right-to-left on some machines, left-to-right on others. \u2014 end note]<\/p>\n<\/blockquote>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u0438\u043a\u0442\u0443\u044e\u0442\u0441\u044f \u043d\u0435 \u0441\u0430\u043c\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Application_binary_interface\">Application Binary Interface<\/a>, ABI) \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/itanium-cxx-abi.github.io\/cxx-abi\/abi.html\">Itanium ABI,<\/a> \u043d\u043e \u0434\u0430\u0436\u0435 \u043e\u043d \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0438\u0442\u043e\u0432 \u0434\u043e \u043a\u043e\u043d\u0446\u0430. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043b\u043e\u0433\u0438\u043a\u0430 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 MSVC \u043f\u043e\u0434 Windows \u0438 GCC \u043f\u043e\u0434 Linux \u043c\u043e\u0433\u0443\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438. \u0422\u0435\u043c\u0443 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u044f \u0437\u0430\u0442\u0440\u043e\u043d\u0443 \u043b\u0438\u0448\u044c \u0432\u0441\u043a\u043e\u043b\u044c\u0437\u044c \u2014 \u0435\u0439 \u0443\u0436\u0435 \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432: <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1339\/\">\u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a> \u043f\u0440\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b; <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1340\/\">\u0432\u0442\u043e\u0440\u0430\u044f<\/a> \u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1369\/\">\u0442\u0440\u0435\u0442\u044c\u044f<\/a> \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h4>\u041a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0430\u0440\u0435\u0437\u0430\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438<\/h4>\n<p>\u0424\u0440\u0430\u0437\u0430 \u201cBit-fields are packed into some addressable allocation unit\u201d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/class.bit#1\"><em>\u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438<\/em><\/a> (<em>allocation unit<\/em>). \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 C++, \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u0439 \u0431\u043b\u043e\u043a \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u0430\u0439\u0442 \u0438\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u044b \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f. \u0422\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0432 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 ABI \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0442\u044b \u201c\u0438\u0437 \u0432\u043e\u0437\u0434\u0443\u0445\u0430\u201d. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0431\u0435\u0440\u0451\u0442 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f, \u0438 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <code>unsigned char<\/code>, \u0442\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0431\u043b\u043e\u043a\u043e\u043c \u0441\u0442\u0430\u043d\u0435\u0442 1 \u0431\u0430\u0439\u0442 (8 \u0431\u0438\u0442). \u0415\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 <code>unsigned int<\/code>, \u0431\u043b\u043e\u043a \u0437\u0430\u0439\u043c\u0451\u0442 4 \u0431\u0430\u0439\u0442\u0430 (32 \u0431\u0438\u0442\u0430). \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0451\u0442 \u044d\u0442\u043e\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u0438\u0442 \u0437\u0430 \u0431\u0438\u0442\u043e\u043c, \u201c\u043d\u0430\u0440\u0435\u0437\u0430\u0442\u044c\u201d \u0435\u0433\u043e \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u043a\u0430 \u0432 \u043d\u0451\u043c \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f \u043d\u043e\u0432\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/56\/2b\/a5\/562ba5eff17f7e2d0765366d8b5bea79.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/56\/2b\/a5\/562ba5eff17f7e2d0765366d8b5bea79.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/56\/2b\/a5\/562ba5eff17f7e2d0765366d8b5bea79.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438) \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u0438\u0442, \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0451\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043d \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0448\u0438\u0440\u0438\u043d\u0443 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432 \u0431\u0438\u0442\u0430\u0445 \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u0442\u0430\u0442\u043e\u043a, \u043e\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u043f\u043b\u043e\u0442\u043d\u0443\u044e \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u043e\u043b\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u0438\u0442 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u043e\u043b\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0448\u0438\u0440\u0438\u043d\u0430 \u043f\u043e\u043b\u044f \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0431\u0438\u0442, \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0438\u043b\u0435\u043c\u043c\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c ABI \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0414\u043b\u044f x86\/ARM \u043f\u043e\u043b\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0440\u0430\u0434\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0414\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 (\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 RISC-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b) \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0435\u0433\u043e \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a).<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u043f\u043e\u043b\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u0438\u0442 \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u043e\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong> \u0421\u0442\u043e\u0440\u043e\u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u043c\u043b\u0430\u0434\u0448\u0438\u0435 \u0438\u043b\u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u0431\u0438\u0442\u044b) \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 ABI \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/div>\n<\/details>\n<h4>\u0420\u0430\u0437\u0434\u0443\u0432\u0430\u043d\u0438\u0435 sizeof: \u043f\u043b\u043e\u0445\u043e\u0435 vs \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>\u0417\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u044b \u0442\u0430\u043a \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0435\u0437 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043a\u0443\u0445\u043d\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0438\u043d\u0443 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u0440\u0430\u0441\u0447\u0451\u0442 \u0438\u0434\u0451\u0442 \u043d\u0430 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044e \u043c\u0435\u0441\u0442\u0430, \u0430 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0435\u0441\u0438\u0442 \u0432 \u0440\u0430\u0437\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439. \u0415\u0441\u043b\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u043e, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u201c\u0440\u0430\u0437\u0434\u0443\u0432\u0430\u043d\u0438\u044f\u201d \u043f\u0430\u043c\u044f\u0442\u0438 (sizeof bloat). \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0442\u0435\u0440\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043b\u043e\u0442\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0431\u0430\u0439\u0442\u044b.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043a \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u0443\u0442\u0435\u0447\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u0434\u0432\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u201c\u043f\u043e\u043b\u0435\u0439-\u0433\u0438\u0433\u0430\u043d\u0442\u043e\u0432\u201d, \u0448\u0438\u0440\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043c\u0435\u0441\u0442\u0430 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u201c\u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u0432\u0438\u043d\u0435\u0433\u0440\u0435\u0442\u201d, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>char<\/code>, \u0437\u0430\u0442\u0435\u043c <code>int<\/code>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043d\u043e\u0432\u0430 <code>char<\/code>). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u201c\u0432\u0438\u043d\u0435\u0433\u0440\u0435\u0442\u201d \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Windows (Microsoft ABI), \u0433\u0434\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043c\u0435\u043d\u0435 \u0442\u0438\u043f\u0430, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0438. GCC \u0438 Clang Linux\/macOS \u043b\u0438\u0448\u0435\u043d\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430: \u043e\u043d\u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442 \u0441\u043c\u0435\u043d\u0443 \u0442\u0438\u043f\u043e\u0432 \u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0431\u0430\u0439\u0442\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0430\u0441\u0448\u0442\u0430\u0431 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f: \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0438 \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 N1. \u041d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u043f\u043b\u043e\u0445\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435)<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0433\u0434\u0435 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0430\u043b\u0438 <a href=\"https:\/\/godbolt.org\/z\/Gfohbh69o\">\u0442\u0438\u043f\u044b<\/a>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 MSVC \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Windows:<\/p>\n<pre><code class=\"cpp\">struct BadPacking{  unsigned char a : 4;  unsigned int b  : 3;  unsigned char c : 4;};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/94\/9b\/bd\/949bbd0af9350e9fe6bf0d2f4d7660e8.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/94\/9b\/bd\/949bbd0af9350e9fe6bf0d2f4d7660e8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/94\/9b\/bd\/949bbd0af9350e9fe6bf0d2f4d7660e8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0418\u0437-\u0437\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043f\u0440\u044b\u0436\u043a\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0442\u0438\u043f\u0430\u043c\u0438 (<code>char<\/code> &gt; <code>int<\/code> &gt; <code>char<\/code>) \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 MSVC \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043c\u0435\u043d\u0443 \u0442\u0438\u043f\u0430 \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (allocation unit). \u041e\u043d \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u044f <code>a<\/code>, \u0437\u0430\u0431\u0438\u0432\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u043e\u043c \u0438 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 4-\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <code>int<\/code> \u0434\u043b\u044f 3-\u0445 \u0431\u0438\u0442 \u043f\u043e\u043b\u044f <code>b<\/code> \u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0431\u043b\u043e\u043a \u0434\u043b\u044f \u0442\u0438\u043f\u0430 <code>char<\/code>. \u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043f\u0443\u0441\u0442\u043e\u0442\u044b. \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 <code>sizeof(BadPacking)<\/code> \u0432\u0435\u0440\u043d\u0451\u0442 12 \u0431\u0430\u0439\u0442. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f Clang \u0438 GCC \u043a \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0433\u043e\u0442\u043e\u0432\u044b: \u043e\u043d\u0438 \u0443\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 N2. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435)<\/strong><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0441\u0442\u0438 \u0437\u043e\u043b\u043e\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e: \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u043a \u0435\u0434\u0438\u043d\u043e\u043c\u0443 \u0431\u0430\u0437\u043e\u0432\u043e\u043c\u0443 <a href=\"https:\/\/godbolt.org\/z\/jzKxvfxKx\">\u0442\u0438\u043f\u0443<\/a> \u0438 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443.<\/p>\n<pre><code class=\"cpp\">struct GoodPacking {    unsigned int b : 3;     unsigned int a : 4;      unsigned int c : 4;  };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/0e\/1f\/5a\/0e1f5a304f610c706cb60e2b5904db4f.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/0e\/1f\/5a\/0e1f5a304f610c706cb60e2b5904db4f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/0e\/1f\/5a\/0e1f5a304f610c706cb60e2b5904db4f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c\u0438, \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u043e 4 \u0431\u0430\u0439\u0442\u0430. \u041f\u043e\u043b\u0435 <code>b<\/code> \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u043b\u043e\u043a, \u0430 \u043f\u043e\u043b\u044f <code>a<\/code> \u0438 <code>c<\/code> \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0441\u0435\u0433\u043e 8 \u0431\u0438\u0442 \u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u043b\u043e\u043a <code>int<\/code>. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 <code>sizeof(GoodPacking)<\/code> \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0441\u0435\u0433\u043e 8 \u0431\u0430\u0439\u0442 (\u0440\u043e\u0432\u043d\u043e \u0434\u0432\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>int<\/code>). \u0414\u0430\u043d\u043d\u044b\u0435 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043b\u043e\u0442\u043d\u043e, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439, \u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u043b\u0430\u0442 \u043f\u043e\u0434 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0442\u044b<\/p>\n<p>\u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432, \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0436\u0435\u043b\u0435\u0437\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u0434\u044b\u0440\u044b \u0432 \u0441\u0432\u043e\u0435\u0439 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0442\u044b \u0432 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u043c \u0431\u0430\u0439\u0442\u0435 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0447\u0438\u043f\u0430 \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u043e\u0442\u0442\u0443\u0434\u0430 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0432 \u043a\u043e\u0434\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/class.bit#2\">\u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/a>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u0440\u043e\u043b\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 \u0438\u043b\u0438 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">struct TestController{  unsigned char transmit_ready : 1;   unsigned char                : 3;   unsigned char receive_ready  : 1;  unsigned char                : 3; };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0423 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u043d\u0435\u0442 \u0438\u043c\u0435\u043d\u0438, \u043a \u043d\u0438\u043c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043c\u0435\u0441\u0442\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0431\u0438\u0442 \u0432 \u0431\u0438\u0442, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 C++ \u0441 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043d\u0435 \u0441\u0434\u0432\u0438\u0433\u0430\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0444\u043b\u0430\u0433\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u044b\u0432 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438: \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u044b<\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 (\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441), \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0440\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0441 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u0438\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/class.bit#2\">\u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u043e\u0435 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/a>:<\/p>\n<pre><code class=\"cpp\">struct Test{  unsigned char command : 4;   unsigned char         : 0;   unsigned char data    : 4; };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u043e\u043b\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u044b \u0441\u043b\u0443\u0436\u0438\u0442 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0435\u0439. \u041e\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0430. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u043d\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0438 \u043f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u0445 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0431\u0438\u0442\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430. \u041e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u044e \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b <strong>\u043d\u0435\u043b\u044c\u0437\u044f \u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c\u044f<\/strong>: \u043e\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u044b\u043c.<\/p>\n<p>\u0427\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c? \u041a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043c. \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 C++ \u2014 \u044d\u0442\u043e \u0437\u043e\u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 (implementation-defined behavior). \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++ \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u0437\u0430\u0434\u0430\u0432\u0430\u044f \u043b\u0438\u0448\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0430 \u0432\u0441\u044f \u0447\u0435\u0440\u043d\u043e\u0432\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u043a\u0435 \u201c\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 + ABI\u201d. \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u043e\u0436\u0430\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0440\u0438 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u0430: \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0431\u0438\u0442, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f<\/h4>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u0444\u0430\u043a\u0442\u043e\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0438\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u2014 \u044d\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0431\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u0430\u0439\u0442. \u041e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f: \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c \u0440\u0435\u0448\u0430\u0435\u0442, \u0432 \u043a\u0430\u043a\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u0438\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++ \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u043d\u044e\u0430\u043d\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u043e\u0442 \u043c\u043b\u0430\u0434\u0448\u0435\u0433\u043e \u0431\u0438\u0442\u0430 \u043a \u0441\u0442\u0430\u0440\u0448\u0435\u043c\u0443 (LSB-first, Little Endian) \u0438\u043b\u0438 \u043e\u0442 \u0441\u0442\u0430\u0440\u0448\u0435\u0433\u043e \u043a \u043c\u043b\u0430\u0434\u0448\u0435\u043c\u0443 (MSB-first, Big Endian).<\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0445\u0435\u043c\u044b <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bit_numbering#Least_significant_bit\"><em>LSB-first (Least Significant Bit-first)<\/em><\/a> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e, \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u043b\u0430\u0434\u0448\u0435\u0433\u043e \u0431\u0438\u0442\u0430. \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0440\u0430\u0439\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u044b\u0435 \u0440\u0430\u0437\u0440\u044f\u0434\u044b, \u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u043b\u043e\u0442\u043d\u0443\u044e \u043a \u043d\u0435\u043c\u0443, \u0441\u043c\u0435\u0449\u0430\u044f\u0441\u044c \u0432\u043b\u0435\u0432\u043e \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0432\u0435\u0441\u0430 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435\u043d \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 GCC, Clang, MSVC \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043a\u043e\u0434\u0430 \u043f\u043e\u0434 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b x86, x86-64, ARM \u0438 \u0442. \u0434.<\/p>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bit_numbering#Most_significant_bit\"><em>MSB-first (Most Significant Bit-first)<\/em><\/a>. \u0422\u0443\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u0442\u044b \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e. \u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0441\u0435\u0434\u044c\u043c\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u041f\u0435\u0440\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0441\u0448\u0438\u0435 \u0440\u0430\u0437\u0440\u044f\u0434\u044b \u043d\u0430 \u043b\u0435\u0432\u043e\u043c \u043a\u0440\u0430\u044e \u044f\u0447\u0435\u0439\u043a\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0442\u0435\u0441\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043d\u0438\u0437 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u0431\u0438\u0442\u043e\u0432. \u0422\u0430\u043a\u043e\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u0434\u043b\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Network_processor\">\u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432<\/a>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e <a href=\"https:\/\/godbolt.org\/z\/MYM1x8rPK\">\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/a>:<\/p>\n<pre><code class=\"cpp\">struct HeaderFlags{  uint8_t version : 3;   uint8_t type    : 2;   uint8_t id      : 3; };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 <\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;cstdint&gt;#include &lt;cstring&gt;#include &lt;iostream&gt;struct HeaderFlags{  uint8_t version : 3;   uint8_t type    : 2;   uint8_t id      : 3; };uint8_t result_byte = 0;int main(){  HeaderFlags flags;  flags.version = 1;  flags.type = 2;  flags.id = 4;  std::memcpy(&amp;result_byte, &amp;flags, sizeof(HeaderFlags));      return 0;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>HeaderFlags<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e 1 \u0431\u0430\u0439\u0442, \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0435\u0451 \u043f\u043e\u043b\u044f \u0442\u0440\u0435\u043c\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0427\u0442\u043e\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442 \u043d\u0430\u0440\u0443\u0436\u0443 \u0438 \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>std::memcpy<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>result_byte<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043a\u043e\u0434 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e <code>-O2<\/code>.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 <a href=\"https:\/\/godbolt.org\/z\/6G4s9envG\">GCC x86-64<\/a>:<\/p>\n<pre><code class=\"cpp\">        .globl std::ios_base_library_init()\"main\":        mov     BYTE PTR \"result_byte\"[rip], -111 ; &lt;=        xor     eax, eax        ret\"result_byte\":        .zero   1<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0412 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>mov<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e <code>-111<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0432 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 x86-64. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c <code>256 - 111 = 145<\/code>, \u0447\u0442\u043e \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u043d\u044f\u0435\u0442\u0441\u044f <code>0x89<\/code> (\u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u2014 <code>0b1001'0001<\/code>). \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0440\u0435\u0437\u0430\u043b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0422\u0430\u043a \u043a\u0430\u043a \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 4 \u0431\u0430\u0439\u0442\u0430, \u0447\u0438\u0441\u043b\u043e <code>0x00000089<\/code> \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <code>89 00 00 00<\/code>. \u0422\u043e, \u0447\u0442\u043e \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 89 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c, \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c \u0430\u0434\u0440\u0435\u0441\u0435, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0445\u0435\u043c\u044b LSB-first (Little Endian).<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 MIPS Big-Endian (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, mips-linux-gcc \u0432\u0435\u0440\u0441\u0438\u0438 16.1.0), \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443. \u0410\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 <a href=\"https:\/\/godbolt.org\/z\/99hYqr6b4\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>:<\/p>\n<pre><code class=\"cpp\">        .globl std::ios_base_library_init()main:        lui     $2,%hi(result_byte)        li      $3,52                 # 0x34        sb      $3,%lo(result_byte)($2)        jr      $31        move    $2,$0result_byte:        .space  1<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>li $3, 52<\/code> \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <code>52<\/code>, \u0447\u0442\u043e \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0430\u0432\u043d\u044f\u0435\u0442\u0441\u044f <code>0x34<\/code> (\u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0435 <code>0b0011'0100<\/code>). \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e MSB-first \u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043b \u0431\u0438\u0442\u044b \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e: \u043f\u043e\u043b\u0435 <code>version<\/code> \u0443\u0448\u043b\u043e \u0432 \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u0431\u0438\u0442\u044b 7\u20135, type \u0437\u0430\u043d\u044f\u043b\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 4\u20133, \u0430 <code>id<\/code> \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u043b\u043e\u0441\u044c \u0432 \u043c\u043b\u0430\u0434\u0448\u0438\u0435 \u0431\u0438\u0442\u044b 2\u20130. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/85\/1b\/d7\/851bd7772206e778a52e324687b42308.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/85\/1b\/d7\/851bd7772206e778a52e324687b42308.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/85\/1b\/d7\/851bd7772206e778a52e324687b42308.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 Bit-endianness \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u044f\u043c\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u044b\u0440\u044b\u0445 \u0431\u0430\u0439\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0440\u0443\u0448\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043f\u043e\u0434\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u043c\u0443 \u0444\u0430\u043a\u0442\u043e\u0440\u0443: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0440\u043e\u043b\u0438 ABI.<\/p>\n<h4>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c: \u0430\u043d\u0430\u0442\u043e\u043c\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 MSVC \u043f\u0440\u043e\u0442\u0438\u0432 GCC\/Clang<\/h4>\n<p>\u041f\u0440\u0438\u043d\u044f\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 C++ \u0441\u0442\u0440\u043e\u0433\u043e \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u043c\u0435\u0435\u0442 \u0432\u0430\u0436\u043d\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b: \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0435 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u043e\u0434 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 x86-64 \u043d\u0430 Windows \u0438 \u043d\u0430 Linux, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c. \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0443\u043a\u043b\u0430\u0434\u043a\u0430 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c ABI. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0438\u043a\u0442\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u0442\u044c \u0438 \u043d\u0430\u0440\u0435\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 ABI, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/refspecs.linuxbase.org\/elf\/gabi41.pdf\">System V ABI<\/a> (\u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 Itanium C++ ABI) \u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 GCC \u0438 Clang \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 Linux, macOS, FreeBSD. \u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 Intel Itanium, \u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u043b\u044f GCC\/Clang \u043d\u0430 \u043b\u044e\u0431\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f <a href=\"https:\/\/www.sco.com\/developers\/devspecs\/abi386-4.pdf\">x86<\/a>, <a href=\"https:\/\/refspecs.linuxbase.org\/elf\/x86_64-abi-0.99.pdf\">x64<\/a>, <a href=\"https:\/\/github.com\/ARM-software\/abi-aa\/blob\/main\/sysvabi64\/sysvabi64.rst\">ARM64<\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.riscv.org\/reference\/abi\/v1.0\/index.html\">RISC-V ABI<\/a> \u2014 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b RISC-V. \u042d\u0442\u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 System V ABI, \u043e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0441 \u043d\u0438\u043c \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0445\u043e\u0436\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0438 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f, \u0441\u0442\u0440\u0435\u043c\u044f\u0441\u044c \u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043b\u043e\u0442\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/build\/x64-software-conventions?view=msvc-170\">Microsoft x64 ABI<\/a> \u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435 MSVC \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Windows \u0441 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 x86-64.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/build\/arm64-windows-abi-conventions?view=msvc-170\">Microsoft ARM64 ABI<\/a> \u2014 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 Windows \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 ARM64. \u041e\u043d \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 x64. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0437\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435, \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043e \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u044f \u0441\u0442\u0435\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443.<\/p>\n<p><strong>\u041f\u0440\u0430\u0432\u0438\u043b\u043e. \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u043f\u043e\u0434\u0440\u044f\u0434. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u0447\u0438\u043d \u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u201c\u0440\u0430\u0437\u0434\u0443\u0432\u0430\u043d\u0438\u044f\u201d \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0440\u0430\u0437\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043f\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442. \u041f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Compiler Explorer \u0438 \u0438\u0437\u043c\u0435\u0440\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>sizeof<\/code>. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443;<\/p>\n<pre><code class=\"cpp\">struct PackagingConflict{  uint8_t  mode : 4;   uint32_t type : 4; };<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;iostream&gt;#include &lt;cstdint&gt;struct PackagingConflict {    uint8_t  mode : 4;     uint32_t type : 4; };int main() {    std::cout &lt;&lt; \"--- BITFIELD PACKING SIZES ---\" &lt;&lt; std::endl;    std::cout &lt;&lt; \"1. PackagingConflict size: \" &lt;&lt; sizeof(PackagingConflict)              &lt;&lt; \" byte(s)\" &lt;&lt; std::endl;        return 0;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 <a href=\"https:\/\/godbolt.org\/z\/nY8WMGGT7\">Clang<\/a> \u0438 <a href=\"https:\/\/godbolt.org\/z\/qrjj17vcE\">MSVC<\/a>:<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b Clang<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">--- BITFIELD PACKING SIZES ---1. PackagingConflict size: 4 byte(s)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b MSVC<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">--- BITFIELD PACKING SIZES ---1. PackagingConflict size: 8 byte(s)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/extt\/6b\/1e\/03\/6b1e03b3b6b6c46e7e9aaaf20294c0d6.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/extt\/6b\/1e\/03\/6b1e03b3b6b6c46e7e9aaaf20294c0d6.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/extt\/6b\/1e\/03\/6b1e03b3b6b6c46e7e9aaaf20294c0d6.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439: Clang \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043b \u0435\u0451 \u0432 4 \u0431\u0430\u0439\u0442\u0430, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a MSVC \u0440\u0430\u0437\u0434\u0443\u043b \u0434\u043e 8 \u0431\u0430\u0439\u0442. \u0422\u0430\u043a \u043a\u0430\u043a \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u043e\u043b\u0435\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f (<code>uint8_t<\/code> \u0438 <code>uint32_t<\/code>), \u043e\u0431\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u044e\u0442 \u0438\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0432\u044b\u0434\u0435\u043b\u044f\u044f \u043f\u043e\u0434 <code>mode<\/code> 1 \u0431\u0430\u0439\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f 3 \u043f\u0443\u0441\u0442\u044b\u0445 \u0431\u0430\u0439\u0442\u0430 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0435 <code>type<\/code> \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441\u043e \u0441\u0442\u0440\u043e\u0433\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u0439 4-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u043b\u044c\u0448\u0435 Clang \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e Itanium ABI \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0440\u0435\u0437\u0430\u0435\u0442 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0440\u0430\u0434\u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043c\u0435\u0441\u0442\u0430. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, MSVC \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0443 Microsoft ABI, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043e\u0431\u044f\u0437\u0430\u043d \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u0435\u043d \u0435\u0451 \u0441\u0430\u043c\u043e\u043c\u0443 \u0442\u044f\u0436\u0451\u043b\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 (<code>uint32_t<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c 4 \u0431\u0430\u0439\u0442\u0430), \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u043f\u043e\u0434 \u043e\u0431\u0430 \u0431\u043b\u043e\u043a\u0430, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u0434\u0432\u043e\u0435.<\/p>\n<p>\u0412\u0441\u044f \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c ABI \u0447\u0451\u0442\u043a\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u0441\u0442\u0438\u0440\u0430\u044e\u0442\u0441\u044f. \u0421\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0438 \u0438 \u0440\u0430\u0437\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u043a \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u043d\u044f\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043d\u0435\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u044b \u0438\u043b\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c 4-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 Clang, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u0430 \u043f\u043e 8-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 MSVC, \u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0445 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h4>\u0411\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u0445\u0440\u0443\u043f\u043a\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442<\/h4>\n<p>\u0418\u0437-\u0437\u0430 \u0445\u0430\u043e\u0441\u0430 \u0441 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0431\u0438\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e. \u0412 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 C++ \u043e\u043d\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a: \u0432\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0442\u0434\u0430\u0451\u0442\u0435 \u0432\u043e\u043b\u0435 \u0441\u043b\u0443\u0447\u0430\u044f.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0440\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0433\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c:<\/p>\n<p><strong>1. \u0421\u0435\u0442\u0435\u0432\u043e\u0439 \u043e\u0431\u043c\u0435\u043d (Network I\/O).<\/strong> \u041f\u0440\u044f\u043c\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043a\u0435\u0442 \u0432\u0438\u0434\u0430 <code>send(sock, &amp;packet, sizeof(packet), 0)<\/code> \u2014 \u043c\u0438\u043d\u0430 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Linux (Clang), \u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 Windows (MSVC), \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 ABI \u0441\u043c\u0435\u0441\u0442\u044f\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0431\u0438\u0442\u043e\u0432, \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0444\u043b\u0430\u0433\u043e\u0432 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u0430\u0448\u0443.<\/p>\n<p><strong>2. \u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434 (\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f).<\/strong> \u041f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0432 \u0444\u0430\u0439\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 <code>fwrite<\/code>, \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 ABI. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 ISO C (\u0440\u0430\u0437\u0434\u0435\u043b <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/docs\/n2310.pdf#page=95\">6.7.2.1<\/a>), \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c (implementation-defined behavior). \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u0444\u0430\u0439\u043b \u043d\u0430 Linux, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 Windows, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u043c\u0443\u0441\u043e\u0440 \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 Microsoft ABI \u0438 System V ABI.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 C++, C++ 23 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (object lifetime) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/en.cppreference.com\/cpp\/memory\/start_lifetime_as\"><code>std::start_lifetime_as<\/code><\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0430 \u043b\u0438\u0448\u044c \u043b\u0435\u0433\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0437 \u0441\u044b\u0440\u044b\u0445 \u0431\u0430\u0439\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u043c\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (<code>interminate values<\/code>), \u0447\u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u043a undefined behavior.<\/p>\n<p><strong>3. \u0414\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0438 \u0436\u0435\u043b\u0435\u0437\u043e (Hardware MMIO).<\/strong> \u0420\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u0430 \u0431\u0438\u0442\u043e\u0432 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0443\u0440\u043e\u0439 \u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0412 \u044f\u0437\u044b\u043a\u0435 C \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u0438\u0445 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0448\u0438\u0440\u0438\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0451\u0442 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438. \u041f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043b\u0438 \u0444\u043b\u0430\u0433\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043b\u044f \u043c\u043e\u0433\u0443\u0442 \u0441\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0441\u044f, \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u043d\u0435 \u0432 \u0442\u0435 \u0431\u0438\u0442\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0433\u0434\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0430 (\u0441\u0435\u0442\u044c, \u0444\u0430\u0439\u043b\u044b, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0436\u0435\u043b\u0435\u0437\u0430), \u043e\u0442 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 (<code>uint8_t<\/code>, <code>uint16_t<\/code>, <code>uint32_t<\/code>) \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u044f\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u0441\u0434\u0432\u0438\u0433\u0430\u043c\u0438 (<code>&lt;&lt;, &gt;&gt;<\/code>) \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0430\u0441\u043a\u0430\u043c\u0438 (<code>&amp;, |<\/code>).<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 ABI \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0431\u0435\u0437 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u043d\u0430 Linux \u0447\u0435\u0440\u0435\u0437 GCC \u0438\u043b\u0438 Clang, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0443\u044e Windows-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 MSVC \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0443\u0441\u0442\u044b\u0435 \u0431\u0438\u0442\u044b (padding) \u0432 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<h3>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f: \u0433\u0434\u0435 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e<\/h3>\n<p>\u0412 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0421++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0435 \u0440\u0430\u0434\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0439 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u0433\u0434\u0435 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u0443.<\/p>\n<p><strong>1. \u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/strong> \u041f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u043e\u0432, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e (\u0444\u043b\u0430\u0433\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, ID \u0442\u0438\u043f\u043e\u0432, \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u0441\u044b\u043b\u043e\u043a) \u0434\u043b\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0435\u043b\u043a\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u043b\u0430\u0433 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0438\u0437-\u0437\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435. \u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u201c\u0441\u043f\u0440\u0435\u0441\u0441\u043e\u0432\u0430\u0442\u044c\u201d \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442, \u0441\u0432\u043e\u0434\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443.<\/p>\n<p><strong>2. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u044d\u0448\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (Cache Lines).<\/strong> \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u043f\u043e\u0448\u0442\u0443\u0447\u043d\u043e, \u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u2014 \u043a\u044d\u0448-\u043b\u0438\u043d\u0438\u044f\u043c\u0438 (\u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e 64 \u0431\u0430\u0439\u0442\u0430). \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0440\u0430\u0437\u0434\u0443\u0442\u0430, \u0432 \u043e\u0434\u043d\u0443 \u043a\u044d\u0448-\u043b\u0438\u043d\u0438\u044e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u043c\u0430\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0442\u044c \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 RAM (\u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 cache miss). \u041f\u043b\u043e\u0442\u043d\u0430\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u044d\u0448 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438 \u0438\u0445 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u0431\u0445\u043e\u0434\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0440\u0430\u0437\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043a\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438 CPU.<\/p>\n<h3>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0431\u0438\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u044f\u043c<\/h3>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u0432\u0437\u044f\u0442\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0438\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0443 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0431\u0438\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u044f\u043c. \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++ \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n<h4>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u0440\u0443\u0447\u043d\u044b\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043c\u0430\u0441\u043a\u0438 \u0438 \u0441\u0434\u0432\u0438\u0433\u0438<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0442\u0430, \u0442\u043e \u043b\u0443\u0447\u0448\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0451\u043b \u0438\u0437 \u044f\u0437\u044b\u043a\u0430 C. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043d\u0430\u0440\u0435\u0437\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0431\u0435\u0440\u0451\u0442 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0442\u0430\u043c\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 (<code>&amp;, |, ~, ^, &lt;&lt;, &gt;&gt;<\/code>).<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">class DeviceConfig{public:  void set_mode(uint8_t mode)  {    data = (data &amp; ~MODE_MASK) | ((mode &lt;&lt; 1) &amp; MODE_MASK);  }  uint8_t get_mode() const  {    return (data &amp; MODE_MASK) &gt;&gt; 1;  }private:  static constexpr uint8_t ENABLE_CLOCK_MASK = 0x01;  static constexpr uint8_t MODE_MASK         = 0x0E;  static constexpr uint8_t INTERRUPT_MASK    = 0xF0;private:  uint8_t data = 0;};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0414\u0430, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u043e \u0435\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 ABI. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043e \u0447\u0451\u043c \u0432\u0441\u0435 \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u044d\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u0430\u0439\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (Byte Endiannes), \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 Big Endian \u043c\u043d\u043e\u0433\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e Little Endian.<\/p>\n<h4>\u0414\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438: \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 std::bitset<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u043e\u043c\u0435\u0440 \u043e\u0434\u0438\u043d, \u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/bitset\"><code>std::bitset<\/code><\/a>.<\/p>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0438\u0442, \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u041e\u043d \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u044e \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <a href=\"https:\/\/godbolt.org\/z\/vh47czvWT\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>:<\/p>\n<pre><code class=\"cpp\">#include &lt;bitset&gt;#include &lt;iostream&gt;enum Permission{  Read = 0,  Write = 1,  Execute = 2,  Admin = 3,  MaxPermissions };void ManagePermissions(){  std::bitset&lt;MaxPermissions&gt; user_rights;  user_rights.set(Permission::Read);      user_rights.set(Permission::Write);     user_rights.flip(Permission::Execute);     if (user_rights.test(Permission::Write))  {    std::cout &lt;&lt; \"The user can write files.\\n\";  }  std::cout &lt;&lt; \"Current rights mask: \" &lt;&lt; user_rights &lt;&lt; \"\\n\";}int main(){  ManagePermissions();}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u043b\u044e\u0441 <code>std::bitset<\/code> \u2014 \u044d\u0442\u043e \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442  \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0447\u043b\u0435\u043d <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/bitset#lib:set_(member),bitset_\"><code>std::bitset&lt;N&gt;::set<\/code><\/a>, <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/bitset#lib:reset,bitset_\"><code>std::bitset&lt;N&gt;::reset<\/code><\/a>, <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/bitset#lib:flip,bitset_\"><code>std::bitset&lt;N&gt;::flip<\/code><\/a> \u0438\u043b\u0438 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/bitset#lib:test,bitset\"><code>std::bitset&lt;n&gt;::test<\/code><\/a> \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 15 \u043f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0441\u0435\u0442\u043a\u0438 \u0432 4 \u0431\u0438\u0442\u0430), \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0431\u0440\u043e\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>std::out_of_range<\/code>. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0441\u043e\u043a \u0442\u0430\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u043b\u0430 \u0431\u044b \u043a \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u043c\u0443 \u0447\u0442\u0435\u043d\u0438\u044e \u0447\u0443\u0436\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 \u043f\u043e\u0440\u0447\u0435 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441: <code>std::bitset<\/code> \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0443\u0440\u043e\u0432\u043d\u0435 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<h4>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u0444\u043b\u0430\u0433\u043e\u0432: \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f std::vector<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u043b\u0430\u0433\u043e\u0432, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>bool<\/code> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0442\u0435\u0440\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0446\u0435\u043b\u044b\u0439 \u0431\u0430\u0439\u0442. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u2014 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n5050\/vector.bool\"><code>std::vector&lt;bool&gt;<\/code><\/a>.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u043d \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 <code>bool<\/code> \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (\u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430), \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0436\u0438\u043c\u0430\u044f \u043f\u043e 32 \u0438\u043b\u0438 64 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u0438\u043d \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">#include &lt;vector&gt;std::vector&lt;bool&gt; feature_flags(10000, false);void process_features(){  feature_flags[42] = true;   if (feature_flags[42])  {    \/\/ code  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e, <code>std::vector&lt;bool&gt;<\/code> \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u043f\u043e\u0440\u043d\u044b\u0445 \u0444\u0438\u0447 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435 C++, \u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0418\u0437-\u0437\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 <code>bool<\/code> \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043a\u043e\u0434 <code>bool *ptr = &amp;feature_flags[0];<\/code> \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f) \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\/\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>[]<\/code> \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u0441\u0441\u044b\u043b\u043a\u0443, \u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438-\u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438. \u042d\u0442\u043e \u2014 \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u0441\u0436\u0430\u0442\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0427\u0442\u043e \u0436, \u043d\u0430 \u044d\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0451. \u0427\u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c? \u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0432 C++ \u2014 \u044d\u0442\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043e\u043f\u043b\u043e\u0449\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438 \u044f\u0437\u044b\u043a\u0430. \u0412\u0430\u043c \u0434\u0430\u044e\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u0443 \u043e\u0442\u0440\u0435\u0437\u0430\u0442\u044c \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0431\u0438\u0442, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043e\u0434\u0438\u043d \u043d\u0430 \u043e\u0434\u0438\u043d \u0441\u043e \u0441\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u043c\u0438\u043d\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 ABI. \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b\u0438 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0438 \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u044d\u0442\u0430 \u044e\u0432\u0435\u043b\u0438\u0440\u043d\u0430\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u0445\u0430\u043e\u0441\u043e\u043c, \u0438\u043b\u043b\u044e\u0437\u0438\u0439 \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c. \u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0449\u043d\u044b\u043c \u043e\u0440\u0443\u0436\u0438\u0435\u043c \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u044d\u0448-\u043b\u0438\u043d\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c, \u0442\u0430\u043a \u0438 \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u043c\u0438\u043d\u043e\u0439 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0436\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u043e \u0441\u0435\u0442\u0438. \u0412\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u044b, \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0438\u0433\u0440\u044b \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u0430 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0432\u043b\u0430\u0441\u0442\u044c\u044e \u043d\u0430\u0434 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u2014 \u0432\u044b\u0431\u043e\u0440 \u0437\u0430 \u0432\u0430\u043c\u0438.<\/p>\n<blockquote>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1423\"><strong>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u043d\u0430 \u043c\u0435\u0441\u044f\u0446<\/strong><\/a><\/p>\n<\/blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Elizaveta Zhegalova. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1423\/\">Pitfalls of bit fields in C++<\/a>.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1101790\/\">https:\/\/habr.com\/ru\/articles\/1101790\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e C++ \u2014 \u044f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u043b\u0447\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043a\u0430\u043a \u0432\u044b \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c. \u041e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043c\u044b\u0441\u043b\u0438\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c\u0438 \u0431\u0430\u0439\u0442\u043e\u0432, \u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430 \u0442\u0438\u043f\u043e\u0432 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0440\u0430\u0441\u0442\u043e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439? \u041a\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0441\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f. \u0417\u0430\u0447\u0435\u043c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u201c\u0434\u0430\/\u043d\u0435\u0442\u201d \u0446\u0435\u043b\u044b\u0439 \u0432\u043e\u0441\u044c\u043c\u0438\u0431\u0438\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u044e\u0432\u0435\u043b\u0438\u0440\u043d\u043e \u043e\u0442\u0440\u0435\u0437\u0430\u0442\u044c \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0431\u0438\u0442? \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u2014 \u0438 \u0442\u044b \u043f\u043e\u0432\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043d\u0430 \u043e\u0434\u0438\u043d \u0441 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043c\u0435\u0441\u0442\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 C++ \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c, \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f.\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u041a\u0430\u043a \u044f \u0434\u043e\u043a\u0430\u0442\u0438\u043b\u0430\u0441\u044c \u0434\u043e \u0436\u0438\u0437\u043d\u0438 \u0442\u0430\u043a\u043e\u0439 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443?\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b MISRA C++ 2023. \u0414\u0430-\u0434\u0430, PVS-Studio \u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0430\u0448\u0438 \u043a\u043e\u0434\u043e\u0432\u044b\u0435 \u0431\u0430\u0437\u044b \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443. \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b, \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0412 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e: \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0443\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f enum \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0431\u0438\u0442.\u0417\u043d\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u043e\u0431\u043c\u0430\u043d\u0447\u0438\u0432\u043e\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u043e, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u043f\u0430\u0440\u0443 \u0447\u0430\u0441\u043e\u0432, \u0430 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0441 \u0432 \u043f\u0443\u0447\u0438\u043d\u0443 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u043d\u0430 \u043d\u0435\u0434\u0435\u043b\u044e? \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0441\u043e \u043c\u043d\u043e\u0439. \u042f \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u043b\u0430 \u043d\u0430\u0434 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430.\u041f\u044b\u0442\u0430\u044f\u0441\u044c \u0440\u0430\u0441\u043f\u0443\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0443\u0431\u043e\u043a, \u044f \u043f\u043e\u043d\u044f\u043b\u0430 \u043e\u0434\u043d\u0443 \u0432\u0435\u0449\u044c: \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0432 C++ \u2014 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0451\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c.\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0433\u043b\u0430\u0432\u043d\u043e\u043c: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f?\u0411\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 C++ \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0439 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0431\u0430\u0439\u0442\u0430\u043c\u0438, \u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442, \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u0441\u0430\u043c\u0438 \u0440\u0435\u0448\u0430\u0435\u0442\u0435, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e. \u042d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u043e \u043f\u0440\u0438 \u0436\u0451\u0441\u0442\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0444\u043b\u0430\u0433\u043e\u0432.\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u043d\u043e \u043e\u0431\u0449\u0430\u044f \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:type-specifier declarator : constant-expression ;\u0413\u0434\u0435 constant-expression \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442\u043e\u0432, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435.\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435: \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u043c C++ \u043a\u043e\u0434\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 CHAR_BIT \u0431\u0438\u0442. \u041c\u0430\u043a\u0440\u043e\u0441 CHAR_BIT \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, \u043d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f 8. \u0414\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0435\u0451 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u201c\u0440\u0435\u0437\u0430\u0442\u044c\u201d \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u043a\u043e\u043f\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.\u0422\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043f\u0430\u043c\u044f\u0442\u044c. \u041a\u0430\u043a? \u0417\u0430 \u0441\u0447\u0451\u0442 \u043b\u0438\u043a\u0432\u0438\u0434\u0430\u0446\u0438\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u201c\u043f\u0443\u0441\u0442\u044b\u0445\u201d \u0438\u043b\u0438 \u201c\u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445\u201d \u0431\u0438\u0442\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0432\u043e\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0432\u0435\u0440\u0445 \u0434\u043e \u0446\u0435\u043b\u044b\u0445 \u0431\u0430\u0439\u0442\u043e\u0432. \u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u044f\u0442 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0432 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u044f\u0442 \u043c\u0435\u0441\u0442\u043e, \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:\u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 (\u0432\u043a\u043b\u044e\u0447\u0451\u043d\/\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d) \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 1 \u0431\u0438\u0442\u0430 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0438\u043b\u0438 1);\u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b (4 \u0440\u0435\u0436\u0438\u043c\u0430) \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 2 \u0431\u0438\u0442\u0430 (\u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 00, 01, 10, 11);\u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 (\u043e\u0442 0 \u0434\u043e 7) \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 3 \u0431\u0438\u0442\u043e\u0432 (\u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u043e\u0442 000 \u0434\u043e 111).\u0418\u0442\u043e\u0433\u043e \u0432\u0441\u044f \u0432\u0430\u0436\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e 6 \u0431\u0438\u0442.\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1. \u041e\u0431\u044b\u0447\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C++, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0435\u043b\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440:struct StandardStruct {  bool is_active;     char mode;          char error_code; };\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434\u041f\u0440\u0438\u043c\u0435\u0440#include &lt;iostream&gt;struct StandardStruct {  bool is_active;     char mode;          char error_code; }; int main(){  StandardStruct stStruct;  std::cout &lt;&lt; &#171;Sizeof stStruct: &#187; &lt;&lt; sizeof(stStruct)            &lt;&lt; &#171;byte(s)&#187; &lt;&lt; std::endl;}\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044bSizeof stStruct: 3 byte(s)\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u043d\u044f\u043b\u0430 24 \u0431\u0438\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0448\u0435\u0441\u0442\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e 24 \u044f\u0447\u0435\u0439\u043a\u0438, \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 18 \u044f\u0447\u0435\u0435\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430.\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u044f. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0435\u0442 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043e\u0434\u0438\u043d \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 unsigned char \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1 \u0431\u0430\u0439\u0442 (8 \u0431\u0438\u0442), \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043b\u043e\u0442\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u044c \u043d\u0435\u0433\u043e:struct BitFieldStruct{  unsigned char is_active  : 1;   unsigned char mode       : 2;   unsigned char error_code : 3; };\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434\u041f\u0440\u0438\u043c\u0435\u0440#include &lt;iostream&gt;struct BitFieldStruct{  unsigned char is_active  : 1;   unsigned char mode       : 2;   unsigned char error_code : 3; };int main(){  BitFieldStruct stStruct;  std::cout &lt;&lt; &#171;Sizeof stStruct: &#187; &lt;&lt; sizeof(stStruct)            &lt;&lt; &#187; byte(s)&#187; &lt;&lt; std::endl;}\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044bSizeof stStruct: 1 byte(s)\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0432\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0434\u043e 1 \u0431\u0430\u0439\u0442\u0430. \u0412 \u043f\u0430\u043c\u044f\u0442\u0438 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 8 \u0431\u0438\u0442, \u043f\u043e\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u0441\u0435\u043a\u0442\u043e\u0440\u0430:\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0435\u0440\u0451\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443: \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 mode \u043e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u0441\u0434\u0432\u0438\u0433\u0438 \u0438 \u043c\u0430\u0441\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 2 \u0431\u0438\u0442\u0430 \u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438\u043b\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c (\u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432) \u0442\u0430\u043a\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u0430\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u041c\u044b \u0443\u0436\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043c\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u044f\u0437\u044b\u043a.\u0411\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0441\u0440\u0435\u0434\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b const \u0438\/\u0438\u043b\u0438 volatile \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\/\u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c.\u0422\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438\u0412\u0442\u043e\u0440\u043e\u0435, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u2014 \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u0430\u043c (integral types) \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c (enumerations). \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043f\u043e \u0431\u0438\u0442\u0430\u043c \u0442\u0438\u043f\u044b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 (float, double) \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b (std::string) \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.\u041f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b:1. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (char, wchar_t, char8_t, char16_t, char32_t, bool, short, int, long, long long).\u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u043e\u043a \u0438 \u0444\u043b\u0430\u0433\u043e\u0432. \u0414\u043e C++ 14 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 int \u0431\u044b\u043b\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b signed \u0438\u043b\u0438 unsigned, \u0438\u043d\u0430\u0447\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u043d\u043e\u0431\u0438\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 int \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e unsigned \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0438 -1 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 0 \u0438 1. \u0414\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e bool \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u043e\u0432\u043d\u043e 1 \u0431\u0438\u0442.2. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (enum \u0438 enum class).\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 enum \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c 2 \u0431\u0438\u0442\u0430._3. std::byte _(C++20).\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 C++ 20, \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u043b std::byte. \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u044b\u0440\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 std::byte \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438\u0422\u0440\u0435\u0442\u044c\u0435, \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0432 C++ \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435:\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439;\u0432\u0437\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f;\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435;\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435.\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0436\u0438\u0432\u0451\u0442 \u043f\u043e \u0442\u0430\u043a\u0438\u043c \u0437\u0430\u043a\u043e\u043d\u0430\u043c \u0438 \u043a \u0447\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0438\u0445 \u043e\u0431\u043e\u0439\u0442\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:struct HardwareFlags{  unsigned int mode   : 3;  unsigned int status : 1;};\u0422\u0430\u0431\u0443 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044e \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u043f\u0440\u0435\u0442\u0430 \u043d\u0430 \u0432\u0437\u044f\u0442\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043b\u0435\u0436\u0438\u0442 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b: \u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043d\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443, \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 (CHAR_BIT \u0431\u0438\u0442). \u0423 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 3-\u0439 \u0431\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0439\u0442\u0430.\u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0432\u0437\u044f\u0442\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430 &amp; \u043a \u0431\u0438\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044e:HardwareFlags flags;auto address = &amp;flags.mode;int* ptr = &amp;flags.mode;     \/\/ doesn&#8217;t compile\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u0442 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.\u041d\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430, \u043d\u0435\u0442 \u0438 \u0441\u0441\u044b\u043b\u043e\u043a\u0418\u0437 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0437\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 &amp; \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435. \u0421\u0441\u044b\u043b\u043a\u0430 \u0432 \u044f\u0437\u044b\u043a\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044e, \u0430 \u0440\u0430\u0437 \u043d\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430, \u0442\u043e \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0435\u0451 \u043d\u0435 \u043a \u0447\u0435\u043c\u0443:HardwareFlags flags;void checkMode(const unsigned int&amp; m);unsigned int&amp; ref = flags.mode;        \/\/ doesn&#8217;t compilecheckMode(flags.mode);                 \/\/ doesn&#8217;t compile\u041c\u0430\u0441\u0441\u0438\u0432\u044b: \u043f\u043e\u0447\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0431\u0435\u0441\u0441\u0438\u043b\u044c\u043d\u0430\u041e\u0433\u043e\u0440\u0447\u0443 \u0432\u0430\u0441: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0435. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043b\u0435\u0436\u0430\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. \u041f\u0440\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 i-\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 arr[i] \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 \u0430\u0434\u0440\u0435\u0441\u043d\u0443\u044e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.struct BrokenStruct{  unsigned int items[5] : 2; \/\/ doesn&#8217;t compile};\u0410\u043d\u0430\u0442\u043e\u043c\u0438\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u043d\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-501063","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/501063","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=501063"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/501063\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=501063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=501063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=501063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}