{"id":307622,"date":"2020-07-28T15:01:04","date_gmt":"2020-07-28T15:01:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307622"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307622","title":{"rendered":"can_throw \u0438\u043b\u0438 \u043d\u0435 can_throw?"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/512792\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/98\/hw\/2j\/98hw2jglfeukbgz0uwbq6oxnuki.png\"><\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u044f\u0437\u044b\u043a\u0430 C++. \u041d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0439 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c\u044e. \u041a\u0442\u043e-\u0442\u043e \u0438\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. \u0412\u043e\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. \u041e\u0442 \u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0432\u0441\u0435\u043c. \u041d\u043e \u043d\u0435 \u043c\u044b. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0448\u0442\u0443\u043a\u043e\u0439, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0435\u0437\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b \u0438, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435 \u0432\u0441\u044f\u043a\u0438\u0439 \u043a\u043e\u0434 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d &quot;\u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c&quot; \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c. \u0427\u0435\u043c\u0443, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e C++. \u0418\u0431\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0440\u043e\u0434\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u044f\u0437\u044b\u043a\u0430 C++ \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0432\u0438\u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443, \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 noexcept. \u0428\u0442\u0443\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0435\u0433\u043e \u043d\u0430\u043c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0432 C++, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e, \u0438 \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0442\u0430\u0440\u043e\u0439 \u0447\u0443\u0436\u043e\u0439 \u0438\u0434\u0435\u0438 \u0438 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"preambula\">\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430<\/h1>\n<p>  <\/p>\n<p>\u0412 C++ \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 noexcept. \u0412\u0438\u0434\u044f \u043e\u0442\u043c\u0435\u0442\u043a\u0443 noexcept \u0432 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e\/\u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0436\u0434\u0430\u0442\u044c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f noexcept \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043b\u044c\u0437\u044f (\u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 swap, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 C-\u0448\u043d\u044b\u0439 \u043a\u043e\u0434 callback-\u0438 \u0438 \u0442.\u0434.).<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u0442\u043c\u0435\u0442\u043a\u0430 noexcept \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u0430 \u043b\u0438\u0448\u044c \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u0438\u0437\u0443\u0447\u0430\u0435\u0448\u044c \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439\/\u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\/\u043c\u0435\u0442\u043e\u0434, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u043e\u0439\u043c\u0435\u0448\u044c, \u0436\u0434\u0430\u0442\u044c \u043b\u0438 \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void some_handler::on_read_result(     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     if(!ec)     {         m_data_size = bytes_transferred;         handle_data();     }     else     {...} }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0438\u043c\u0435\u044f \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u0438 <code>handle_data<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043c\u043e\u0433\u0443\u0442 \u043b\u0438 \u0442\u0443\u0442 \u0432\u044b\u043b\u0435\u0442\u0430\u0442\u044c \u043d\u0430\u0440\u0443\u0436\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 noexcept \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b: \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e\/\u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u044f \u0432\u044b\u043b\u0435\u0442\u0430 \u043d\u0430\u0440\u0443\u0436\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u043b\u0438 \u043d\u0435 \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u0418 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432 C++ \u0447\u0435\u0433\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 noexcept-\u0431\u043b\u043e\u043a\u0430. \u042f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u0432 noexcept-\u0431\u043b\u043e\u043a. \u0427\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void some_handler::on_read_result(     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     noexcept     {         if(!ec)         {             m_data_size = bytes_transferred;             handle_data();         }         else         {...}     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u043d\u0443\u0436\u0435\u043d \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u0432 noexcept-\u0431\u043b\u043e\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e noexcept-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0438\u0437 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u0430 \u043b\u0443\u0447\u0448\u0435 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a\u043e\u0433\u043e noexcept-\u0431\u043b\u043e\u043a\u0430 \u0432 C++ \u043f\u043e\u043a\u0430 \u043d\u0435\u0442. \u0410 \u0440\u0430\u0437 \u043d\u0435\u0442, \u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438. \u041e\u0431 \u043e\u0434\u043d\u043e\u043c \u0442\u0430\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/466849\/\">\u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0435\u043f\u043b\u0435\u043d\u043d\u043e\u043c \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u043b \u0436\u0438\u0437\u043d\u044c.<\/p>\n<p>  <\/p>\n<h1 id=\"problema\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h1>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044b\u0439 \u0441\u0432\u0435\u0436\u0438\u0439 C++ \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b, \u043d\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0430\u043a \u0436\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 (callback-\u043e\u0432).<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e callback-\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0432 \u0440\u043e\u043b\u0438 completion-handler-\u043e\u0432 \u0434\u043b\u044f Asio. \u0412\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 callback-\u043e\u0432 \u043d\u0435\u043b\u044c\u0437\u044f, \u0442.\u043a. Asio \u044d\u0442\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043b\u043e\u0432\u0438\u0442 \u0438 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u044b\u043b\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 completion-handler-\u0430 \u2014 \u044d\u0442\u043e \u043a\u0440\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c callback-\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c \u0421\u0438. \u0418, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0442\u0442\u0443\u0434\u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 callback-\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0434\u0430\u0435\u0442\u0441\u044f \u0432 Asio \u0438\u043b\u0438 \u0432 C-\u0448\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c try\/catch, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0430 \u0432\u043e\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void some_handler::on_read_result(     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     try     {         handle_read_result(ec, bytes_transferred); \/\/ \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.     }     catch(...)     {         \/\/ \u0425\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e &quot;\u043f\u0440\u043e\u0433\u043b\u043e\u0442\u0438\u0442\u044c&quot; \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 (\u0438\u043b\u0438 \u0443\u0441\u0442\u0430\u0432\u0448\u0435\u043c\u0443) \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c callback \u0431\u0435\u0437 try\/catch \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u0430\u043c \u043c\u0435\u0442\u043e\u0434 <code>handle_read_result<\/code>. \u0418 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0442\u0443\u0442 \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0418, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0422.\u043a. \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0441\u0442\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0431\u0440\u043e\u0441\u0430\u044e\u0449\u0438\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\/\u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<h1 id=\"reshenie-v-vide-markera-can_throw\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 can_throw<\/h1>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u0430 can_throw, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0442\u0438\u043f\u0430 can_throw, \u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 can_throw.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e callback-\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e\/\u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 can_throw, \u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0410 \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u0441 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0430\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0442.\u043a. \u043c\u0430\u0440\u043a\u0435\u0440 can_throw \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0442\u044c \u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e\/\u043c\u0435\u0442\u043e\u0434. \u0422.\u0435. \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void some_handler::handle_read_result(     can_throw_t can_throw,     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     ... \/\/ \u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. }  void some_handler::on_read_result(     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     \/\/ \u0412\u043e\u0442 \u0442\u0430\u043a \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e!     handle_read_result(can_throw_t{}, ec, bytes_transferred); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b can_throw \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0431\u044b\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">class can_throw_t {     friend class exception_handling_context_t;      can_throw_t() noexcept = default;  public:     ~can_throw_t() noexcept = default;      can_throw_t( const can_throw_t &amp; ) noexcept = default;     can_throw_t( can_throw_t &amp;&amp; ) noexcept = default;      can_throw_t &amp;     operator=( const can_throw_t &amp; ) noexcept = default;     can_throw_t &amp;     operator=( can_throw_t &amp;&amp; ) noexcept = default; };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422.\u0435. \u043a\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0442\u0438\u043f\u0430 <code>can_throw_t<\/code>, \u043d\u043e \u0432\u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b &quot;\u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u0432\u0441\u0435&quot; (\u0441). \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>can_throw_t<\/code> \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043f\u0435\u0440\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0442\u0438\u043f\u0430 <code>exception_handling_context_t<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">class exception_handling_context_t { public:     can_throw_t     make_can_throw_marker() const noexcept { return {}; } };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>make_can_throw_marker()<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void some_handler::on_read_result(     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     try     {         exception_handling_context_t ctx;         handle_read_result(ctx.make_can_throw_marker(), ec, bytes_transferred);     }     catch(...)     {} }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b <code>exception_handling_context_t<\/code> \u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u043e\u0432 try\/catch. \u0418 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0436\u0435\u043b\u0435\u0437\u043e\u0431\u0435\u0442\u043e\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>wrap_throwing_action<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043b\u044f\u043c\u0431\u0434\u0443, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u043c\u0435\u043b\u0430 \u0431\u044b \u0431\u043b\u043e\u043a try, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b \u043b\u044f\u043c\u0431\u0434\u0430 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c. \u0427\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">class can_throw_t {     \/\/ \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 can_throw \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438     \/\/ \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 wrap_throwing_action.     template&lt;typename Lambda&gt;     friend void wrap_throwing_action(Lambda &amp;&amp;);      can_throw_t() noexcept = default;  public:     ... \/\/ \u0412\u0441\u0435 \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435. };  template&lt; typename Lambda &gt; void wrap_throwing_action(Lambda &amp;&amp; lambda) {     try     {         lambda(can_throw_t{});     }     catch(...)     {} }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u043e\u043a\u0430 \u043c\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u044b\u0448\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 <code>can_throw_t<\/code> \u0438 <code>exception_handling_context_t<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 callback-\u0438 \u0438 \u0442\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442 \u043b\u044f\u043c\u0431\u0434\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u044f\u043c\u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u0435\u0440\u0442\u043e\u043a, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0438 \u0431\u043b\u043e\u043a try.<\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 callback-\u043e\u0432, \u043d\u043e \u0438 \u0438\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0410 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b, \u043f\u043e\u0441\u0435\u043c\u0443 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 try \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0413\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 <code>exception_handling_context_t<\/code> \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">some_handler::some_handler(     std::vector&lt;std::byte&gt; initial_data,     std::size_t initial_data_size)     : m_data{std::move(initial_data)}     , m_data_size{initial_data_size} {     exception_handling_context_t ctx;     handle_data(ctx.make_can_throw_marker()); } ... void some_handler::handle_read_result(     can_throw_t can_throw,     const asio::error_code &amp; ec,     std::size_t bytes_transferred) {     if(!ec)     {         m_data_size = bytes_transferred;         handle_data(can_throw);     }     else     {         ...     } } ... void some_handler::handle_data(can_throw_t) {     ... \/\/ \u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u0435\u0449\u0435 \u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043d\u0443\u0436\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 catch: \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0433\u0434\u0435-\u0442\u043e &quot;\u043f\u0440\u043e\u0433\u043b\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f&quot; (\u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0437 callback-\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u043d\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442). \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u044d\u0442\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0432 <code>wrap_throwing_action<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u0430 \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>wrap_throwing_action<\/code>.<\/p>\n<p>  <\/p>\n<h1 id=\"obschie-vpechatleniya\">\u041e\u0431\u0449\u0438\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043a\u043b\u0435\u043f\u0430\u043d\u0438\u044f \u043a\u0438\u043b\u043e\u0442\u043e\u043d\u043d \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 &quot;\u0431\u0435\u0437 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u043d\u044b\u0445&quot; \u0445\u043e\u0440\u043e\u0448\u0438\u0435. \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e\u0433\u043e \u0441\u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u043b\u0441\u044f. \u041a\u0430\u043a \u0438 \u043e\u0431\u043e\u0437\u0440\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430: \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u0433\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043b\u0435\u0442\u0430\u0442\u044c. \u041f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u0435\u0441\u0442\u0430\u0445 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439\/\u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043d\u043e \u0438, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u043c\u0435\u0441\u0442\u0430\u0445 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439\/\u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u0430 \u043a\u043e\u0434\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 can_throw. \u0422.\u0435., \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u043a\u043e\u0434 \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u0448\u044c, \u043a\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041d\u043e, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445\/\u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0418 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 can_throw \u0432\u043d\u0438\u0437 \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b\u0438\u0441\u044c. \u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u0438\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0438 \u0435\u0441\u0442\u044c, \u0440\u043e\u043b\u0438 \u043d\u0435 \u0438\u0433\u0440\u0430\u044e\u0442. \u0422.\u043a. callback-\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 can_throw \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0442\u044b\u0441\u044f\u0447 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0418 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 can_throw \u0432\u043d\u0443\u0442\u0440\u0438 callback-\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0435\u0439\u043a\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 callback-\u0430\u043c\u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 (\u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u043a \u0432\u044b\u0437\u043e\u0432\u0443 callback-\u043e\u0432).<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0431\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043c\u0430\u0440\u043a\u0435\u0440\u0430\u043c\u0438 can_throw \u0441\u0442\u0430\u043b\u0438 \u0431\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 can_throw \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043b\u0438 \u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 can_throw \u0438\u0437 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u044b \u043e\u043d\u0438 \u044d\u0442\u043e \u0438\u043b\u0438 \u043d\u0435\u0442, \u0430 \u0435\u0441\u043b\u0438 \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u2014 \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0434\u0432\u0430 \u0432\u044b\u0448\u0435\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 \u0442\u0435\u043c, \u043a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u043c\u0430\u0440\u043a\u0435\u0440\u0430\u043c\u0438 can_throw \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>  <\/p>\n<h1 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430\u0448\u0438\u043c \u0441\u0432\u0435\u0436\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u043b\u043e \u043d\u0430\u043c \u0436\u0438\u0437\u043d\u044c, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 C++.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0441\u0430\u043c\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u043e \u043d\u0430\u043c\u0438. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043c\u043d\u044e, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0438\u0437 \u0444\u043e\u0440\u0443\u043c\u043e\u0432 (\u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b RSDN) \u043b\u0435\u0442 \u044d\u0434\u0430\u043a 15 \u043d\u0430\u0437\u0430\u0434. \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u043b\u0438, \u0430 \u043b\u0438\u0448\u044c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438 \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0431\u044b\u043b\u043e \u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0438\u043c\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0432 \u0421++. \u0422\u043e\u0433\u0434\u0430 \u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430\u043c \u0442\u0438\u043f\u0430 can_throw. \u041d\u043e \u043f\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u043b\u0438\u0448\u044c \u0442\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \ud83d\ude41 \u0418 \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u043a \u043a\u043e\u0434\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b.<\/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\/post\/512792\/\"> https:\/\/habr.com\/ru\/post\/512792\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/512792\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/98\/hw\/2j\/98hw2jglfeukbgz0uwbq6oxnuki.png\"><\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u044f\u0437\u044b\u043a\u0430 C++. \u041d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0439 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c\u044e. \u041a\u0442\u043e-\u0442\u043e \u0438\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. \u0412\u043e\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. \u041e\u0442 \u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0432\u0441\u0435\u043c. \u041d\u043e \u043d\u0435 \u043c\u044b. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0448\u0442\u0443\u043a\u043e\u0439, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0435\u0437\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b \u0438, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435 \u0432\u0441\u044f\u043a\u0438\u0439 \u043a\u043e\u0434 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d &quot;\u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c&quot; \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c. \u0427\u0435\u043c\u0443, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e C++. \u0418\u0431\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0440\u043e\u0434\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u044f\u0437\u044b\u043a\u0430 C++ \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0432\u0438\u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443, \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 noexcept. \u0428\u0442\u0443\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0435\u0433\u043e \u043d\u0430\u043c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0432 C++, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e, \u0438 \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0442\u0430\u0440\u043e\u0439 \u0447\u0443\u0436\u043e\u0439 \u0438\u0434\u0435\u0438 \u0438 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-307622","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307622","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=307622"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307622\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}