{"id":342906,"date":"2022-12-20T15:01:13","date_gmt":"2022-12-20T15:01:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342906"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2022-12-20T15:01:13","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342906","title":{"rendered":"<span>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 C++20 \u2014 7 \u043d\u0435\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/706458\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rl\/7g\/af\/rl7gaf90ouok_gw6ttgquffd82y.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rl\/7g\/af\/rl7gaf90ouok_gw6ttgquffd82y.png\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Ranges \u0434\u043b\u044f C++20 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u044c \u043d\u0435\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0438\u0445 \u0441\u043e \u00ab\u0441\u0442\u0430\u0440\u043e\u0439\u00bb \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e <a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_201222&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 C++<\/a>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"prezhde-chem-my-nachnyom\">\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u043d\u0430\u0447\u043d\u0451\u043c<\/h1>\n<p>  <\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 <code>std::ranges<\/code>:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 <code>&lt;algorithm><\/code>, \u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 <code>&lt;ranges><\/code>.<\/li>\n<li>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430: \u0441 \u043f\u0430\u0440\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430.<\/li>\n<li>\u0412\u0435\u0440\u0441\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u043b\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u043b\u0438 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432.<\/li>\n<li>\u0412\u0435\u0440\u0441\u0438\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0438\u043c\u0435\u044e\u0442 \u00ab\u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438\u00bb, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c.<\/li>\n<li>\u0421\u043c. \u043c\u043e\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043e\u0431 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043c\u043e\u0449\u043d\u044b\u043c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u043c: <a href=\"https:\/\/www.cppstories.com\/2020\/10\/understanding-invoke.html\/\">C++20 Ranges, Projections, std::invoke \u0438 if constexpr \u2014 C++ Stories<\/a><\/li>\n<li>\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438 \u043d\u0435\u0442 \u043e\u043f\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2014 <code>std::execution<\/code>).<\/li>\n<li>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432, \u043a\u0430\u043a \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b C++20, \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <code>constexpr<\/code>.<\/li>\n<li>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C++20, \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 <code>&lt;numeric><\/code>, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0442\u0430\u043a \u0438 \u0435\u0433\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438. \u041e\u043d\u0438 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u0432 \u043d\u0438\u0445 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/algorithm\">cppreference\/algorithms<\/a>, \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u00ab\u043d\u0435\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438\u00bb.<\/p>\n<p>  <\/p>\n<h1 id=\"1-all_of-any_of-none_of\">1. <code>all_of<\/code>, <code>any_of<\/code>, <code>none_of<\/code><\/h1>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges>  int main() {     const std::vector nums = {1, 2, 3, -4, 5, 6, 7, 8 };      auto is_positive = [](const auto&amp; v) { return v > 0; };      \/\/ standard version:     auto res = std::all_of(begin(nums), end(nums), is_positive);     std::cout &lt;&lt; \"std::all_of: \" &lt;&lt; res &lt;&lt; '\\n';      res = std::any_of(begin(nums), end(nums), is_positive);     std::cout &lt;&lt; \"std::any_of: \" &lt;&lt; res &lt;&lt; '\\n'; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0432\u0435\u0440\u0441\u0438\u044f \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ ranges version: res = std::ranges::all_of(nums, is_positive); std::cout &lt;&lt; \"std::ranges::all_of: \" &lt;&lt; res &lt;&lt; '\\n';  res = std::ranges::any_of(nums, is_positive); std::cout &lt;&lt; \"std::ranges::any_of: \" &lt;&lt; res &lt;&lt; '\\n';<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/r5M7vbee4\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0433\u0434\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges>  struct Product {     std::string name_;     double value_ { 0.0 }; };  int main() {     const std::vector&lt;Product> prods {         { \"box\", 10.0 }, {\"tv\", 100.0}, {\"none\", -1.0}     };      auto is_positive = [](const auto&amp; v) { return v > 0; };     auto is_positive_val = [](const Product&amp; p) {         return p.value_ > 0;     };      \/\/ standard version:     auto res = std::all_of(begin(prods), end(prods), is_positive_val);     std::cout &lt;&lt; \"std::all_of: \" &lt;&lt; res &lt;&lt; '\\n';      res = std::any_of(begin(prods), end(prods), is_positive_val);     std::cout &lt;&lt; \"std::any_of: \" &lt;&lt; res &lt;&lt; '\\n';      \/\/ ranges version:     res = std::ranges::all_of(prods, is_positive, &amp;Product::value_);     std::cout &lt;&lt; \"std::ranges::all_of: \" &lt;&lt; res &lt;&lt; '\\n';      res = std::ranges::any_of(prods, is_positive, &amp;Product::value_);     std::cout &lt;&lt; \"std::ranges::any_of: \" &lt;&lt; res &lt;&lt; '\\n'; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <a href=\"https:\/\/godbolt.org\/z\/scon89cc5\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438 \u043c\u044b \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 <code>is_positive<\/code>, \u043d\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u00ab\u0431\u0435\u0440\u0451\u0442\u00bb <code>Product::value_<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u0433\u043e \u0432 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0442\u0438\u043f\u0430 <code>Product<\/code>.<\/p>\n<p>  <\/p>\n<h1 id=\"2-for_each\">2. <code>for_each<\/code><\/h1>\n<p>  <\/p>\n<p>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0446\u0438\u043a\u043b\u0430 for:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges>  struct Product {     std::string name_;     double value_ { 0.0 }; };  int main() {     const std::vector&lt;Product> prods {         { \"box\", 10.0 }, {\"tv\", 100.0}, {\"none\", -1.0}     };      auto out = [](const auto&amp; v) { std::cout &lt;&lt; v &lt;&lt; \", \"; };      \/\/ standard version:     std::cout &lt;&lt; \"std::for_each: \\n\";     std::for_each(begin(prods), end(prods), [](const Product&amp; p){         std::cout &lt;&lt; p.name_  &lt;&lt; \", \" &lt;&lt; p.value_ &lt;&lt; '\\n';     });      std::cout &lt;&lt; \"std::for_each only names reverse: \\n\";     std::for_each(rbegin(prods), rend(prods), [](const Product&amp; p){         std::cout &lt;&lt; p.name_  &lt;&lt; '\\n';     });      \/\/ ranges version:     std::cout &lt;&lt; \"std::ranges::for_each: \\n\";     std::ranges::for_each(prods, [](const Product&amp; p) {         std::cout &lt;&lt; p.name_  &lt;&lt; \", \" &lt;&lt; p.value_ &lt;&lt; '\\n';     });      std::cout &lt;&lt; \"std::ranges::for_each only names in reverse: \\n\";     std::ranges::for_each(prods | std::views::reverse,                           out, &amp;Product::name_); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/fvfrdEqeb\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b <code>rbegin\/rend<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0443\u043d\u0430\u0440\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0447\u043b\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 <code>Product<\/code>. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <code>views::reverse<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u0427\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ standard: std::for_each(std::execution::par, begin(prods), end(prods), \/*...*\/); \/\/ no ranges version... \/\/ std::ranges::for_each(std::execution::par, prods, \/*... *\/); \/\/ doesn't compile...<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 <strong>\u0432\u0441\u0435\u0445<\/strong> \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f <code>for_each<\/code>.<\/p>\n<p>  <\/p>\n<h1 id=\"3-count_if\">3. <code>count_if<\/code><\/h1>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0442\u043e\u0432\u0430\u0440\u044b, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 &#171;no&#187;:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges>  struct Product {     std::string name_;     double value_ { 0.0 }; };  int main() {     const std::vector&lt;Product> prods {         { \"box\", 10.0 }, {\"tv\", 100.0}, {\"none\", -1.0},         { \"car\", 1000.0 }, {\"toy\", 40.0}, {\"none\", 0.0}     };      \/\/ standard version:         auto res = std::count_if(begin(prods), end(prods), [](const Product&amp; p){         return p.name_.starts_with(\"no\");     });     std::cout &lt;&lt; \"std::count_if: \" &lt;&lt; res &lt;&lt; '\\n';      \/\/ ranges version:     res = std::ranges::count_if(prods, [](const Product&amp; p) {         return p.name_.starts_with(\"no\");     });     std::cout &lt;&lt; \"std::ranges::count_if: \" &lt;&lt; res &lt;&lt; '\\n';  \/\/ alternative version for \"none\":     res = std::ranges::count(prods, std::string{\"none\"}, &amp;Product::name_);     std::cout &lt;&lt; \"std::ranges::count: \" &lt;&lt; res &lt;&lt; '\\n'; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/o1v1sdcKc\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0442\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u043b\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <code>Product::name_<\/code>. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043c\u044b \u0438\u0449\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e <code>\"none\"<\/code>, \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0436\u0435, \u0447\u0435\u043c <code>starts_with<\/code>.<\/p>\n<p>  <\/p>\n<h1 id=\"4-find_if\">4. <code>find_if<\/code><\/h1>\n<p>  <\/p>\n<p>\u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0430\u0448\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043b\u0438 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 <code>find*<\/code> \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b (\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u043e \u0436\u0435 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges>  struct Product {     std::string name_;     double value_ { 0.0 }; };  int main() {     const std::vector&lt;Product> prods {         { \"box\", 10.0 }, {\"tv\", 100.0}, {\"rocket\", 10000.0},         { \"car\", 1000.0 }, {\"toy\", 40.0}, {\"none\", 0.0}     };      \/\/ standard version:         auto it = std::find_if(begin(prods), end(prods), [](const Product&amp; p){         return p.name_.starts_with(\"ro\");     });     if (it != end(prods))         std::cout &lt;&lt; \"std::find_if: \" &lt;&lt; it->name_ &lt;&lt; '\\n';      \/\/ ranges version:     auto res = std::ranges::find_if(prods, [](const Product&amp; p) {         return p.name_.starts_with(\"ro\");     });     if (res != end(prods))         std::cout &lt;&lt; \"std::ranges::find_if: \" &lt;&lt; res->name_ &lt;&lt; '\\n'; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/sqGqW6Ezq\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u00ab\u043e\u0431\u044b\u0447\u043d\u0430\u044f\u00bb \u0432\u0435\u0440\u0441\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">it = std::ranges::find_if(begin(prods), end(prods), [](const Product&amp; p) {     return p.name_.starts_with(\"ro\"); });<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u0430\u044f, \u0432\u0435\u0434\u044c \u043e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <strong>\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0435<\/strong> \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b. \u042d\u0442\u043e\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445\/\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u042d\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0435 \u0434\u0432\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430 (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442), \u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441 \u043e\u0434\u043d\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">struct Product {     std::string name_;     double value_ { 0.0 }; };  std::vector&lt;Product> GetProds() {     return {         { \"box\", 10.0 }, {\"tv\", 100.0}, {\"rocket\", 10000.0},         { \"car\", 1000.0 }, {\"toy\", 40.0}, {\"none\", 0.0}     }; }  int main() {     auto it = std::ranges::find_if(GetProds(), [](const Product&amp; p) {         return p.name_.starts_with(\"ro\");     });     std::cout &lt;&lt; \"std::ranges::find_if: \" &lt;&lt; it->name_ &lt;&lt; '\\n'; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">error: base operand of '->' has non-pointer type 'std::ranges::dangling'    22 |     std::cout &lt;&lt; \"std::ranges::find_if: \" &lt;&lt; it->name_ &lt;&lt; '\\n';       |                                                ^~<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b, \u0447\u0442\u043e <code>GetProds()<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e\u0432\u0438\u0441\u043d\u0435\u0442. <\/p>\n<p>  <\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u043e\u0434 \u0432 <a href=\"https:\/\/godbolt.org\/z\/f5v1P4rGo\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<h1 id=\"5-find_first_of\">5. <code>find_first_of<\/code><\/h1>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 <code>find*<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0449\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges>  struct Product {     std::string name_;     double value_ { 0.0 };      friend bool operator==(const Product&amp; a, const Product&amp; b) {         return a.name_ == b.name_ &amp;&amp; abs(a.value_ - b.value_) &lt; 0.0001;     } };  int main() {     const std::vector&lt;Product> prods {         { \"box\", 10.0 }, {\"default\", 0.0 }, {\"tv\", 100.0}, {\"rocket\", 10000.0},         { \"car\", 1000.0 }, {\"toy\", 40.0}, {\"none\", 0.0 }, { \"ball\", 40.0 }     };      const std::vector&lt;Product> invalids {         {\"default\", 0.0 }, {\"none\", 0.0 }     };      \/\/ standard version:         auto it = std::find_first_of(begin(prods), end(prods), begin(invalids), end(invalids));     if (it != end(prods)) {         std::cout &lt;&lt; \"std::find_first_of: \" &lt;&lt; it->name_ &lt;&lt; \" at: \"                   &lt;&lt; std::distance(begin(prods), it) &lt;&lt;'\\n';         auto it2 = std::find_first_of(std::next(it), end(prods), begin(invalids), end(invalids));         if (it2 != end(prods))             std::cout &lt;&lt; \"std::find_first_of: \" &lt;&lt; it2->name_ &lt;&lt; \" at: \"                       &lt;&lt; std::distance(begin(prods), it2) &lt;&lt;'\\n';     }      \/\/ ranges version:     const std::array&lt;std::string, 2> arrInvalids{\"default\", \"none\"};     auto res = std::ranges::find_first_of(prods, arrInvalids,                            std::ranges::equal_to{}, &amp;Product::name_);     if (res != end(prods)) {         const auto pos = std::distance(begin(prods), res);         std::cout &lt;&lt; \"std::ranges::find_first_of: \" &lt;&lt; res->name_                   &lt;&lt; \" at: \" &lt;&lt; pos &lt;&lt;'\\n';          auto res2 = std::ranges::find_first_of(prods | std::views::drop(pos+1), arrInvalids,                            std::ranges::equal_to{}, &amp;Product::name_);         if (res2 != end(prods)) {             std::cout &lt;&lt; \"std::ranges::find_first_of: \" &lt;&lt; res2->name_                       &lt;&lt; \" at: \" &lt;&lt; std::distance(begin(prods), res2) &lt;&lt;'\\n';                 }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/PW5G8xY37\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p><code>std::find_first_of<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0435 \u043f\u0430\u0440\u044b \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u0439\u0442\u0438 \u00ab\u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435\u00bb \u0442\u043e\u0432\u0430\u0440\u044b \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <code>prod<\/code>. \u042f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c <code>operator==<\/code>. \u0410 \u0432\u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u043d\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">auto cmpNames = [](const Product&amp; a, const Product&amp; b) {     return a.name_ == b.name_; };  auto it = std::find_first_of(begin(prods), end(prods),                      begin(invalids), end(invalids), cmpNames); if (it != end(prods)) {     \/\/ ... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0433\u043e, \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438 \u044f \u043c\u043e\u0433\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438 \u0438 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">const std::array&lt;std::string, 2> arrInvalids{\"default\", \"none\"}; auto res = std::ranges::find_first_of(prods, arrInvalids,                            std::ranges::equal_to{}, &amp;Product::name_);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>drop<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 N \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">auto res2 = std::ranges::find_first_of(prods | std::views::drop(pos+1),                arrInvalids, std::ranges::equal_to{}, &amp;Product::name_);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">auto res2 = std::ranges::find_first_of(std::next(res), end(prods),                            begin(arrInvalids), end(arrInvalids),                            std::ranges::equal_to{}, &amp;Product::name_);<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"6-mismatch-httpswwwcppstoriescom2022ranges-alg-part-one6-mismatch\">6. <code>mismatch<\/code> <\/h1>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <code>mismatch<\/code> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0434\u0432\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges> #include &lt;iomanip> \/\/ quoted  int main() {     const std::string firstStr = \"Hello Super World\";     const std::string secondStr = \"Hello Amazing World\";      std::cout &lt;&lt; \"mismatch for \" &lt;&lt; std::quoted(firstStr)               &lt;&lt; \" and \" &lt;&lt; std::quoted(secondStr) &lt;&lt; '\\n';      \/\/ standard version:            auto [first, second] = std::mismatch(begin(firstStr), end(firstStr), begin(secondStr));     {         const auto pos = std::distance(begin(firstStr), first);         std::cout &lt;&lt; \"std::mismatch: at pos \" &lt;&lt; pos &lt;&lt; '\\n';     }      \/\/ ranges version:     auto res = std::ranges::mismatch(firstStr, secondStr);     {         const auto pos = std::distance(begin(firstStr), res.in1);         std::cout &lt;&lt; \"std::ranges::mismatch: at pos \" &lt;&lt; pos &lt;&lt; '\\n';             } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/zGh3cj9e5\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">template&lt;class I1, class I2> using mismatch_result = ranges::in_in_result&lt;I1, I2>;<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u0430\u0440\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 <code>.in1<\/code> \u0438 <code>.in2<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d? \u041f\u043e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/ranges\/return_types\/in_in_result\">\u0441\u0441\u044b\u043b\u043a\u0435 cpp<\/a> \u0443\u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<blockquote><p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>std::pair<\/code> \u0438 <code>std::tuple<\/code>, \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043c\u0435\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438.<\/p><\/blockquote>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u043e\u043c), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">auto [n1, n2] = std::ranges::mismatch(firstStr, secondStr); const auto pos = std::distance(begin(firstStr), n1); std::cout &lt;&lt; \"std::ranges::mismatch: at pos \" &lt;&lt; pos &lt;&lt; '\\n';    <\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  <\/p>\n<h1 id=\"7-search-httpswwwcppstoriescom2022ranges-alg-part-one7-search\">7. <code>search<\/code> <\/h1>\n<p>  <\/p>\n<p>\u041f\u043e\u0438\u0441\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435\/\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;vector> #include &lt;iostream> #include &lt;ranges> #include &lt;functional> \/\/ searchers #include &lt;iomanip>  int main() {     const std::string testString = \"Hello Super World\";     const std::string needle = \"Super\";      std::cout &lt;&lt; \"looking for \" &lt;&lt; std::quoted(needle)               &lt;&lt; \" in \" &lt;&lt; std::quoted(testString) &lt;&lt; '\\n';      \/\/ standard version:            auto it = std::search(testString.begin(), testString.end(),                  std::boyer_moore_searcher(needle.begin(), needle.end()));      if (it != testString.end()) {         const auto pos = std::distance(testString.begin(), it);         std::cout &lt;&lt; \"std::search: found at pos \" &lt;&lt; pos &lt;&lt; '\\n';     }      \/\/ ranges version:     auto res = std::ranges::search(testString, needle);     if (!res.empty()) {         const auto first = std::distance(testString.begin(), res.begin());         const auto last = std::distance(testString.begin(), res.end());         std::cout &lt;&lt; \"std::ranges::search: found between \"                   &lt;&lt; first &lt;&lt; \" and \" &lt;&lt; last &lt;&lt; '\\n';             } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/T191KfrKj\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u043a \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a \u043c\u0435\u0441\u0442\u0443, \u0433\u0434\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 (\u0438\u043b\u0438 \u043a <code>end()<\/code>, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u0435\u0451 \u043d\u0435\u0442). \u0412\u0435\u0440\u0441\u0438\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d (\u0438\u043b\u0438 <code>borrowed_subrange<\/code>).<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ ranges version: const std::string testString2 = \"hello abc world\"; const std::string needle2 = \"ABC\"; std::cout &lt;&lt; \"looking for \" &lt;&lt; std::quoted(needle2) &lt;&lt; \" in \"           &lt;&lt; std::quoted(testString2) &lt;&lt; '\\n';  res = std::ranges::search(testString2, needle2,   std::ranges::equal_to{}, ::toupper, ::toupper); if (!res.empty()) { const auto first = std::distance(testString2.begin(), res.begin()); const auto last = std::distance(testString2.begin(), res.end()); std::cout &lt;&lt; \"std::ranges::search: found between \"   &lt;&lt; first &lt;&lt; \" and \" &lt;&lt; last &lt;&lt; '\\n';         }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/1WTa655d6\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u043e\u0438\u0441\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.cppstories.com\/2018\/08\/searchers\/\">Speeding up Pattern Searches with Boyer-Moore Algorithm from C++17 \u2014 C++ Stories<\/a><\/li>\n<li><a href=\"https:\/\/www.cppstories.com\/2018\/08\/searcher-preprocessing\/\">Preprocessing Phase for C++17\u2019s Searchers \u2014 C++ Stories<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>ranges::search_n<\/code> \u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 <code>n<\/code> \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;algorithm> #include &lt;iostream> #include &lt;ranges> #include &lt;iomanip>  int main() {     const std::string sequence = \"CTGCCCAGGGTTT\";     const char letter = 'C';     const size_t count = 3;      std::cout &lt;&lt; \"looking for \" &lt;&lt; count &lt;&lt; \" \"               &lt;&lt; letter &lt;&lt; \"'s in \" &lt;&lt; std::quoted(sequence) &lt;&lt; '\\n';      \/\/ standard version:            auto it = std::search_n(begin(sequence), end(sequence), count, letter);      if (it != end(sequence))     {         const auto pos = std::distance(begin(sequence), it);         std::cout &lt;&lt; \"std::search_n: found at pos \" &lt;&lt; pos &lt;&lt; '\\n';     }      \/\/ ranges version:     auto res = std::ranges::search_n(sequence, count, letter);     if (!res.empty())     {         const auto first = std::distance(begin(sequence), res.begin());         const auto last = std::distance(begin(sequence), res.end());         std::cout &lt;&lt; \"std::ranges::search_n: found between \"                   &lt;&lt; first &lt;&lt; \" and \" &lt;&lt; last &lt;&lt; '\\n';             } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/godbolt.org\/z\/1vnGa4nhj\">@Compiler Explorer<\/a><\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432; \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/p>\n<p>  <\/p>\n<h1 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u0435\u043c\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u00ab\u0442\u0438\u043f\u043e\u0432\u00bb \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0432 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043d\u0435\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445\/\u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e\/\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0438\u0441\u043a, \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435, \u043e\u0431\u0449\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f. \u0412\u0441\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 10 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u00ab\u0446\u0435\u043b\u043e\u0433\u043e\u00bb \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u2014 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0441 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438. \u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438, \u0432 \u043d\u0438\u0445 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435. \u0423 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u0440\u0435\u0436\u0438\u043c\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0443\u0447\u0438\u043c \u0432\u0430\u0441 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u00a0\u043f\u0440\u043e\u043a\u0430\u0447\u0430\u043b\u0438 \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u0438 \u0441\u0442\u0430\u043b\u0438 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u043c IT-\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c. \u0421\u043a\u0438\u0434\u043a\u0438 \u0434\u043e 50% \u043f\u043e \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u0443 <strong>HABR<\/strong>.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_201222&amp;utm_term=conc\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/j2\/_o\/gf\/j2_ogfhj6eyshhs0_viq_hce12i.png\" data-src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/j2\/_o\/gf\/j2_ogfhj6eyshhs0_viq_hce12i.png\"\/><\/a><\/p>\n<p>  <\/p>\n<ul>\n<li><u><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_201222&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/u><\/li>\n<li><u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_201222&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist (24 \u043c\u0435\u0441\u044f\u0446\u0430)<\/a><\/u><\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><strong>Data Science \u0438\u00a0Machine Learning<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438\u00a0Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Data Engineering<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438\u00a0Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Machine Learning<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u00a0Python<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Java \u0438\u00a0C#<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430\u00a0JAVA<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430\u00a0Unity<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u00a0\u2014 \u0432\u00a0\u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_201222&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u00ab\u0411\u0435\u043b\u044b\u0439 \u0445\u0430\u043a\u0435\u0440\u00bb<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0410\u00a0\u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/devops-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_201222&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0DevOps<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_201222&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/li>\n<\/ul>\n<\/div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/706458\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/706458\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/706458\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rl\/7g\/af\/rl7gaf90ouok_gw6ttgquffd82y.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rl\/7g\/af\/rl7gaf90ouok_gw6ttgquffd82y.png\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Ranges \u0434\u043b\u044f C++20 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u044c \u043d\u0435\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0438\u0445 \u0441\u043e \u00ab\u0441\u0442\u0430\u0440\u043e\u0439\u00bb \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e <a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_201222&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 C++<\/a>.<\/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-342906","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342906","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=342906"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342906\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}