{"id":321025,"date":"2021-04-07T09:00:39","date_gmt":"2021-04-07T09:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321025"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321025","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 firmware \u043d\u0430 \u0421++ \u0441\u043b\u043e\u0432\u043d\u043e \u0438\u0433\u0440\u0430 \u0432 \u0431\u0438\u0441\u0435\u0440. \u041a\u0430\u043a \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0436\u0438\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>C++ is a horrible language. It&#8217;s made more horrible by the fact that a lot&nbsp;of substandard programmers use it, to the point where it&#8217;s much much&nbsp;easier to generate total and utter crap with it.<\/p>\n<p><em>Linus Benedict Torvalds<\/em><\/p>\n<\/blockquote>\n<p>\u0421\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u043b\u043e \u0443\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441. \u041c\u044b \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0442\u044f\u0433\u0443\u0447\u0435\u0435 \u0438 \u0432\u044f\u0437\u043a\u043e\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0439 \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u044b, \u0438 \u0444\u043e\u043a\u0443\u0441 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u0437 \u043d\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u043c\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u0430\u043c\u044b\u0439 \u0431\u043e\u0439\u043a\u0438\u0439 \u0438\u0437 \u0442\u0440\u0435\u0445 \u043c\u043e\u0438\u0445 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u043d\u0438\u0435\u043c \u0434\u0435\u043b\u0430 \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043f\u0440\u0438\u043d\u044f\u043b\u0441\u044f \u0437\u0430 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0413\u043e\u0432\u043e\u0440\u0438\u043b \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u2013 \u044f\u0432\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u0443\u0436\u0435 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437. \u041f\u043e \u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u043c, \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u0435\u043b\u0430\u0441\u044c \u043d\u0430\u0434 \u043d\u0435\u043a\u0438\u043c \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043c\u0430\u043b\u044b\u043c, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 STM32L4. \u041f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0432\u0435\u0434\u0435\u043d\u043e \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443&#8230; USART&#8230; SPI&#8230; \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e, \u0443\u0436\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u044b\u0448\u0430\u043b \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0431\u0430\u044e\u043a\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0444\u0440\u0430\u0437 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043f\u043e\u0434\u0430\u043b\u0441\u044f \u0447\u0443\u0442\u044c \u0432\u043f\u0435\u0440\u0435\u0434 \u0438, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0432 \u043c\u043e\u0439 \u0441\u043e\u043d\u043d\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0431\u0435\u0437 \u0433\u043e\u0440\u0434\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u043d\u0435\u0441:<\/p>\n<p>\u2014 \u0410 firmware \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043d\u0430 C++! \u2013 \u043c\u043e\u0439 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0437\u0430\u0443\u043b\u044b\u0431\u0430\u043b\u0441\u044f \u0438 \u043e\u0442\u043a\u0438\u043d\u0443\u043b\u0441\u044f \u0432 \u043a\u0440\u0435\u0441\u043b\u0435, \u043e\u0436\u0438\u0434\u0430\u044f \u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0441\u0432\u043e\u044e \u043f\u0440\u043e\u0432\u043e\u043a\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u044d\u0441\u043a\u0430\u043f\u0430\u0434\u0443. <\/p>\n<p>\u042f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u0447\u0443\u0434\u043b\u0438\u0432\u043e \u0438\u0437\u043e\u0433\u043d\u0443\u0442\u044c \u0431\u0440\u043e\u0432\u044c, \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044f \u043c\u043e\u0435 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435, \u043d\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f. \u0421\u043a\u0440\u043e\u043c\u043d\u043e \u0441\u0438\u0434\u0435\u0432\u0448\u0438\u0439 \u0441\u043b\u0435\u0432\u0430 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u0438\u043d\u044f\u043b \u044d\u0442\u043e \u0437\u0430 \u0433\u0440\u0438\u043c\u0430\u0441\u0443 \u0443\u0436\u0430\u0441\u0430 \u0438 \u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>\u2014 \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u044f? \u2013 \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u043d \u0441 \u0438\u0441\u043a\u0440\u0435\u043d\u043d\u0435\u0439 \u043e\u0437\u0430\u0431\u043e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0433\u043e\u043b\u043e\u0441\u0435.<\/p>\n<p>\u041e\u043f\u0430\u0441\u0435\u043d\u0438\u044f \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0432 \u0438\u0437\u0431\u044b\u0442\u043a\u0435. \u042f \u0441 \u043d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u043c\u0438\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u043b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u043d\u0430 MbedOS \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0442. \u041f\u0430\u043c\u044f\u0442\u044c \u0442\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u044f \u0443\u0441\u043f\u0435\u043b \u043c\u043e\u0440\u0433\u043d\u0443\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437. \u042d\u0445, \u043e\u043f\u044b\u0442, \u0441\u044b\u043d \u043e\u0448\u0438\u0431\u043e\u043a&#8230; \u041d\u0430\u0434\u043e \u0432\u0441\u0435 \u0436\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0435 \u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043d\u0430 \u00ab\u043f\u043b\u044e\u0441\u0430\u0445\u00bb \u043d\u0438\u043a\u0442\u043e \u0438 \u043d\u0435 \u0437\u0430\u0438\u043a\u0430\u043b\u0441\u044f, \u0434\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0448\u043b\u0438. \u0412\u0441\u0435 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 \u0432\u043e\u0437\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u044b\u043f\u0430\u043b\u0438\u0441\u044c \u0432 \u0442\u0440\u0443\u0445\u0443 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u0432 \u043c\u0438\u0444\u044b. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b&#8230;<\/p>\n<p>\u2014&nbsp; \u041d\u0443, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435\u2026 \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e, \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u043e\u043b\u0435\u0440\u0430\u043d\u0442\u043d\u044b\u0439\u2026 \u2013 \u044f \u0437\u0430\u043c\u044f\u043b\u0441\u044f, \u043d\u0435 \u0436\u0435\u043b\u0430\u044f \u043d\u0438\u043a\u043e\u0433\u043e \u043e\u0431\u0438\u0436\u0430\u0442\u044c. &#8212; \u041d\u043e \u043d\u0430 \u043f\u043b\u044e\u0441\u0430\u0445 \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u044d\u0442\u0430\u043a\u043e\u0435, \u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0432 \u043e\u0434\u0438\u043d \u043c\u0438\u0433 \u043e\u043f\u0443\u0445\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0439 \u043c\u043e\u0437\u0433 \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0413\u0435\u0440\u043c\u0430\u043d\u0430 \u0413\u0435\u0441\u0441\u0435.<\/p>\n<p>\u2014&nbsp; \u0414\u0430, \u0442\u0430\u043a\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0435\u0441\u0442\u044c, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d, \u2013 \u043f\u0440\u043e\u0431\u0430\u0441\u0438\u043b \u043c\u043e\u043b\u0447\u0430\u0432\u0448\u0438\u0439 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e \u043f\u043e\u0434\u043d\u044f\u043b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043b\u0435\u0446, \u0430\u043a\u0446\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0444\u0430\u043a\u0442\u0435.<\/p>\n<p>\u2014 \u0418 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u0434 \u0440\u0435\u0432\u044c\u044e! \u2013 \u0432\u0441\u0442\u0440\u0435\u043f\u0435\u043d\u0443\u0432\u0448\u0438\u0441\u044c, \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u043c \u0434\u0432\u043e\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0447\u043b\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>\u0414\u0430, \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u043b\u0441\u044f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041d\u043e \u043a\u0442\u043e \u0431\u044b \u0441\u043c\u0435\u043b \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0438\u0434\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u044c \u0432\u0435\u0441\u043e\u043c\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438?<\/p>\n<h2>IAR<\/h2>\n<p>\u0422\u0430\u043a \u0443\u0436 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043c\u044b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. &#171;\u041d\u0443, \u044d\u0442\u043e \u0436\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f \u0436\u0435\u043b\u0435\u0437\u043e\u043a&#187;, \u2013 \u043d\u0430\u0438\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u043b \u044f, \u2013 &#171;\u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c\u0441\u044f&#187;. \u041d\u0435 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u0436\u0435\u0441\u0442\u043e\u043a\u043e \u043e\u0448\u0438\u0431\u0441\u044f \u0438 \u043f\u0440\u043e\u043a\u043b\u044f\u043b \u0442\u043e\u0442 \u0434\u0435\u043d\u044c, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043a\u043e\u043c\u0444\u043e\u0440\u0442. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0421++17. \u042f \u0443\u0436\u0435 \u043f\u043e\u0442\u0438\u0440\u0430\u043b \u043f\u043e\u0442\u043d\u044b\u0435 \u043b\u0430\u0434\u043e\u0448\u043a\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044f, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0443 \u0432\u043e\u043d \u0442\u043e \u0438 \u0432\u043e\u0442 \u044d\u0442\u043e, \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043d\u043e IAR \u043c\u043e\u0436\u0435\u0442 \u043e\u0445\u043b\u0430\u0434\u0438\u0442\u044c \u043f\u044b\u043b \u043d\u0435 \u0445\u0443\u0436\u0435, \u0447\u0435\u043c \u0432\u0438\u0434 \u043d\u043e\u0432\u043e\u0432\u043e\u0440\u043e\u043d\u0435\u0436\u0441\u043a\u043e\u0439 \u0410\u043b\u0435\u043d\u0443\u0448\u043a\u0438.<\/p>\n<p> \u041d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0435\u043d\u0438\u044f \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, structured binding declaration \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0443\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0439 \u0443\u043f\u0440\u044f\u043c\u0446\u0430. \u0415\u0449\u0435 IAR \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u0436\u0435\u043d \u0438 \u0445\u0440\u0443\u043f\u043e\u043a, \u043a\u0430\u043a\u0430\u044f-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0434\u043e \u0438\u0441\u0442\u0435\u0440\u0438\u043a\u0438: \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0440\u0443\u0445\u043d\u0435\u0442 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438. \u042d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a, \u043f\u043e \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u043b\u043e\u0441\u044c. \u0422\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u044b \u043e\u0433\u043e\u0440\u0447\u0430\u044e\u0442 \u0434\u0430\u0436\u0435 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0444\u0438\u043d\u0430\u043b\u0430 \u00ab\u0418\u0433\u0440\u044b \u043f\u0440\u0435\u0441\u0442\u043e\u043b\u043e\u0432\u00bb.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435\u043c\u0443 \u0432\u0438\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0414\u0430, \u043d\u043e \u0443 GCC \u0441  \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. <\/p>\n<h2>SIL<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435, \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b SIL. Safety integrity level \u2013 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0436\u0438\u0437\u043d\u0438 \u043b\u044e\u0434\u0435\u0439, \u0442\u043e \u043f\u0440\u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u041e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u2013 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f  \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main. \u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0432 no-OS \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0447\u0440\u0435\u0432\u0430\u0442\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0432\u0440\u043e\u0434\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0442.\u043f.<\/p>\n<p>\u041e\u0434\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 \u043a\u043e\u0434\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0438\u0436\u0435.<\/p>\n<h2>std::exception<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0413\u0435\u0440\u0431\u0430 \u0421\u0430\u0442\u0442\u0435\u0440\u0430, \u0447\u0442\u043e \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 C++ \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0435\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0438 \u043b\u044e\u0431\u0438\u043c, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0431\u0435\u0441\u043f\u043e\u0449\u0430\u0434\u043d\u043e \u0432\u044b\u043f\u0438\u043b\u0435\u043d\u044b. \u041d\u0435\u043c\u0443\u0434\u0440\u0435\u043d\u043e, \u0432\u0435\u0434\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. <\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0421++, \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u044d\u0442\u043e \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0438 \u0442\u0430\u043a. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0442\u0430\u043a\u0443\u044e:<\/p>\n<pre><code class=\"cpp\">__cxa_allocate_exception<\/code><\/pre>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443 \u043d\u0435\u0435 \u0443\u0436\u0435 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043d\u0435\u0445\u043e\u0440\u043e\u0448\u0435\u0435, \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u0443\u0447\u0435. \u0412\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0431\u0443\u0444\u0435\u0440\u043e\u043c. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c, \u0442\u043e \u0432 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 autosar \u0434\u043b\u044f \u0441++14 \u0442\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b. \u0414\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0433\u0440\u0443\u0431\u043e \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432  \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041f\u0440\u043e\u0449\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u043e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u0432\u0441\u0435.&nbsp;\u0427\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u043b\u0430\u0433 \u0433\u043e\u0440\u0434\u043e \u0440\u0435\u0435\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c! \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u0435\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0435 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043f\u043e\u0434 IAR \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0442.<\/p>\n<h2>std::vector<\/h2>\n<p>\u0422\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u041d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u0421\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043d\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c, \u0444\u0430\u043a\u0442.<\/p>\n<p>\u0412\u0441\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0435 \u043d\u0430 <em>std::array<\/em>, \u043d\u043e \u0431\u044b\u043b\u0438 \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0438 \u0431\u044b\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0445\u0438\u0442\u0440\u043e \u0432\u043f\u043b\u0435\u0442\u0435\u043d\u044b \u0432 \u043a\u043e\u0434. \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">template &lt;class T, std::size_t Size&gt; class StaticArray {  using ssize_t = int;  public:  using value_type = T;  template &lt;class U&gt;  struct rebind {    using other = StaticArray&lt;U, Size&gt;;  };  StaticArray() = default;  ~StaticArray() = default;  template &lt;class U, std::size_t S&gt;  StaticArray(const StaticArray&lt;U, S&gt;&amp;);   auto allocate(std::size_t n) -&gt; value_type*;  auto deallocate(value_type* p, std::size_t n) -&gt; void;  auto max_size() const -&gt; std::size_t; };<\/code><\/pre>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, <strong><em>allocate <\/em><\/strong>\u0438 <strong><em>deallocate<\/em><\/strong>. \u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>n <\/strong>\u2013<strong> <\/strong>\u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u043f\u043e\u043f\u0443\u0433\u0430\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong><em>max_size <\/em><\/strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong><em>allocate<\/em><\/strong>. <\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0443\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">std::vector&lt;int, StaticArray&lt;int, 100&gt;&gt; v;      v.push_back(1000); std::cout&lt;&lt;\"check size \"&lt;&lt;v.size()&lt;&lt;std::endl;      v.push_back(2000); std::cout&lt;&lt;\"check size \"&lt;&lt;v.size()&lt;&lt;std::endl;<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e GCC) \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<blockquote>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>allocate(1)<\/em><\/p>\n<p><strong>check size 1<\/strong><\/p>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>allocate(2)<\/em><\/p>\n<p><em>deallocate(1)<\/em><\/p>\n<p><strong>check size 2<\/strong><\/p>\n<p><em>deallocate(2)<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<h2>std::shared_ptr<\/h2>\n<p>\u0423\u043c\u043d\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0432\u0435\u0449\u044c, \u043d\u043e \u043d\u0443\u0436\u043d\u0430\u044f \u043b\u0438 \u0432 bare metal? \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0449\u0435\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043c\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0435\u043c.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043f\u0443\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong><em>std::allocate_shared<\/em><\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u043b\u0435\u043f\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">template &lt;class Element,            std::size_t Size,            class SharedWrapper = Element&gt; class StaticSharedAllocator {   public:   static constexpr std::size_t kSize = Size;   using value_type = SharedWrapper;   using pool_type = StaticPool&lt;Element, kSize&gt;;   pool_type &amp;pool_;   using ElementPlaceHolder = pool_type::value_type;    template &lt;class U&gt;   struct rebind {     using other = StaticSharedAllocator&lt;Element, kSize, U&gt;;   };    StaticSharedAllocator(pool_type &amp;pool) : pool_{pool} {}   ~StaticSharedAllocator() = default;   template &lt;class Other, std::size_t OtherSize&gt;   StaticSharedAllocator(const StaticSharedAllocator&lt;Other, OtherSize&gt; &amp;other)      : pool_{other.pool_} {}    auto allocate(std::size_t n) -&gt; value_type * {     static_assert(sizeof(value_type) &lt;= sizeof(ElementPlaceHolder));     static_assert(alignof(value_type) &lt;= alignof(ElementPlaceHolder));     static_assert((alignof(ElementPlaceHolder) % alignof(value_type)) == 0u);        return reinterpret_cast&lt;value_type *&gt;(pool_.allocate(n));   }    auto deallocate(value_type *p, std::size_t n) -&gt; void {     pool_.deallocate(reinterpret_cast&lt;value_type *&gt;(p), n);   } };<\/code><\/pre>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, <em>Element <\/em>\u2013 \u0442\u0438\u043f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. <em>Size <\/em>\u2013 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440. <em>SharedWrapper <\/em>\u2013 \u044d\u0442\u043e \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 <em>\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435<\/em>!<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b <strong><em>shared_ptr <\/em><\/strong>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u044f\u043c\u043e \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0432\u043c\u0435\u0441\u0442\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <strong>rebuild<\/strong>. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0434\u0440\u0430\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0433\u0434\u0435-\u0442\u043e \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 alloc_traits.h, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043a \u0432\u0438\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code>using type = typename _Tp::template rebind&lt;_Up&gt;::other;<\/code><\/pre>\n<p>\u0433\u0434\u0435 <strong><em>_Tp <\/em><\/strong>\u044d\u0442\u043e <em>StaticSharedAllocator&lt;Element, Size&gt;<\/em>, <\/p>\n<p><strong><em>_Up <\/em><\/strong>\u044d\u0442\u043e <em>std::_Sp_counted_ptr_inplace&lt;Object, StaticSharedAllocator&lt;Element, Size&gt;, __gnu_cxx::_S_atomic&gt;<\/em><\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u043e \u0432\u0435\u0440\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f GCC, \u0432 IAR \u0442\u0438\u043f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0439, \u043d\u043e \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u0435\u043d: \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0447\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 <em>Element<\/em>. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0442\u0438\u043f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445. \u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, SharedWrapper \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <em>shared_ptr<\/em>.<\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0438\u043b\u0438 \u043f\u0443\u043b\u043b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0420\u0430\u0437\u043c\u0435\u0440 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438, \u0438\u0431\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0440\u0430\u0437\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0421\u0430\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e <em>allocate_shared <\/em>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u0430 \u0441 \u0435\u0433\u043e \u043a\u043e\u043f\u0438\u0435\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0443\u0436\u0435\u043d \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c. \u0428\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0439 \u0442\u043e\u0436\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d, \u0430 \u043f\u0443\u043b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u0430\u043c \u043f\u0443\u043b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 StaticArray \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435. \u0410 \u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0440\u0443 \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u0442\u044c?<\/p>\n<pre><code class=\"cpp\">template &lt;class Type, size_t Size&gt; struct StaticPool {   static constexpr size_t kSize = Size;   static constexpr size_t kSizeOverhead = 48;   using value_type = std::aligned_storage_t&lt;sizeof(Type)+kSizeOverhead,                                              alignof(std::max_align_t)&gt;;   StaticArray&lt;value_type, Size&gt; pool_;      auto allocate(std::size_t n) -&gt; value_type * {     return pool_.allocate(n);   }   auto deallocate(value_type *p, std::size_t n) -&gt; void {     pool_.deallocate(p, n);   } };<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"cpp\">struct Object {   int index; }; constexpr size_t kMaxObjectNumber = 10u;  StaticPool&lt;Object, kMaxObjectNumber&gt; object_pool {};  StaticSharedAllocator&lt;Object, kMaxObjectNumber&gt; object_alloc_ {object_pool};  std::shared_ptr&lt;Object&gt; MakeObject() {   return std::allocate_shared&lt;Object&gt;(object_alloc_); }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0438\u0437\u0443\u0432\u0435\u0440\u0441\u0442\u0432\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0437\u0434\u0435\u0441\u044c. \u0425\u043e\u0442\u044f, \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043b\u0443\u0447\u0448\u0435 \u0440\u0435\u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c shared_ptr \u0432\u043e\u043e\u0431\u0449\u0435. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e.<\/p>\n<h2>std::function<\/h2>\n<p>\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430. \u0422\u043e\u0447\u043d\u043e \u0431\u044b\u043b\u0430 \u0431\u044b \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0432 embedded \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 (<em>callbacks<\/em>).<\/p>\n<p>\u0427\u0435\u043c \u043c\u044b \u043f\u043b\u0430\u0442\u0438\u043c \u0437\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c?<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <em>std::function<\/em> \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>int x[] = {1, 2, 3, 4, 5};     auto sum = [=] () -&gt; int {       int sum = x[0];       for (size_t i = 1u; i &lt; sizeof(x) \/ sizeof(int); i++) {         sum += x[i];       }       return sum;     };          std::function&lt;int()&gt; callback = sum; <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 5, \u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2013 20 \u0431\u0430\u0439\u0442. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>callback <\/em>\u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0439 \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f.<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0430\u0448\u0435\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 (place holder), \u0433\u0434\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<p>\u041b\u044e\u0431\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u0421++ \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c. \u0414\u043b\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u043d\u0443\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0443\u043a\u0440\u043e\u043c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u0435\u0447\u043a\u043e \u0434\u043b\u044f \u043f\u0430\u0440\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u044d\u0442\u0438\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439! \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043b\u044f\u043c\u0431\u0434\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0437\u0430\u043f\u0438\u0445\u0430\u0442\u044c \u0435\u0435 \u0442\u0443\u0434\u0430, \u0442\u043e \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0434\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f.<\/p>\n<h2>\u0414\u043b\u044f GCC<\/h2>\n<p>\u041e\u043f\u0446\u0438\u0438 <strong><em>-specs=nano.specs<\/em><\/strong> \u0443\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0432\u0430\u0442\u0430\u0442\u044c \u0434\u043b\u044f <em>std::function.<\/em><\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<blockquote>\n<p>abort.c:(.text.abort+0xa): undefined reference to <code>_exit<\/code><\/p>\n<p>signalr.c:(.text.<em>kill<\/em>r+0xe): undefined reference to <code>_kill<\/code><\/p>\n<p>signalr.c:(.text.<em>getpid<\/em>r+0x0): undefined reference to <strong>_getpid<\/strong><\/p>\n<\/blockquote>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u044c \u043f\u0443\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041d\u0443\u0436\u043d\u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u043e\u043f\u0446\u0438\u044f <strong><em>-specs=nosys.specs<\/em><\/strong>, \u0433\u0434\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u044f\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>\u0421\u043e\u0431\u0435\u0440\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443, \u0447\u0442\u043e\u0431 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>std::function<\/em> \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432. \u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u2013 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442 ST \u0434\u043b\u044f \u043f\u043e\u0434\u043c\u0438\u0433\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0441\u0435\u043a\u0446\u0438\u0439 \u0444\u0430\u0439\u043b\u0430-\u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u0394text<\/p>\n<\/td>\n<td>\n<p>\u0394data<\/p>\n<\/td>\n<td>\n<p>\u0394bss<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>67&nbsp;880<\/p>\n<\/td>\n<td>\n<p>2&nbsp;496<\/p>\n<\/td>\n<td>\n<p>144<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041d\u0435\u0432\u043e\u043e\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0432\u0437\u0433\u043b\u044f\u0434\u043e\u043c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0435\u043a\u0446\u0438\u044f .text \u0432\u044b\u0440\u043e\u0441\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 (\u043d\u0430 67\u041a\u0431!). \u041a\u0430\u043a \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0433\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435?<\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 <em>std::function<\/em> \u044f\u0432\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 demangling \u0434\u043b\u044f \u0438\u043c\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438 \u044d\u0442\u043e \u0434\u043e\u0440\u043e\u0433\u043e\u0435 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435. \u041d\u0443\u0436\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445? \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043b\u044e\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f elf-\u0444\u0430\u0439\u043b, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0430\u043c\u044b\u0435 \u0436\u0438\u0440\u043d\u044b\u0435.<\/p>\n<pre><code>00000440\tcplus_demangle_operators 0000049e\t__gxx_personality_v0 000004c4 \td_encoding 000004fe\td_exprlist 00000574\t_malloc_r 0000060c\td_print_mod 000007f0\td_type 00000eec\t_dtoa_r 00001b36\t_svfprintf_r 0000306c\td_print_comp<\/code><\/pre>\n<p>\u041c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c <em>d_*<\/em> \u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <em>cp-demangle.c<\/em> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <em>libiberty<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 gcc, \u0438 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0437\u0430 \u0434\u0432\u0435\u0440\u044c.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (<em>bad_function_call<\/em>, <em>std::unexpected<\/em>, <em>std::terminate<\/em>)<\/p>\n<p><em>_sbrk<\/em>, <em>malloc<\/em>, <em>free <\/em>\u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u2013 \u0444\u043b\u0430\u0433\u0438 <em>-fno-exceptions<\/em> \u0438 <em>-fno-rtti<\/em> \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u044e\u0442.<\/p>\n<p>\u0412\u043d\u0435\u0434\u0440\u0438\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u0394text<\/p>\n<\/td>\n<td>\n<p>\u0394data<\/p>\n<\/td>\n<td>\n<p>\u0394bss<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>67992<\/p>\n<\/td>\n<td>\n<p>2504<\/p>\n<\/td>\n<td>\n<p>144<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f <em>std::function<\/em> \u043e\u0431\u043e\u0448\u043b\u0430\u0441\u044c \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u0434\u043e\u0440\u043e\u0433\u043e.<\/p>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0442\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0431\u0435\u0437 std::function \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>libc_nano.a libg_nano.a libg_nano.a(lib_a-exit.o) libg_nano.a(lib_a-exit.o) (_global_impure_ptr) libg_nano.a(lib_a-impure.o) libg_nano.a(lib_a-init.o) libg_nano.a(lib_a-memcpy-stub.o) libg_nano.a(lib_a-memset.o) libgcc.a libm.a libstdc++_nano.a<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0441 std::function \u0441\u043f\u0438\u0441\u043e\u043a \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0434\u043b\u0438\u043d\u043d\u0435\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>libc.a libg.a libg.a(lib_a-__atexit.o) libg.a(lib_a-__call_atexit.o) libg.a(lib_a-__call_atexit.o) (__libc_fini_array) libg.a(lib_a-__call_atexit.o) (atexit) libg.a(lib_a-abort.o) libg.a(lib_a-abort.o) (_exit) libg.a(lib_a-abort.o) (raise) libg.a(lib_a-atexit.o) libg.a(lib_a-callocr.o) libg.a(lib_a-closer.o) libg.a(lib_a-closer.o) (_close) libg.a(lib_a-ctype_.o) libg.a(lib_a-cxa_atexit.o) libg.a(lib_a-cxa_atexit.o) (__register_exitproc) libg.a(lib_a-dtoa.o) libg.a(lib_a-dtoa.o) (_Balloc) libg.a(lib_a-dtoa.o) (__aeabi_ddiv) libg.a(lib_a-exit.o) libg.a(lib_a-exit.o) (__call_exitprocs) libg.a(lib_a-exit.o) (_global_impure_ptr) libg.a(lib_a-fclose.o) libg.a(lib_a-fflush.o) libg.a(lib_a-findfp.o) libg.a(lib_a-findfp.o) (__sread) libg.a(lib_a-findfp.o) (_fclose_r) libg.a(lib_a-findfp.o) (_fwalk) libg.a(lib_a-fini.o) libg.a(lib_a-fputc.o) libg.a(lib_a-fputc.o) (__retarget_lock_acquire_recursive) libg.a(lib_a-fputc.o) (__sinit) libg.a(lib_a-fputc.o) (_putc_r) libg.a(lib_a-fputs.o) libg.a(lib_a-fputs.o) (__sfvwrite_r) libg.a(lib_a-freer.o) libg.a(lib_a-fstatr.o) libg.a(lib_a-fstatr.o) (_fstat) libg.a(lib_a-fvwrite.o) libg.a(lib_a-fvwrite.o) (__swsetup_r) libg.a(lib_a-fvwrite.o) (_fflush_r) libg.a(lib_a-fvwrite.o) (_free_r) libg.a(lib_a-fvwrite.o) (_malloc_r) libg.a(lib_a-fvwrite.o) (_realloc_r) libg.a(lib_a-fvwrite.o) (memchr) libg.a(lib_a-fvwrite.o) (memmove) libg.a(lib_a-fwalk.o) libg.a(lib_a-fwrite.o) libg.a(lib_a-impure.o) libg.a(lib_a-init.o) libg.a(lib_a-isattyr.o) libg.a(lib_a-isattyr.o) (_isatty) libg.a(lib_a-locale.o) libg.a(lib_a-locale.o) (__ascii_mbtowc) libg.a(lib_a-locale.o) (__ascii_wctomb) libg.a(lib_a-locale.o) (_ctype_) libg.a(lib_a-localeconv.o) libg.a(lib_a-localeconv.o) (__global_locale) libg.a(lib_a-lock.o) libg.a(lib_a-lseekr.o) libg.a(lib_a-lseekr.o) (_lseek) libg.a(lib_a-makebuf.o) libg.a(lib_a-makebuf.o) (_fstat_r) libg.a(lib_a-makebuf.o) (_isatty_r) libg.a(lib_a-malloc.o) libg.a(lib_a-mallocr.o) libg.a(lib_a-mallocr.o) (__malloc_lock) libg.a(lib_a-mallocr.o) (_sbrk_r) libg.a(lib_a-mbtowc_r.o) libg.a(lib_a-memchr.o) libg.a(lib_a-memcmp.o) libg.a(lib_a-memcpy.o) libg.a(lib_a-memmove.o) libg.a(lib_a-memset.o) libg.a(lib_a-mlock.o) libg.a(lib_a-mprec.o) libg.a(lib_a-mprec.o) (_calloc_r) libg.a(lib_a-putc.o) libg.a(lib_a-putc.o) (__swbuf_r) libg.a(lib_a-readr.o) libg.a(lib_a-readr.o) (_read) libg.a(lib_a-realloc.o) libg.a(lib_a-reallocr.o) libg.a(lib_a-reent.o) libg.a(lib_a-s_frexp.o) libg.a(lib_a-sbrkr.o) libg.a(lib_a-sbrkr.o) (_sbrk) libg.a(lib_a-sbrkr.o) (errno) libg.a(lib_a-signal.o) libg.a(lib_a-signal.o) (_kill_r) libg.a(lib_a-signalr.o) libg.a(lib_a-signalr.o) (_getpid) libg.a(lib_a-signalr.o) (_kill) libg.a(lib_a-sprintf.o) libg.a(lib_a-sprintf.o) (_svfprintf_r) libg.a(lib_a-stdio.o) libg.a(lib_a-stdio.o) (_close_r) libg.a(lib_a-stdio.o) (_lseek_r) libg.a(lib_a-stdio.o) (_read_r) libg.a(lib_a-strcmp.o) libg.a(lib_a-strlen.o) libg.a(lib_a-strncmp.o) libg.a(lib_a-strncpy.o) libg.a(lib_a-svfiprintf.o) libg.a(lib_a-svfprintf.o) libg.a(lib_a-svfprintf.o) (__aeabi_d2iz) libg.a(lib_a-svfprintf.o) (__aeabi_dcmpeq) libg.a(lib_a-svfprintf.o) (__aeabi_dcmpun) libg.a(lib_a-svfprintf.o) (__aeabi_dmul) libg.a(lib_a-svfprintf.o) (__aeabi_dsub) libg.a(lib_a-svfprintf.o) (__aeabi_uldivmod) libg.a(lib_a-svfprintf.o) (__ssprint_r) libg.a(lib_a-svfprintf.o) (_dtoa_r) libg.a(lib_a-svfprintf.o) (_localeconv_r) libg.a(lib_a-svfprintf.o) (frexp) libg.a(lib_a-svfprintf.o) (strncpy) libg.a(lib_a-syswrite.o) libg.a(lib_a-syswrite.o) (_write_r) libg.a(lib_a-wbuf.o) libg.a(lib_a-wctomb_r.o) libg.a(lib_a-writer.o) libg.a(lib_a-writer.o) (_write) libg.a(lib_a-wsetup.o) libg.a(lib_a-wsetup.o) (__smakebuf_r) libgcc.a libgcc.a(_aeabi_uldivmod.o) libgcc.a(_aeabi_uldivmod.o) (__aeabi_ldiv0) libgcc.a(_aeabi_uldivmod.o) (__udivmoddi4) libgcc.a(_arm_addsubdf3.o) libgcc.a(_arm_cmpdf2.o) libgcc.a(_arm_fixdfsi.o) libgcc.a(_arm_muldf3.o) libgcc.a(_arm_muldivdf3.o) libgcc.a(_arm_unorddf2.o) libgcc.a(_dvmd_tls.o) libgcc.a(_udivmoddi4.o) libgcc.a(libunwind.o) libgcc.a(pr-support.o) libgcc.a(unwind-arm.o) libgcc.a(unwind-arm.o) (__gnu_unwind_execute) libgcc.a(unwind-arm.o) (restore_core_regs) libm.a libnosys.a libnosys.a(_exit.o) libnosys.a(close.o) libnosys.a(fstat.o) libnosys.a(getpid.o) libnosys.a(isatty.o) libnosys.a(kill.o) libnosys.a(lseek.o) libnosys.a(read.o) libnosys.a(sbrk.o) libnosys.a(write.o) libstdc++.a libstdc++.a(atexit_arm.o) libstdc++.a(atexit_arm.o) (__cxa_atexit) libstdc++.a(class_type_info.o) libstdc++.a(cp-demangle.o) libstdc++.a(cp-demangle.o) (memcmp) libstdc++.a(cp-demangle.o) (realloc) libstdc++.a(cp-demangle.o) (sprintf) libstdc++.a(cp-demangle.o) (strlen) libstdc++.a(cp-demangle.o) (strncmp) libstdc++.a(del_op.o) libstdc++.a(del_ops.o) libstdc++.a(eh_alloc.o) libstdc++.a(eh_alloc.o) (std::terminate()) libstdc++.a(eh_alloc.o) (malloc) libstdc++.a(eh_arm.o) libstdc++.a(eh_call.o) libstdc++.a(eh_call.o) (__cxa_get_globals_fast) libstdc++.a(eh_catch.o) libstdc++.a(eh_exception.o) libstdc++.a(eh_exception.o) (operator delete(void*, unsigned int)) libstdc++.a(eh_exception.o) (__cxa_pure_virtual) libstdc++.a(eh_globals.o) libstdc++.a(eh_personality.o) libstdc++.a(eh_term_handler.o) libstdc++.a(eh_terminate.o) libstdc++.a(eh_terminate.o) (__cxxabiv1::__terminate_handler) libstdc++.a(eh_terminate.o) (__cxxabiv1::__unexpected_handler) libstdc++.a(eh_terminate.o) (__gnu_cxx::__verbose_terminate_handler()) libstdc++.a(eh_terminate.o) (__cxa_begin_catch) libstdc++.a(eh_terminate.o) (__cxa_call_unexpected) libstdc++.a(eh_terminate.o) (__cxa_end_cleanup) libstdc++.a(eh_terminate.o) (__gxx_personality_v0) libstdc++.a(eh_terminate.o) (abort) libstdc++.a(eh_throw.o) libstdc++.a(eh_type.o) libstdc++.a(eh_unex_handler.o) libstdc++.a(functional.o) libstdc++.a(functional.o) (std::exception::~exception()) libstdc++.a(functional.o) (vtable for __cxxabiv1::__si_class_type_info) libstdc++.a(functional.o) (operator delete(void*)) libstdc++.a(functional.o) (__cxa_allocate_exception) libstdc++.a(functional.o) (__cxa_throw) libstdc++.a(pure.o) libstdc++.a(pure.o) (write) libstdc++.a(si_class_type_info.o) libstdc++.a(si_class_type_info.o) (__cxxabiv1::__class_type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const) libstdc++.a(si_class_type_info.o) (std::type_info::__is_pointer_p() const) libstdc++.a(tinfo.o) libstdc++.a(tinfo.o) (strcmp) libstdc++.a(vterminate.o) libstdc++.a(vterminate.o) (__cxa_current_exception_type) libstdc++.a(vterminate.o) (__cxa_demangle) libstdc++.a(vterminate.o) (fputc) libstdc++.a(vterminate.o) (fputs) libstdc++.a(vterminate.o) (fwrite)<\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0410 \u0447\u0442\u043e IAR?<\/h2>\n<p>\u0412\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435. \u041e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 <em>nano <\/em>\u0438\u043b\u0438 <em>nosys<\/em>, \u0435\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438. \u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0441\u0435 \u0437\u043d\u0430\u0435\u0442 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0432\u0438\u0434\u0435, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u043c\u0443 \u043c\u0435\u0448\u0430\u0442\u044c.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u0394text<\/p>\n<\/td>\n<td>\n<p>\u0394ro data<\/p>\n<\/td>\n<td>\n<p>\u0394rw data<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2&nbsp;958<\/p>\n<\/td>\n<td>\n<p>38<\/p>\n<\/td>\n<td>\n<p>548<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041e, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u0441\u0435\u0433\u043e-\u0442\u043e \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0436\u0430\u043b\u043a\u0438\u0445 3\u041a\u0431 \u043a\u043e\u0434\u0430! \u042d\u0442\u043e \u0443\u0441\u043f\u0435\u0445. \u0424\u0430\u043d\u0430\u0442 GCC \u0432\u043e \u043c\u043d\u0435 \u0437\u0430\u0432\u043e\u043b\u043d\u043e\u0432\u0430\u043b\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043c\u0430\u043b\u043e? \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0430\u043c IAR.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u0434\u0432\u0443\u0445 \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<blockquote>\n<p>dlmalloc.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1&#8217;404&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 496<\/p>\n<p>heaptramp0.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  4<\/p>\n<\/blockquote>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 GCC.<\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432 \u043a\u0443\u0447\u0435 \u043d\u0435\u0442, \u043d\u043e IAR \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0441\u044f: \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <strong><em>gm<\/em> <\/strong>(<em>global malloc: a malloc_state holds all of the bookkeeping for a space<\/em>) \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.<\/p>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0442\u043e\u0433\u043e \u044e\u043d\u0438\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u043e\u0436\u0435 \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043d\u0435\u043b:<\/p>\n<p>\u0434\u043e<\/p>\n<blockquote>\n<p>main.cpp.obj &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3&#8217;218 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 412 &nbsp; 36&#8217;924<\/p>\n<\/blockquote>\n<p>\u043f\u043e\u0441\u043b\u0435<\/p>\n<blockquote>\n<p>main.cpp.obj &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4&#8217;746 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 451 &nbsp; 36&#8217;964<\/p>\n<\/blockquote>\n<p>\u0424\u0430\u0439\u043b \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u043b \u0431\u043e\u043b\u0435\u0435 1\u041a\u0431. \u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c <em>std::function<\/em>, \u0435\u0435 \u0441\u043e\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0441 \u043b\u044f\u043c\u0431\u0434\u043e\u0439, \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u0394text<\/p>\n<\/td>\n<td>\n<p>\u0394ro data<\/p>\n<\/td>\n<td>\n<p>\u0394rw data<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>3 998<\/p>\n<\/td>\n<td>\n<p>82<\/p>\n<\/td>\n<td>\n<p>600<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u0438\u0431\u0430\u0432\u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 1\u041a\u0431. \u0422.\u0435. \u043a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u0443 \u043a\u043e\u0434\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438. \u042d\u0442\u043e \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c: \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u043e\u0434\u0438\u043d \u0438 \u043d\u0435 \u0434\u0432\u0430 \u043a\u043e\u043b\u0431\u044d\u043a\u0430, \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0435\u0441\u044f\u0442\u043a\u0430 \u043d\u0430\u0431\u0435\u0440\u0435\u0442\u0441\u044f. \u0425\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043c\u0435\u044e\u0442 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 <em>void(*)(void) <\/em>\u0438\u043b\u0438 <em>void(*)(uint8_t *, int)<\/em>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <em>std::function<\/em> \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0427\u0442\u043e \u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u043b.<\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <em>function <\/em>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u0435\u0440\u0435\u043d\u0435\u0441 \u0435\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0432\u0441\u0435 <em>std::function<\/em>, \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043c\u043e\u0433 \u0434\u043e\u0442\u044f\u043d\u0443\u0442\u044c\u0441\u044f. \u0421 \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u0430 \u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043d\u0430\u0431\u0435\u0440\u0435\u0436\u043d\u0443\u044e \u043b\u044e\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043a\u0430\u0442\u043e\u043c. <\/p>\n<p>\u0414\u043e\u043c\u0430 \u043c\u0435\u043d\u044f \u043f\u043e\u0434\u0436\u0438\u0434\u0430\u043b\u043e \u043f\u0438\u0441\u044c\u043c\u043e \u043e\u0442 \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u043f\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438. \u041e\u043d \u043f\u0438\u0441\u0430\u043b, \u0447\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0442\u043a\u0430\u0437\u0443 \u043e\u0442 \u0431\u043e\u0433\u043e\u043c\u0435\u0440\u0437\u043a\u0438\u0445 <em>std::function<\/em> \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0445\u0443\u0434\u043d\u0443\u043b, \u043c\u044b \u0432\u0441\u0435 \u043c\u043e\u043b\u043e\u0434\u0446\u044b! \u0421\u043e\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0438\u0437 \u043c\u0435\u043d\u044f \u0441\u0430\u043c\u043e\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u043e \u0431\u0440\u044b\u0437\u043d\u0443\u043b\u043e \u0432\u043e \u0432\u0441\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u041f\u0440\u0438\u043b\u0430\u0433\u0430\u043b\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u043e-\u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u0434\u043e-\u043f\u043e\u0441\u043b\u0435, \u0432\u043e\u043f\u0438\u0432\u0448\u0438\u0439 \u043e\u0431 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0430\u0436 \u043d\u0430 30 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432. \u0412 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u0445 \u0446\u0438\u0444\u0440\u0430 \u0431\u044b\u043b\u0430 \u0435\u0449\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u0435\u0435, \u044d\u0442\u043e, \u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u043e\u0447\u043a\u0443, \u0446\u0435\u043b\u044b\u0445 150 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442! \u0427\u0442\u043e-\u043e-\u043e-\u043e? \u0423\u043b\u044b\u0431\u043a\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0442\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u043b\u0430\u0441\u044c \u043e\u0442 \u043b\u0438\u0446\u0430 \u0438 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u043c\u043a\u0440\u0430\u0442\u043e\u043c \u043f\u043e\u043b\u0435\u0442\u0435\u043b\u0430 \u0432\u043d\u0438\u0437, \u043f\u0440\u043e\u0431\u0438\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u0438\u044f. \u0412 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u0431\u044d\u043a\u043e\u0432, \u0447\u0442\u043e\u0431 \u0445\u043e\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0435\u043d\u043e\u043c\u0435\u043d. \u0412 \u0447\u0435\u043c \u0434\u0435\u043b\u043e?<\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u043e\u043d\u043d\u043e\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0435\u043c\u043d\u043e\u0439 \u0443\u043b\u0438\u0446\u044b, \u0440\u0430\u0441\u043a\u0438\u043d\u0443\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u043d\u0438\u0437\u0443, \u044f \u0442\u0432\u0435\u0440\u0434\u043e \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043d\u0435 \u0441\u043e\u043c\u043a\u043d\u0443 \u0433\u043b\u0430\u0437, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0442\u044b\u0449\u0443 \u043e\u0442\u0432\u0435\u0442. \u041f\u0440\u043e\u0441\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u0443\u0442\u0440\u043e\u043c, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u043b \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 elf-\u0444\u0430\u0439\u043b\u0430: \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043c\u0435\u043d\u044b <em>std::function<\/em>. \u0422\u0443\u0442 \u0432\u0441\u0435 \u0441\u0442\u0430\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e!<\/p>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u0431\u044b\u0442\u043e\u043c \u0431\u043e\u0433\u043e\u043c \u0438 \u043a\u0435\u043c-\u0442\u043e \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0431\u044b\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<pre><code>using Handler = std::function&lt;void()&gt;; static auto global_handlers = std::pair&lt;Handler, Handler&gt; {};<\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0441\u043c\u043e\u0433 \u043f\u043e\u043d\u044f\u0442\u044c, \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043b\u0435\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u0438\u044f <em>shared_ptr<\/em>, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0438 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0433\u0434\u0435 \u0443\u0436\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u043d\u0438\u043c \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u0410 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0414\u0430, \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0432\u044b\u0440\u0435\u0437\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0447\u0435\u0441\u0442\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0432\u0441\u0435 \u044d\u0442\u0438 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435  \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0435\u0433\u043e \u0445\u043e\u0442\u0435\u043b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043c\u043d\u0435 \u0430\u0432\u0442\u043e\u0440, \u0438 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0433\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 17-\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430, \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u043d\u044b \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e <strong>static <\/strong>\u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <strong>inline<\/strong>. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f IAR. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0435\u0431\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u0443\u0431\u0440\u0430\u043b.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u043e\u0442 \u0442\u0443\u0442 \u044f \u0432\u0441\u0435 \u0436\u0435 \u043d\u0435 \u0443\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0442\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 <strong><em>multiple definition<\/em><\/strong>. \u0415\u0436\u0435\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>static<\/strong>, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043c\u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0433\u043b\u0430\u0434\u043a\u043e, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041d\u0443, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e.<\/p>\n<p>\/\/ a.h<\/p>\n<p>#pragma once<\/p>\n<p>int a();<\/p>\n<p>\/\/ a.cpp<\/p>\n<p>#include &#171;a.h&#187;<\/p>\n<p>#include &#171;c.hpp&#187;<\/p>\n<p>int a() { return c<em>glob * 2; }<\/em><\/p>\n<p><em>\/\/ b.h<\/em><\/p>\n<p><em>#pragma once<\/em><\/p>\n<p><em>int b();<\/em><\/p>\n<p><em>\/\/ b.cpp<\/em><\/p>\n<p><em>#include &#171;b.h&#187;<\/em><\/p>\n<p><em>#include &#171;c.hpp&#187;<\/em><\/p>\n<p><em>int b() { return c<\/em>glob * 4; }<\/p>\n<p>\/\/ main.cpp<\/p>\n<p>#include &#171;a.h&#187;<\/p>\n<p>#include &#171;b.h&#187;<\/p>\n<p>int main() { return a() + b(); }<\/p>\n<p>\/\/ c.hpp<\/p>\n<p>#pragma once<\/p>\n<p>int c_glob = 0;<\/p>\n<p>\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0448 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>$ g++ a.cpp b.cpp main.cpp -o test<\/p>\n<p>\/usr\/lib\/gcc\/x86<em>64-pc-cygwin\/10\/..\/..\/..\/..\/x86<\/em>64-pc-cygwin\/bin\/ld: \/tmp\/cccXOcPm.o:b.cpp:(.bss+0x0): \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u00abc<em>glob\u00bb; \/tmp\/ccjo1M9W.o:a.cpp:(.bss+0x0): \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/em><\/p>\n<p><em>collect2: \u043e\u0448\u0438\u0431\u043a\u0430: \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 ld \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 1<\/em><\/p>\n<p>\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443. \u0422\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 c.hpp:<\/p>\n<p>static int c<em>_<\/em>glob = 0;<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f! \u041f\u043e\u043b\u044e\u0431\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u044b:<\/p>\n<p>$ objdump.exe -t test.exe | grep glob | c++filt.exe<\/p>\n<p>[ 48](sec&nbsp; 7)(fl 0x00)(ty &nbsp; 0)(scl &nbsp; 3) (nx 0) 0x0000000000000000 c_glob<\/p>\n<p>[ 65](sec&nbsp; 7)(fl 0x00)(ty &nbsp; 0)(scl &nbsp; 3) (nx 0) 0x0000000000000010 c<em>_<\/em>glob<\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043b\u0438\u0448\u043d\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u0447\u0442\u043e \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>\u0410 \u0435\u0436\u0435\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c c.hpp \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>inline int c<em>_<\/em>glob = 0;<\/p>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442 c<em>_<\/em>glob \u0431\u0443\u0434\u0435\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u0432\u0441\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<\/div>\n<\/details>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0431\u0430\u043d\u0430\u043b\u0435\u043d: \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0448\u044c&#8230; \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c SIL!<\/p>\n<p>\u0421++ \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e, \u0430 \u0442\u043e \u043f\u043e\u043b \u0432 \u043e\u0444\u0438\u0441\u0435 \u043d\u0435 \u0443\u0441\u043f\u0435\u044e \u0434\u043e\u043c\u044b\u0442\u044c.<\/p>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u0432\u0441\u0435\u043c \u0443\u0434\u0430\u0447\u0438!<\/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\/company\/auriga\/blog\/539760\/\"> https:\/\/habr.com\/ru\/company\/auriga\/blog\/539760\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>C++ is a horrible language. It&#8217;s made more horrible by the fact that a lot&nbsp;of substandard programmers use it, to the point where it&#8217;s much much&nbsp;easier to generate total and utter crap with it.<\/p>\n<p><em>Linus Benedict Torvalds<\/em><\/p>\n<\/blockquote>\n<p>\u0421\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u043b\u043e \u0443\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441. \u041c\u044b \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0442\u044f\u0433\u0443\u0447\u0435\u0435 \u0438 \u0432\u044f\u0437\u043a\u043e\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0439 \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u044b, \u0438 \u0444\u043e\u043a\u0443\u0441 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u0437 \u043d\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u043c\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u0430\u043c\u044b\u0439 \u0431\u043e\u0439\u043a\u0438\u0439 \u0438\u0437 \u0442\u0440\u0435\u0445 \u043c\u043e\u0438\u0445 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u043d\u0438\u0435\u043c \u0434\u0435\u043b\u0430 \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043f\u0440\u0438\u043d\u044f\u043b\u0441\u044f \u0437\u0430 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0413\u043e\u0432\u043e\u0440\u0438\u043b \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u2013 \u044f\u0432\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u0443\u0436\u0435 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437. \u041f\u043e \u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u043c, \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u0435\u043b\u0430\u0441\u044c \u043d\u0430\u0434 \u043d\u0435\u043a\u0438\u043c \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043c\u0430\u043b\u044b\u043c, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 STM32L4. \u041f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0432\u0435\u0434\u0435\u043d\u043e \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443&#8230; USART&#8230; SPI&#8230; \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e, \u0443\u0436\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u044b\u0448\u0430\u043b \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0431\u0430\u044e\u043a\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0444\u0440\u0430\u0437 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043f\u043e\u0434\u0430\u043b\u0441\u044f \u0447\u0443\u0442\u044c \u0432\u043f\u0435\u0440\u0435\u0434 \u0438, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0432 \u043c\u043e\u0439 \u0441\u043e\u043d\u043d\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0431\u0435\u0437 \u0433\u043e\u0440\u0434\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u043d\u0435\u0441:<\/p>\n<p>\u2014 \u0410 firmware \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043d\u0430 C++! \u2013 \u043c\u043e\u0439 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0437\u0430\u0443\u043b\u044b\u0431\u0430\u043b\u0441\u044f \u0438 \u043e\u0442\u043a\u0438\u043d\u0443\u043b\u0441\u044f \u0432 \u043a\u0440\u0435\u0441\u043b\u0435, \u043e\u0436\u0438\u0434\u0430\u044f \u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0441\u0432\u043e\u044e \u043f\u0440\u043e\u0432\u043e\u043a\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u044d\u0441\u043a\u0430\u043f\u0430\u0434\u0443. <\/p>\n<p>\u042f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u0447\u0443\u0434\u043b\u0438\u0432\u043e \u0438\u0437\u043e\u0433\u043d\u0443\u0442\u044c \u0431\u0440\u043e\u0432\u044c, \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044f \u043c\u043e\u0435 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435, \u043d\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f. \u0421\u043a\u0440\u043e\u043c\u043d\u043e \u0441\u0438\u0434\u0435\u0432\u0448\u0438\u0439 \u0441\u043b\u0435\u0432\u0430 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u0438\u043d\u044f\u043b \u044d\u0442\u043e \u0437\u0430 \u0433\u0440\u0438\u043c\u0430\u0441\u0443 \u0443\u0436\u0430\u0441\u0430 \u0438 \u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>\u2014 \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u044f? \u2013 \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u043d \u0441 \u0438\u0441\u043a\u0440\u0435\u043d\u043d\u0435\u0439 \u043e\u0437\u0430\u0431\u043e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0433\u043e\u043b\u043e\u0441\u0435.<\/p>\n<p>\u041e\u043f\u0430\u0441\u0435\u043d\u0438\u044f \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0432 \u0438\u0437\u0431\u044b\u0442\u043a\u0435. \u042f \u0441 \u043d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u043c\u0438\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u043b \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u043d\u0430 MbedOS \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0442. \u041f\u0430\u043c\u044f\u0442\u044c \u0442\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u044f \u0443\u0441\u043f\u0435\u043b \u043c\u043e\u0440\u0433\u043d\u0443\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437. \u042d\u0445, \u043e\u043f\u044b\u0442, \u0441\u044b\u043d \u043e\u0448\u0438\u0431\u043e\u043a&#8230; \u041d\u0430\u0434\u043e \u0432\u0441\u0435 \u0436\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0435 \u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043d\u0430 \u00ab\u043f\u043b\u044e\u0441\u0430\u0445\u00bb \u043d\u0438\u043a\u0442\u043e \u0438 \u043d\u0435 \u0437\u0430\u0438\u043a\u0430\u043b\u0441\u044f, \u0434\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0448\u043b\u0438. \u0412\u0441\u0435 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 \u0432\u043e\u0437\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u044b\u043f\u0430\u043b\u0438\u0441\u044c \u0432 \u0442\u0440\u0443\u0445\u0443 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u0432 \u043c\u0438\u0444\u044b. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b&#8230;<\/p>\n<p>\u2014&nbsp; \u041d\u0443, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435\u2026 \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e, \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u043e\u043b\u0435\u0440\u0430\u043d\u0442\u043d\u044b\u0439\u2026 \u2013 \u044f \u0437\u0430\u043c\u044f\u043b\u0441\u044f, \u043d\u0435 \u0436\u0435\u043b\u0430\u044f \u043d\u0438\u043a\u043e\u0433\u043e \u043e\u0431\u0438\u0436\u0430\u0442\u044c. &#8212; \u041d\u043e \u043d\u0430 \u043f\u043b\u044e\u0441\u0430\u0445 \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u044d\u0442\u0430\u043a\u043e\u0435, \u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0432 \u043e\u0434\u0438\u043d \u043c\u0438\u0433 \u043e\u043f\u0443\u0445\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0439 \u043c\u043e\u0437\u0433 \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0413\u0435\u0440\u043c\u0430\u043d\u0430 \u0413\u0435\u0441\u0441\u0435.<\/p>\n<p>\u2014&nbsp; \u0414\u0430, \u0442\u0430\u043a\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0435\u0441\u0442\u044c, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d, \u2013 \u043f\u0440\u043e\u0431\u0430\u0441\u0438\u043b \u043c\u043e\u043b\u0447\u0430\u0432\u0448\u0438\u0439 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e \u043f\u043e\u0434\u043d\u044f\u043b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043b\u0435\u0446, \u0430\u043a\u0446\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0444\u0430\u043a\u0442\u0435.<\/p>\n<p>\u2014 \u0418 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u0434 \u0440\u0435\u0432\u044c\u044e! \u2013 \u0432\u0441\u0442\u0440\u0435\u043f\u0435\u043d\u0443\u0432\u0448\u0438\u0441\u044c, \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u043c \u0434\u0432\u043e\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0447\u043b\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>\u0414\u0430, \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u043b\u0441\u044f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041d\u043e \u043a\u0442\u043e \u0431\u044b \u0441\u043c\u0435\u043b \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0438\u0434\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u044c \u0432\u0435\u0441\u043e\u043c\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438?<\/p>\n<h2>IAR<\/h2>\n<p>\u0422\u0430\u043a \u0443\u0436 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043c\u044b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. &#171;\u041d\u0443, \u044d\u0442\u043e \u0436\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f \u0436\u0435\u043b\u0435\u0437\u043e\u043a&#187;, \u2013 \u043d\u0430\u0438\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u043b \u044f, \u2013 &#171;\u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c\u0441\u044f&#187;. \u041d\u0435 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u0436\u0435\u0441\u0442\u043e\u043a\u043e \u043e\u0448\u0438\u0431\u0441\u044f \u0438 \u043f\u0440\u043e\u043a\u043b\u044f\u043b \u0442\u043e\u0442 \u0434\u0435\u043d\u044c, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043a\u043e\u043c\u0444\u043e\u0440\u0442. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0421++17. \u042f \u0443\u0436\u0435 \u043f\u043e\u0442\u0438\u0440\u0430\u043b \u043f\u043e\u0442\u043d\u044b\u0435 \u043b\u0430\u0434\u043e\u0448\u043a\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044f, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0443 \u0432\u043e\u043d \u0442\u043e \u0438 \u0432\u043e\u0442 \u044d\u0442\u043e, \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043d\u043e IAR \u043c\u043e\u0436\u0435\u0442 \u043e\u0445\u043b\u0430\u0434\u0438\u0442\u044c \u043f\u044b\u043b \u043d\u0435 \u0445\u0443\u0436\u0435, \u0447\u0435\u043c \u0432\u0438\u0434 \u043d\u043e\u0432\u043e\u0432\u043e\u0440\u043e\u043d\u0435\u0436\u0441\u043a\u043e\u0439 \u0410\u043b\u0435\u043d\u0443\u0448\u043a\u0438.<\/p>\n<p> \u041d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0435\u043d\u0438\u044f \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, structured binding declaration \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0443\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0439 \u0443\u043f\u0440\u044f\u043c\u0446\u0430. \u0415\u0449\u0435 IAR \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u0436\u0435\u043d \u0438 \u0445\u0440\u0443\u043f\u043e\u043a, \u043a\u0430\u043a\u0430\u044f-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0434\u043e \u0438\u0441\u0442\u0435\u0440\u0438\u043a\u0438: \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0440\u0443\u0445\u043d\u0435\u0442 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438. \u042d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a, \u043f\u043e \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u043b\u043e\u0441\u044c. \u0422\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u044b \u043e\u0433\u043e\u0440\u0447\u0430\u044e\u0442 \u0434\u0430\u0436\u0435 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0444\u0438\u043d\u0430\u043b\u0430 \u00ab\u0418\u0433\u0440\u044b \u043f\u0440\u0435\u0441\u0442\u043e\u043b\u043e\u0432\u00bb.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435\u043c\u0443 \u0432\u0438\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0414\u0430, \u043d\u043e \u0443 GCC \u0441  \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. <\/p>\n<h2>SIL<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435, \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b SIL. Safety integrity level \u2013 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0435\u0441\u043b\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0436\u0438\u0437\u043d\u0438 \u043b\u044e\u0434\u0435\u0439, \u0442\u043e \u043f\u0440\u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u041e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u2013 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f  \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main. \u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0432 no-OS \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0447\u0440\u0435\u0432\u0430\u0442\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0432\u0440\u043e\u0434\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0442.\u043f.<\/p>\n<p>\u041e\u0434\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 \u043a\u043e\u0434\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0438\u0436\u0435.<\/p>\n<h2>std::exception<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0413\u0435\u0440\u0431\u0430 \u0421\u0430\u0442\u0442\u0435\u0440\u0430, \u0447\u0442\u043e \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 C++ \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0435\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0438 \u043b\u044e\u0431\u0438\u043c, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0431\u0435\u0441\u043f\u043e\u0449\u0430\u0434\u043d\u043e \u0432\u044b\u043f\u0438\u043b\u0435\u043d\u044b. \u041d\u0435\u043c\u0443\u0434\u0440\u0435\u043d\u043e, \u0432\u0435\u0434\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. <\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0421++, \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u044d\u0442\u043e \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0438 \u0442\u0430\u043a. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0442\u0430\u043a\u0443\u044e:<\/p>\n<pre><code class=\"cpp\">__cxa_allocate_exception<\/code><\/pre>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443 \u043d\u0435\u0435 \u0443\u0436\u0435 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043d\u0435\u0445\u043e\u0440\u043e\u0448\u0435\u0435, \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u0443\u0447\u0435. \u0412\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0431\u0443\u0444\u0435\u0440\u043e\u043c. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c, \u0442\u043e \u0432 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 autosar \u0434\u043b\u044f \u0441++14 \u0442\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b. \u0414\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0433\u0440\u0443\u0431\u043e \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432  \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041f\u0440\u043e\u0449\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u043e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u0432\u0441\u0435.&nbsp;\u0427\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u043b\u0430\u0433 \u0433\u043e\u0440\u0434\u043e \u0440\u0435\u0435\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c! \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u0435\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0435 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043f\u043e\u0434 IAR \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0442.<\/p>\n<h2>std::vector<\/h2>\n<p>\u0422\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u041d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u0421\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043d\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c, \u0444\u0430\u043a\u0442.<\/p>\n<p>\u0412\u0441\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0435 \u043d\u0430 <em>std::array<\/em>, \u043d\u043e \u0431\u044b\u043b\u0438 \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0438 \u0431\u044b\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0445\u0438\u0442\u0440\u043e \u0432\u043f\u043b\u0435\u0442\u0435\u043d\u044b \u0432 \u043a\u043e\u0434. \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">template &lt;class T, std::size_t Size&gt; class StaticArray {  using ssize_t = int;  public:  using value_type = T;  template &lt;class U&gt;  struct rebind {    using other = StaticArray&lt;U, Size&gt;;  };  StaticArray() = default;  ~StaticArray() = default;  template &lt;class U, std::size_t S&gt;  StaticArray(const StaticArray&lt;U, S&gt;&amp;);   auto allocate(std::size_t n) -&gt; value_type*;  auto deallocate(value_type* p, std::size_t n) -&gt; void;  auto max_size() const -&gt; std::size_t; };<\/code><\/pre>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, <strong><em>allocate <\/em><\/strong>\u0438 <strong><em>deallocate<\/em><\/strong>. \u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>n <\/strong>\u2013<strong> <\/strong>\u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u043f\u043e\u043f\u0443\u0433\u0430\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong><em>max_size <\/em><\/strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong><em>allocate<\/em><\/strong>. <\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0443\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">std::vector&lt;int, StaticArray&lt;int, 100&gt;&gt; v;      v.push_back(1000); std::cout&lt;&lt;\"check size \"&lt;&lt;v.size()&lt;&lt;std::endl;      v.push_back(2000); std::cout&lt;&lt;\"check size \"&lt;&lt;v.size()&lt;&lt;std::endl;<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e GCC) \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<blockquote>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>allocate(1)<\/em><\/p>\n<p><strong>check size 1<\/strong><\/p>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>max_size() -&gt; 100<\/em><\/p>\n<p><em>allocate(2)<\/em><\/p>\n<p><em>deallocate(1)<\/em><\/p>\n<p><strong>check size 2<\/strong><\/p>\n<p><em>deallocate(2)<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<h2>std::shared_ptr<\/h2>\n<p>\u0423\u043c\u043d\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0432\u0435\u0449\u044c, \u043d\u043e \u043d\u0443\u0436\u043d\u0430\u044f \u043b\u0438 \u0432 bare metal? \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0449\u0435\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043c\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0435\u043c.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043f\u0443\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong><em>std::allocate_shared<\/em><\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u043b\u0435\u043f\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">template &lt;class Element,            std::size_t Size,            class SharedWrapper = Element&gt; class StaticSharedAllocator {   public:   static constexpr std::size_t kSize = Size;   using value_type = SharedWrapper;   using pool_type = StaticPool&lt;Element, kSize&gt;;   pool_type &amp;pool_;   using ElementPlaceHolder = pool_type::value_type;    template &lt;class U&gt;   struct rebind {     using other = StaticSharedAllocator&lt;Element, kSize, U&gt;;   };    StaticSharedAllocator(pool_type &amp;pool) : pool_{pool} {}   ~StaticSharedAllocator() = default;   template &lt;class Other, std::size_t OtherSize&gt;   StaticSharedAllocator(const StaticSharedAllocator&lt;Other, OtherSize&gt; &amp;other)      : pool_{other.pool_} {}    auto allocate(std::size_t n) -&gt; value_type * {     static_assert(sizeof(value_type) &lt;= sizeof(ElementPlaceHolder));     static_assert(alignof(value_type) &lt;= alignof(ElementPlaceHolder));     static_assert((alignof(ElementPlaceHolder) % alignof(value_type)) == 0u);        return reinterpret_cast&lt;value_type *&gt;(pool_.allocate(n));   }    auto deallocate(value_type *p, std::size_t n) -&gt; void {     pool_.deallocate(reinterpret_cast&lt;value_type *&gt;(p), n);   } };<\/code><\/pre>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, <em>Element <\/em>\u2013 \u0442\u0438\u043f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. <em>Size <\/em>\u2013 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440. <em>SharedWrapper <\/em>\u2013 \u044d\u0442\u043e \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 <em>\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435<\/em>!<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b <strong><em>shared_ptr <\/em><\/strong>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u044f\u043c\u043e \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0432\u043c\u0435\u0441\u0442\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <strong>rebuild<\/strong>. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0434\u0440\u0430\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0433\u0434\u0435-\u0442\u043e \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 alloc_traits.h, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043a \u0432\u0438\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code>using type = typename _Tp::template rebind&lt;_Up&gt;::other;<\/code><\/pre>\n<p>\u0433\u0434\u0435 <strong><em>_Tp <\/em><\/strong>\u044d\u0442\u043e <em>StaticSharedAllocator&lt;Element, Size&gt;<\/em>, <\/p>\n<p><strong><em>_Up <\/em><\/strong>\u044d\u0442\u043e <em>std::_Sp_counted_ptr_inpl<\/em><\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-321025","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321025","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=321025"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321025\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}