{"id":416066,"date":"2024-06-30T00:43:46","date_gmt":"2024-06-30T00:43:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=416066"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=416066","title":{"rendered":"<span>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b: \u0421++ edition<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0432\u043e, \u0438 \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430, \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u043b \u0411\u043e\u0433 \u043d\u043e\u043b\u044c \u043e\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u044b, \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e. <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c, \u043e\u043f\u0443\u0441\u043a\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u0438\u0440\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0431\u044b\u043b\u0430<a href=\"https:\/\/habr.com\/ru\/post\/571342\/\" rel=\"noopener noreferrer nofollow\"> \u0432\u043e\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f<\/a>  \u043e\u0442 <a class=\"mention\" href=\"\/users\/novar\">@novar<\/a>. <\/p>\n<p>\u041d\u0443 \u0430 \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043f\u0443\u0441\u0442\u044f \u0432\u044b\u0448\u0435\u043b <a href=\"https:\/\/habr.com\/ru\/post\/572052\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u043d\u0438\u044f <\/a>\u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0442 <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a>.<\/p>\n<p>\u0418 \u043e\u0431\u043e\u0436\u0435\u043c\u043e\u0439, \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f. \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e, <a href=\"\/users\/psyhaste\" rel=\"noopener noreferrer nofollow\">@PsyHaSTe<\/a>, \u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0432\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a. \u041f\u0438\u0448\u0438 \u0435\u0449\u0435, \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u0432\u0441\u0435\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043a\u0440\u0443\u0442\u0438\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0430\u043c \u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u043d\u0430\u0447\u0435 (\u0442\u0430\u043a \u0431\u044b\u0432\u0430\u0435\u0442, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443). \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a. <\/p>\n<pre><code class=\"cs\">        public ScheduleInterval(int begin, int end)         {             Begin = begin;             End = end;             _allowedPoints = new bool[end - begin + 1];         }<\/code><\/pre>\n<hr\/>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0438 \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b <code>[0,999]<\/code>, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u043c.  \u041c\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0445\u043e\u043c\u044f\u043a \u0441\u0445\u0432\u0430\u0442\u0438\u043b\u0441\u044f \u0437\u0430 \u0441\u0435\u0440\u0434\u0446\u0435. \u0412 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 cron \u0438 Quartz \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u0435\u043d\u0435\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430: \u0432 \u043a\u0440\u043e\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e \u043c\u0438\u043d\u0443\u0442\u044b, \u0430 \u0432 \u043a\u0432\u0430\u0440\u0446\u0435 \u0434\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u041d\u043e \u0443 \u043d\u0430\u0441 &#8212; \u0442\u044b\u0441\u044f\u0447\u0438 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434. <\/p>\n<p>\u041b\u0430\u0434\u043d\u043e, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f BitSet, \u043d\u043e \u043f\u043e\u0442\u043e\u043c, \u0432 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0442\u0438\u043f\u0430 <code>0:0:0.999<\/code>  \u043c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e 1000 \u0440\u0430\u0437 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0431\u0438\u0442\u0441\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u0430\u044f. \u041d\u043e \u0432\u0435\u0434\u044c \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0437\u043d\u0430\u0435\u043c: \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 999.   <\/p>\n<p>\u041d\u0443 \u0430 \u043f\u043e\u0441\u043b\u0435 \u044f \u0433\u043b\u044f\u043d\u0443\u043b <code>Closest&lt;T><\/code>, \u0433\u0434\u0435 \u043a\u043e\u0434 \u0432\u0435\u0437\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0439, \u043d\u043e \u0443\u0436 \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443, \u0438 \u0440\u0443\u043a\u0430 \u0441\u0430\u043c\u0430 \u043f\u043e\u0442\u044f\u043d\u0443\u043b\u0430\u0441\u044c \u0433\u043b\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0443 \u0441\u0430\u043c\u043e\u0433\u043e: \u043a\u0440\u0438\u0442\u0438\u043a\u0443\u0435\u0448\u044c &#8212; \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0439.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>\u0414\u0430\u043d cron-\u043f\u043e\u0434\u043e\u0431\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0433\u043e\u0434\u044b, \u043c\u0435\u0441\u044f\u0446\u0430, \u0434\u043d\u0438, \u0434\u043d\u0438 \u043d\u0435\u0434\u0435\u043b\u0438, \u0447\u0430\u0441\u044b, \u043c\u0438\u043d\u0443\u0442\u044b, \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b:<\/p>\n<p><code>yyyy.MM.dd w HH:mm:ss.fff<\/code><\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 &#171;10 \u0443\u0442\u0440\u0430 \u0438 10 \u0432\u0435\u0447\u0435\u0440\u0430 \u0441 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a\u0430 \u043f\u043e \u043f\u044f\u0442\u043d\u0438\u0446\u0443&#187; \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p><code>*.*.* 1-5 10,22:0:0.000<\/code><\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0438 \u0443\u043c\u0435\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e<\/p>\n<ul>\n<li>\n<p>\u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043f\u043e\u0434 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435. <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043f\u043e\u0434 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435. <\/p>\n<\/li>\n<\/ul>\n<h2>\u0427\u0430\u0441\u0442\u044c 0: \u0412\u044b\u0431\u043e\u0440 \u044f\u0437\u044b\u043a\u0430<\/h2>\n<p>\u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430 C#, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u0441\u0442\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0443\u043c\u0430\u043b: \u0421++ \u044f \u0437\u043d\u0430\u044e \u043b\u0443\u0447\u0448\u0435 (\u0445\u043e\u0442\u044f \u0421++ \u0438 &#171;\u0437\u043d\u0430\u044e&#187; &#8212; \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435 \u0441\u0435\u0431\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435), \u0434\u0430 \u0438 pet-\u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u044e\u0431\u0438\u0448\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043b\u044e\u0431\u043e\u0432\u044c \u044d\u0442\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D0%BE%D0%BA%D0%B3%D0%BE%D0%BB%D1%8C%D0%BC%D1%81%D0%BA%D0%B8%D0%B9_%D1%81%D0%B8%D0%BD%D0%B4%D1%80%D0%BE%D0%BC\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c\u0441\u043a\u0438\u0439 \u0441\u0438\u043d\u0434\u0440\u043e\u043c<\/a>.  \u041d\u0443 \u0438, \u0435\u0441\u043b\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0447\u0435\u0441\u0442\u043d\u043e, \u043d\u0430 \u0444\u043e\u043d\u0435 \u043c\u043e\u043d\u0430\u0434 \u043e\u0442 <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a> \u043c\u043e\u0439 \u0421# \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0439.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c VS, \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043a\u0440\u0435\u0441\u0442\u0430\u0445, \u043f\u0440\u0438\u0441\u0442\u0435\u0433\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043f\u043e\u0433\u043d\u0430\u043b\u0438.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 1: \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043d\u0435 \u0441\u0432\u0435\u0440\u0445\u0443, \u0430 \u0441\u043d\u0438\u0437\u0443: \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0431\u0435 \u043e\u0431\u0445\u043e\u0434 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0434\u043d\u0435\u0439, \u0447\u0430\u0441\u043e\u0432 \u0438 \u0442.\u0434.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434 &#171;\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439&#187;: \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0431\u0435\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 ( <code>10-20\/3<\/code> &#8212; \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435, <code>1,5,8<\/code> &#8212; \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435).  \u0418 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0445\u043e\u0434 \u0432\u043f\u0435\u0440\u0435\u0434: \u043e\u0431\u0445\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043d\u0435 \u0442\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u043e: \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435(\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430),  \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c.<\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043a\u0438\u0439 &#171;\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439&#187;. \u0427\u0442\u043e\u0431\u044b \u043c\u044b \u0448\u043b\u0438 \u043f\u043e &#171;\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445&#187;, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0432\u0441\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.  \u0414\u043b\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c: \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 <code>5<\/code>, \u0442\u043e \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 5, \u0430 \u043f\u043e\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043c,  \u0447\u0442\u043e \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 <code>1-5<\/code>, \u0442\u043e \u043c\u044b \u043e\u0442\u0434\u0430\u0435\u043c 1, \u043f\u043e\u0442\u043e\u043c 2, &#8230; , \u043f\u043e\u0442\u043e\u043c 5, \u0430 \u043f\u043e\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u0430 \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c. <\/p>\n<p>\u041f\u043b\u044e\u0441, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c &#171;\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#187; \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 &#171;\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u044b&#187; \u0447\u0438\u0441\u043b\u043e\u043c (\u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 3-\u0439 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d <code>1-5<\/code>),  \u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 &#171;\u043d\u0430\u0447\u0430\u043b\u043e&#187; (\u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0447\u0430\u0441, \u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u0438\u043d\u0443\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e).  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u043c\u0430\u044f. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0421++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0437\u0430 \u0436\u0438\u0437\u043d\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c 3 \u0432\u0435\u0449\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u0437\u0440\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u044b\u0442\u0430\u0435\u0448\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0442 \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 &#171;\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438&#187;:<\/p>\n<pre><code class=\"cpp\">using Unit = int16_t;  class ISequence {  public:   \/\/ Setup condition with current value   virtual void init(const Unit current) = 0;   \/\/ Reset condition to the beginning   virtual void reset() = 0;   \/\/ returns false if there is no current value   virtual operator bool() const = 0;   \/\/ returns current value   virtual Unit operator*() const = 0;   \/\/ iterate to the next value   virtual ISequence&amp; operator++() = 0; }; <\/code><\/pre>\n<p><em>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f <\/em><code>ICondition<\/code><em>, \u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u043b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/em> <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">  AnyDay day;   day.init(12);   while (day) {     std::cout &lt;&lt; \"AnyDay: \" &lt;&lt; *day &lt;&lt; std::endl;     ++day;   }      Range r(9, 17);   r.init(12);   while (r) {     std::cout &lt;&lt; \"Range: \" &lt;&lt; *r &lt;&lt; std::endl;     ++r;   }         RangeStep rs(4, 10, 20);   rs.init(12);   while (rs) {     std::cout &lt;&lt; \"RangeStep: \" &lt;&lt; *rs &lt;&lt; std::endl;     ++rs;   } <\/code><\/pre>\n<p>\u0412 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 <code>while (r)<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#171;\u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430&#187; <code>*r<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435,  \u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 <code>++r<\/code> \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0430\u0440\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ header template &lt;Unit Begin, Unit End> class Any : public ISequence {   typedef Any&lt;Begin, End> self_t;   protected:   Unit _current;   public:   Any();    \/*overrides*\/   void init(const Unit current) override final;   void reset() override final;   operator bool() const override final;   Unit operator*() const override final;   self_t&amp; operator++() override; };  using AnyYear = Any&lt;2000, 2100>; using AnyMonth = Any&lt;1, 12>; using AnyDay = Any&lt;1, 31>; <\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ source template &lt;Unit Begin, Unit End>  \/\/ Any template &lt;Unit Begin, Unit End> Any&lt;Begin, End>::Any() : _current(Begin) {}  template &lt;Unit Begin, Unit End> void Any&lt;Begin, End>::init(const Unit current) {   _current = current; }  template &lt;Unit Begin, Unit End> void Any&lt;Begin, End>::reset() {   _current = Begin; }  template &lt;Unit Begin, Unit End> Any&lt;Begin, End>::operator bool() const {   return _current &lt;= End; }  template &lt;Unit Begin, Unit End> Unit Any&lt;Begin, End>::operator*() const {   return _current; }  template &lt;Unit Begin, Unit End> typename Any&lt;Begin, End>::self_t&amp; Any&lt;Begin, End>::operator++() {   ++_current;   return *this; }   template class Any&lt;2000, 2100>; template class Any&lt;1, 12>; template class Any&lt;1, 31>; <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435: \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e. \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430, \u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 (\u044d\u0442\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&#187;, \u043d\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d&#187;: \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d <code>10-20<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 5).  <br \/>\u041c\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u043c \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0435 &#171;\u0442\u0435\u043a\u0443\u0449\u0435\u0435&#187; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u043b\u043e \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043d\u043e\u0433\u043e.  \u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 (\u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0421++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442)<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Begin \u0438 End &#8212; \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <strong>\u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong> \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0438\u043c\u0438: \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e,  \u0434\u043b\u044f \u0438\u0445 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 (\u043d\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430: \u0433\u0434\u0435-\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u043e\u043d\u0438 \u0435\u0441\u0442\u044c), \u0438 \u0442.\u0434. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, AnyYear, AnyMonth, AnyDay &#8212; \u044d\u0442\u043e \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0434\u0438\u043d \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f: \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438(definition), \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f (declaration),  \u0430 \u0432 cpp \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 &#8212; \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438.  \u0422\u0430\u043a\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441. <\/p>\n<p>\u0417\u0430\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Any&lt;0, 17>, \u0441\u0431\u043e\u0440\u043a\u0430 \u0443\u043f\u0430\u0434\u0435\u0442: \u043e\u043d \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 Any&lt;0, 17>.<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u0441\u0442\u044b \u043a \u043d\u0430\u0448\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <\/p>\n<pre><code class=\"cpp\">namespace UnitTests { typedef std::vector&lt;scheduling::Unit> Units;  TEST_CLASS(TestConditions) {     static void FillResults(Units&amp; units, scheduling::ISequence&amp; condition) {       units.clear();       while (condition) {         units.push_back(*condition);         ++condition;       }     }     public:              TEST_METHOD(TestYears)     {         Units units;         scheduling::AnyYear condition;          condition.init(2020);         FillResults(units, condition);          Units expected;         for (int i = 2020; i &lt;= 2100; ++i) {             expected.push_back(i);         }          Assert::IsTrue(units == expected);     } }; }  \/\/ namespace UnitTests <\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0436\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e, \u0443\u0442\u043e\u0447\u043d\u044e \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430. <\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430&#187; \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0444\u043b\u0430\u0433. \u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u043e\u043c <u>\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043c<\/u> \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0444\u043b\u0430\u0433 \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f (\u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 &#171;\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438&#187;, \u0438 \u043c\u044b \u0435\u0433\u043e \u0432\u0435\u0440\u043d\u0435\u043c). <\/p>\n<p>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0431\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433. <\/p>\n<pre><code class=\"cpp\">\/\/ Const Const::Const(const Unit val) : _val(val), _active(true) {} void Const::init(const Unit current) { _active = current &lt;= _val; } void Const::reset() { _active = true; } Const::operator bool() const { return _active; } Unit Const::operator*() const { return _val; } Const&amp; Const::operator++() {   _active = false;   return *this; }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u0441 \u0448\u0430\u0433\u043e\u043c&#187; \u043c\u043e\u0436\u043d\u043e \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439:  \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \u0442\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438 \u0432 &#171;\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435&#187;.<\/p>\n<pre><code class=\"cpp\"> \/\/ RangeStep RangeStep::RangeStep(const Unit step, const Unit from, const Unit to)     : Range(from, to), _step(step) {}  void RangeStep::init(const Unit current) {   if (current &lt;= _from) {     _current = _from;     return;   }   _current = current;   auto diffmod = (_current - _from) % _step;   if (diffmod != 0) {     _current += _step - diffmod;   } }  RangeStep&amp; RangeStep::operator++() {   _current += _step;   return *this; }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/ header #pragma once #include &lt;cstdint>  namespace scheduling {  using Unit = int16_t;  class ISequence {  public:   \/\/ Setup condition with current value   virtual void init(const Unit current) = 0;   \/\/ Reset condition to the beginning   virtual void reset() = 0;   \/\/ returns false if there is no next value   virtual operator bool() const = 0;   \/\/ returns next available value   virtual Unit operator*() const = 0;   \/\/ iterates to the next iterator   virtual ISequence&amp; operator++() = 0; };  template &lt;Unit Begin, Unit End> class Any : public ISequence {   typedef Any&lt;Begin, End> self_t;   protected:   Unit _current;   public:   Any();    \/*overrides*\/   void init(const Unit current) override;   void reset() override final;   operator bool() const override final;   Unit operator*() const override final;   self_t&amp; operator++() override; };  class Const final : public ISequence {   const Unit _val;   bool _active;   public:   explicit Const(const Unit val);    \/*overrides*\/   void init(const Unit current) override final;   void reset() override final;   operator bool() const override final;   Unit operator*() const override final;   Const&amp; operator++() override final; };  class Range : public ISequence {   const Unit _to;   protected:   const Unit _from;   protected:   Unit _current;   public:   Range(const Unit from, const Unit to);    \/*overrides*\/   void init(const Unit current) override;   void reset() override final;   operator bool() const override final;   Unit operator*() const override final;   Range&amp; operator++() override; };  template &lt;Unit Begin, Unit End> class AnyStep final : public Any&lt;Begin, End> {   const Unit _step;   public:   explicit AnyStep(Unit step);    \/*overrides*\/   void init(const Unit current) override final;   AnyStep&amp; operator++() override final; };  class RangeStep final : public Range {   const Unit _step;   public:   explicit RangeStep(const Unit step, const Unit from, const Unit to);    \/*overrides*\/   void init(const Unit current) override final;   RangeStep&amp; operator++() override final; };  using AnyYear = Any&lt;2000, 2100>; using AnyMonth = Any&lt;1, 12>; using AnyDay = Any&lt;1, 31>; using AnyHour = Any&lt;0, 23>; using AnyMinute = Any&lt;0, 59>; using AnySecond = Any&lt;0, 59>; using AnyMillisecond = Any&lt;0, 999>;  using LastDay = Any&lt;28, 31>;  using AnyStepYear = AnyStep&lt;2000, 2100>; using AnyStepMonth = AnyStep&lt;1, 12>; using AnyStepDay = AnyStep&lt;1, 31>; using AnyStepHour = AnyStep&lt;0, 23>; using AnyStepMinute = AnyStep&lt;0, 59>; using AnyStepSecond = AnyStep&lt;0, 59>; using AnyStepMillisecond = AnyStep&lt;0, 999>;    }  \/\/ namespace scheduling<\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ source #include \"pch.h\" #include \"framework.h\"  #include &lt;conditions.h> #include &lt;algorithm>  namespace scheduling {  \/\/ Any template &lt;Unit Begin, Unit End> Any&lt;Begin, End>::Any() : _current(Begin) {}  template &lt;Unit Begin, Unit End> void Any&lt;Begin, End>::init(const Unit current) {   \/\/ NB: exctra check. We could assume current >= Begin   _current = std::max(current, Begin); }  template &lt;Unit Begin, Unit End> void Any&lt;Begin, End>::reset() {   _current = Begin; }  template &lt;Unit Begin, Unit End> Any&lt;Begin, End>::operator bool() const {   return _current &lt;= End; }  template &lt;Unit Begin, Unit End> Unit Any&lt;Begin, End>::operator*() const {   return _current; }  template &lt;Unit Begin, Unit End> typename Any&lt;Begin, End>::self_t&amp; Any&lt;Begin, End>::operator++() {   ++_current;   return *this; }  \/\/ Const Const::Const(const Unit val) : _val(val), _active(true) {} void Const::init(const Unit current) { _active = current &lt;= _val; } void Const::reset() { _active = true; } Const::operator bool() const { return _active; } Unit Const::operator*() const { return _val; } Const&amp; Const::operator++() {   _active = false;   return *this; }  \/\/ Range Range::Range(const Unit from, const Unit to)     : _to(to), _from(from), _current(from) {} void Range::init(const Unit current) { _current = std::max(current, _from); } void Range::reset() { _current = _from; } Range::operator bool() const { return _current &lt;= _to; } Unit Range::operator*() const { return _current; } Range&amp; Range::operator++() {   ++_current;   return *this; }  \/\/ Any step template &lt;Unit Begin, Unit End> AnyStep&lt;Begin, End>::AnyStep(Unit step) : _step(step) {}  \/\/ todo: copypast with Range template &lt;Unit Begin, Unit End> void AnyStep&lt;Begin, End>::init(const Unit current) {   if (current &lt;= Begin) {     Any&lt;Begin, End>::_current = Begin;     return;   }   Any&lt;Begin, End>::_current = current;    auto diffmod = (current - Begin) % _step;   if (diffmod != 0) {     Any&lt;Begin, End>::_current += _step - diffmod;   } }  template &lt;Unit Begin, Unit End> AnyStep&lt;Begin, End>&amp; AnyStep&lt;Begin, End>::operator++() {   Any&lt;Begin, End>::_current += _step;   return *this; }   \/\/ RangeStep RangeStep::RangeStep(const Unit step, const Unit from, const Unit to)     : Range(from, to), _step(step) {}  void RangeStep::init(const Unit current) {   if (current &lt;= _from) {     _current = _from;     return;   }   _current = current;   auto diffmod = (_current - _from) % _step;   if (diffmod != 0) {     _current += _step - diffmod;   } }  RangeStep&amp; RangeStep::operator++() {   _current += _step;   return *this; }  template class Any&lt;2000, 2100>; template class Any&lt;1, 12>; template class Any&lt;1, 31>; template class Any&lt;0, 23>; template class Any&lt;0, 59>; template class Any&lt;0, 999>;  template class Any&lt;28, 31>;  template class AnyStep&lt;2000, 2100>; template class AnyStep&lt;1, 12>; template class AnyStep&lt;1, 31>; template class AnyStep&lt;0, 23>; template class AnyStep&lt;0, 59>; template class AnyStep&lt;0, 999>; }  \/\/ namespace scheduling<\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0427\u0430\u0441\u0442\u044c 2: \u041a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440<\/h2>\n<p>\u041d\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435. <\/p>\n<p>\u0421 \u044d\u0442\u0438\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/www.geeksforgeeks.org\/heap-data-structure\/\" rel=\"noopener noreferrer nofollow\">&#171;\u043a\u0443\u0447\u0430&#187; (heap)<\/a>. <\/p>\n<p><em>\u041a\u0443\u0447\u0430 &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 O(1) \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443\/\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u043c\u0443\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. &#171;\u041e\u043a\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435&#187; &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0443\u0447\u0438 &#8212; \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0437\u0430 O(n). <\/p>\n<p><\/em>\u041f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0443\u0447\u0438 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0421++: \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0443\u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439\/\u0434\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. <\/p>\n<p>\u0418\u0434\u0435\u044f \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f: \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0432 <em>\u043a\u0443\u0447\u0443<\/em>.  &#171;\u0422\u0435\u043a\u0443\u0449\u0435\u0435&#187; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430 O(1) \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b <em>\u043a\u0443\u0447\u0438<\/em>: \u043d\u0430\u043c \u0432\u0435\u0434\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0438\u0437 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>\u0427\u0442\u043e \u043d\u0430\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0435?  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u0442\u0430\u0449\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u043a\u0443\u0447\u0438. \u0412\u044b\u0437\u043e\u0432\u0435\u043c \u0443 \u043d\u0435\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442, \u0438 \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0439 \u0435\u0449\u0435 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0437\u0430\u0441\u0443\u043d\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043a\u0443\u0447\u0443.  \u041d\u0435 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c &#8212; \u043d\u0435 \u0437\u0430\u0441\u0443\u043d\u0435\u043c. <\/p>\n<p>\u041d\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u043a\u0443\u0447\u0430 \u043e\u043f\u0443\u0441\u0442\u0435\u0435\u0442, \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0432\u043e \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445.<\/p>\n<p>\u0415\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0442\u043e\u043d\u043a\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u043d\u0430\u0448\u0438 &#171;\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438&#187; \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0442\u044c\u0441\u044f. \u042d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>10-20,*\/3<\/code>. \u041d\u043e \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 &#171;\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0439&#187; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b  \u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0438\u0437 \u043a\u0443\u0447\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e &#171;\u0442\u043e\u043f\u043e\u0432\u0443\u044e&#187; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0438 \u0432\u0441\u0435 \u0442\u0435, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<p>\u041d\u0443 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u044b: \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#8212; \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0431\u044b \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u0434\u0430\u043b \u0447\u0435\u0442\u043a\u043e\u0435  \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u044b \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0432\u0441\u0435\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c  \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a \u0432\u043e \u043c\u043d\u0435 \u043b\u0435\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440\u0430 \u043e\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. <\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">namespace scheduling {  class Combiner final : public ISequence {   typedef std::unique_ptr&lt;ISequence> condition_ptr;   typedef std::vector&lt;condition_ptr> Conditions;    Conditions _conditions;   Conditions::iterator _heapEnd;    static bool heap_cmp(const condition_ptr&amp; l, const condition_ptr&amp; r);    void makeHeap();   public:   Combiner();   \/\/ todo: move to constructor??   void emplace(condition_ptr&amp;&amp; ptr);    \/\/ Inherited via ICondition   virtual void init(const Unit current) override;   virtual void reset() override;   virtual operator bool() const override;   virtual Unit operator*() const override;   virtual Combiner&amp; operator++() override; };  }  \/\/ namespace scheduling<\/code><\/pre>\n<pre><code class=\"cpp\">#include &lt;algorithm>  namespace scheduling {  bool Combiner::heap_cmp(const condition_ptr&amp; l, const condition_ptr&amp; r) {   return **l > **r; }  void Combiner::makeHeap() {   \/\/ filter conditions without value   _heapEnd = std::partition(_conditions.begin(), _conditions.end(),                             [](const auto&amp; c) { return bool(*c); });    \/\/ heap from what rest   if (_conditions.begin() != _heapEnd) {     std::make_heap(_conditions.begin(), _heapEnd, heap_cmp);   } }  Combiner::Combiner(): _heapEnd(_conditions.begin()) {}  void Combiner::emplace(condition_ptr&amp;&amp; ptr) { _conditions.emplace_back(std::move(ptr)); }  void Combiner::init(const Unit current) {   for (auto&amp; c : _conditions) {     c->init(current);   }   makeHeap(); }  void Combiner::reset() {   for (auto&amp; c : _conditions) {     c->reset();   }   makeHeap(); }  Combiner::operator bool() const { return _heapEnd != _conditions.begin(); }  Unit Combiner::operator*() const { return **_conditions.front(); }  Combiner&amp; Combiner::operator++() {   Unit val = **_conditions.front();   while (_conditions.begin() != _heapEnd &amp;&amp; val == **_conditions.front()) {     std::pop_heap(_conditions.begin(), _heapEnd, heap_cmp);     --_heapEnd;     ++(**_heapEnd);     if (**_heapEnd) {       ++_heapEnd;       std::push_heap(_conditions.begin(), _heapEnd, heap_cmp);     }   }   return *this; }  }  \/\/ namespace scheduling <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432\u043e\u0442 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435:<\/p>\n<pre><code class=\"cpp\">_heapEnd = std::partition(_conditions.begin(), _conditions.end(),                             [](const auto&amp; c) { return bool(*c); }); <\/code><\/pre>\n<p>\u041e\u043d\u0430 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432\u0430\u043b\u0438\u0434\u043d\u0443\u044e \u043a\u0443\u0447\u0443. <\/p>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (\u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u044b):<\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0435\u0441\u0442\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">  TEST_METHOD(TestConstCombiner) {     Units units;      \/\/ 3,6,15,2,7,28     scheduling::Combiner combiner;     combiner.emplace(std::make_unique&lt;scheduling::Const>(3));     combiner.emplace(std::make_unique&lt;scheduling::Const>(6));     combiner.emplace(std::make_unique&lt;scheduling::Const>(15));     combiner.emplace(std::make_unique&lt;scheduling::Const>(2));     combiner.emplace(std::make_unique&lt;scheduling::Const>(7));     combiner.emplace(std::make_unique&lt;scheduling::Const>(28));      combiner.init(6);     FillResults(units, combiner);     Assert::IsTrue(units == Units{6, 7, 15, 28});      combiner.reset();     FillResults(units, combiner);     Assert::IsTrue(units == Units{2, 3, 6, 7, 15, 28});      combiner.init(26);     FillResults(units, combiner);     Assert::IsTrue(units == Units{28});      combiner.init(30);     FillResults(units, combiner);     Assert::IsTrue(units == Units{});      combiner.reset();     FillResults(units, combiner);     Assert::IsTrue(units == Units{2, 3, 6, 7, 15, 28});    }        TEST_METHOD(TestComplexCombiner) {     Units units;      \/\/ *\/10, 11-14, 16-28\/5, 23     scheduling::Combiner combiner;     combiner.emplace(std::make_unique&lt;scheduling::AnyStepMinute>(10));     combiner.emplace(std::make_unique&lt;scheduling::Range>(11, 14));     combiner.emplace(std::make_unique&lt;scheduling::RangeStep>(5, 16, 28));     combiner.emplace(std::make_unique&lt;scheduling::Const>(23));      combiner.init(5);     FillResults(units, combiner);     Assert::IsTrue(units ==                    Units{10, 11, 12, 13, 14, 16, 20, 21, 23, 26, 30, 40, 50});      combiner.reset();     FillResults(units, combiner);     Assert::IsTrue(units ==                    Units{0, 10, 11, 12, 13, 14, 16, 20, 21, 23, 26, 30, 40, 50});      combiner.init(13);     FillResults(units, combiner);     Assert::IsTrue(units == Units{13, 14, 16, 20, 21, 23, 26, 30, 40, 50});      combiner.init(16);     FillResults(units, combiner);     Assert::IsTrue(units == Units{16, 20, 21, 23, 26, 30, 40, 50});      combiner.init(17);     FillResults(units, combiner);     Assert::IsTrue(units == Units{20, 21, 23, 26, 30, 40, 50});      combiner.init(27);     FillResults(units, combiner);     Assert::IsTrue(units == Units{30, 40, 50});   }  <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c: \u044d\u0442\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c,  \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043b\u044f \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u0438 \u0434\u043b\u044f \u0447\u0430\u0441\u043e\u0432, \u0438 \u0434\u043b\u044f \u0441\u0435\u043a\u0443\u043d\u0434, \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0434\u043d\u0435\u0439 \u043d\u0435\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0412\u0440\u0435\u043c\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0435\u0434\u0438\u043d\u043e.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 3: \u0413\u043b\u0443\u043f\u0435\u043d\u044c\u043a\u0438\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043e \u0434\u043d\u044f\u043c \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0435\u0442, \u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0441\u044f\u0446\u0435 31 \u0434\u0435\u043d\u044c. (^\u25d5.\u25d5^)<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0448\u0443\u0442\u043a\u0430, \u043c\u044b \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u043f\u0438\u043b\u0438\u043c \u043d\u0430\u043f\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u043a\u043e\u043d\u0434\u0438\u0446\u0438\u0438:  \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0438\u0448\u0443\u0442\u0441\u044f, \u043f\u043b\u043e\u0445\u043e \u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f, \u043f\u043b\u043e\u0445\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0438 \u0442.\u043f.  \u041d\u0430\u0434\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u043a\u0443\u0441\u043e\u0447\u043a\u0438. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0433\u043b\u0443\u043f\u0435\u043d\u044c\u043a\u0438\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f.<\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;chrono> #include &lt;combiner.h>  namespace scheduling {  class Iter {  public:   typedef std::chrono::system_clock::time_point TimePoint;   typedef std::chrono::system_clock::duration Duration;    Combiner yearsSequence;   Combiner monthsSequence;   Combiner daysSequence;    Combiner hoursSequence;   Combiner minutesSequence;   Combiner secondsSequence;   Combiner millisecondsSequence;    \/\/ init with current date   void init(const TimePoint&amp; current);   \/\/ returns false if there is no next value   operator bool() const;   \/\/ returns next available value   TimePoint operator*() const;   \/\/ iterates to the next time point   Iter&amp; operator++(); };  }  \/\/ namespace scheduling<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e: \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0435\u0440\u043e\u0432, \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u0432 \u0442\u0438\u043f \u0434\u0430\u0442\u044b. \u041f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#8212; \u0442\u0443\u0442 \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0434\u0430\u0442\u0443 \u0438  \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0435\u0440 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e (\u044d\u0442\u043e \u0431\u0430\u0433, \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043d\u043e \u043c\u044b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u0432 \u0447\u0430\u0441\u0442\u0438 5).<\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f? <\/p>\n<p>\u0410 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e: \u043c\u044b \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c <em>\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/em>. \u0423\u0434\u0430\u043b\u043e\u0441\u044c &#8212; \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e. \u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c &#8212; \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 &#171;\u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&#187; \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <em>\u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/em>.  \u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435, \u0434\u043e \u0433\u043e\u0434\u0430: \u0433\u043e\u0434 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f &#8212; \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u0448\u043b\u0438 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0433\u043e\u0434\u0430, \u0442\u043e \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041e! \u0410 \u0432\u043e\u0442 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<pre><code class=\"cpp\">Iter&amp; Iter::operator++() {   for (auto* s : std::vector&lt;Combiner*>{            &amp;millisecondsSequence,            &amp;secondsSequence,            &amp;minutesSequence,            &amp;hoursSequence,            &amp;daysSequence,            &amp;monthsSequence,     }) {     ++(*s);     \/\/ if sequence have next value -found     if (*s) {       return *this;     }      s->reset();   }    ++yearsSequence,   return *this; }  Iter::operator bool() const { return *yearsSequence; }<\/code><\/pre>\n<p>\u041c\u043c\u043c\u043c. \u041f\u043e\u0445\u043e\u0436\u0435 \u0447\u0442\u043e \u0438\u043c\u0435\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0433\u043b\u0443\u043f\u0435\u043d\u044c\u043a\u0438\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 4: \u0418\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0430\u043a-\u0438-\u0441\u044f\u043a (\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0434\u043d\u0435\u0439 \u043c\u0435\u0441\u044f\u0446\u0430)<\/h2>\n<p>\u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u043f\u0440\u0438\u0448\u043b\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435,  \u0447\u0442\u043e C++20 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430 VS \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u043e\u043e\u043e\u043e\u043e\u0447\u0435\u043d\u044c \u0443\u0441\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0442\u043e\u0439 \u0440\u0435\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0441\u0432\u043e\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 boost (\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (\u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c&#8230;.)).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043a\u0430\u043a-\u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 31 \u0444\u0435\u0432\u0440\u0430\u043b\u044f \u0438 \u0438\u0436\u0435 \u0441 \u043d\u0438\u043c\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u044d\u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e: \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u043d\u0435\u0439, \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0438 \u043b\u0435\u0442, \u0430 \u044d\u0442\u043e \u043f\u043b\u043e\u0445\u043e. <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438: \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0434\u0430\u0442\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f &#8212; \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e (\u043c\u044b \u0443\u0436\u0435 \u0432 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c \u0434\u043d\u0435), \u0435\u0441\u043b\u0438 \u043d\u0435\u0442: \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u0442\u0443,  \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0432\u0430\u043b\u0438\u0434\u043d\u0430 \u043b\u0438 \u043e\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 &#8212; \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u0442\u0443 \u0441\u043d\u043e\u0432\u0430 (\u0434\u0430, \u043c\u044b \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c,  <strong>\u043d\u043e \u0432\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u044d\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435<\/strong>).<\/p>\n<p>\u041c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c &#171;\u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432&#187; \u043d\u0430\u0448\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u0438\u0445 \u043d\u0430 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u043e\u0441\u0442\u044c.  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0435\u043a\u0438\u0439 \u0433\u0438\u0431\u0440\u0438\u0434 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432.<\/p>\n<pre><code class=\"cpp\"> Iter&amp; Iter::operator++() {   \/\/ If found next time at the same date - done   if (increment_time()) {     return *this;   }    increment_date();    \/\/ Increment date until the end of iterator or until first valid date is found   while (bool(*this) &amp;&amp; !is_valid_date()) {     increment_date();   }    return *this; }  bool Iter::increment_sector(const std::vector&lt;Combiner*>&amp; sector) {   for (auto* s : sector) {     ++(*s);     \/\/ if sequence have next value: found next valid value     if (*s) {       return true;     }     s->reset();   }    \/\/ Next value was not found: reset all time sequence   return false; }  bool Iter::is_valid_date() {   return boost::gregorian::gregorian_calendar::end_of_month_day(              *yearsSequence, *monthsSequence) >= *daysSequence; }  bool Iter::increment_time() {   return increment_sector(std::vector&lt;Combiner*>{       &amp;millisecondsSequence,       &amp;secondsSequence,       &amp;minutesSequence,       &amp;hoursSequence,   }); }  bool Iter::increment_date() {   return increment_sector(std::vector&lt;Combiner*>{       &amp;daysSequence,       &amp;monthsSequence,       &amp;yearsSequence,   }); } <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043d\u0430\u043c \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0441\u044f \u0431\u0443\u0441\u0442: <code>end_of_month_day<\/code>.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 5: \u0423\u043c\u043d\u0435\u043d\u044c\u043a\u0438\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 (\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f)<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0441\u0430\u043c\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e: \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439.  \u0417\u0434\u0435\u0441\u044c \u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0441 <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a>: \u0438\u043d\u043e\u0433\u0434\u0430 goto \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d.  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0431\u043b\u043e\u043a\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0446\u0438\u043a\u043b\u043e\u0432.  \u041f\u0440\u0430\u0432\u0434\u0430 \u0443 \u043c\u0435\u043d\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<pre><code class=\"cpp\">void Iter::init(const DateTime&amp; current) {   \/\/ NB: suppose to use std::chrono::year_month_day   \/\/     and std::chrono::hh_mm_ss   \/\/ But VS does not support C++20 yet     \/\/ reset all   for (auto* s : std::vector&lt;Combiner*>{            &amp;millisecondsSequence,            &amp;secondsSequence,            &amp;minutesSequence,            &amp;hoursSequence,            &amp;daysSequence,            &amp;monthsSequence,            &amp;yearsSequence,        }) {     s->reset();   }    \/\/ NB: init block    {     yearsSequence.init(current.date.years);     if (!yearsSequence) goto end_init_block;     if (*yearsSequence != current.date.years) goto end_init_block;       for (auto [seq, val] : std::vector&lt;std::pair&lt;Combiner*, Unit>>{              {&amp;monthsSequence, current.date.months},              {&amp;daysSequence, current.date.days}}) {       seq->init(val);       if (!*seq) goto end_init_block;       if (**seq != val) goto end_init_block;     }      if (!is_valid_date()) goto end_init_block;      for (auto [seq, val] : std::vector&lt;std::pair&lt;Combiner*, Unit>>{              {&amp;hoursSequence, current.time.hours},              {&amp;minutesSequence, current.time.minutes},              {&amp;secondsSequence, current.time.seconds},              {&amp;millisecondsSequence, current.time.milliseconds}}) {       seq->init(val);       if (!*seq) goto end_init_block;       if (**seq != val) goto end_init_block;     }   }   end_init_block:     \/\/ Fix combiners without valid value (max one at a time)   for (auto [seq, prev] : std::vector&lt;std::pair&lt;Combiner*, Combiner*>>{            {&amp;millisecondsSequence, &amp;secondsSequence},            {&amp;secondsSequence, &amp;minutesSequence},            {&amp;minutesSequence, &amp;hoursSequence},            {&amp;hoursSequence, &amp;daysSequence},            {&amp;daysSequence, &amp;monthsSequence},            {&amp;monthsSequence, &amp;yearsSequence},        }) {     if (!*seq) {       seq->reset();       ++(*prev);     }   }      \/\/ Increment until valid date   while (bool(*this) &amp;&amp; !is_valid_date()) {     increment_date();   }  } <\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u043e\u0434 \u043f\u043e \u0431\u043b\u043e\u043a\u0430\u043c.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0447\u0430\u0441\u044b \u0447\u0438\u0441\u043b\u043e\u043c 3, \u0430 \u0443 \u043d\u0430\u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>5,6<\/code>, \u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 5. \u0417\u043d\u0430\u0447\u0438\u0442 \u043c\u0438\u043d\u0443\u0442\u044b, \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u0434\u0440 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 &#171;\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435&#187; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0447\u0435\u043c \u0431\u044b \u043c\u044b \u043d\u0435 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043c\u044b \u0443\u0436\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0447\u0430\u0441\u0443. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0431\u0440\u043e\u0448\u0435\u043d\u044b &#8212; \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443. <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0431\u043b\u043e\u043a \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0427\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435?<\/p>\n<ol>\n<li>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438. \u0422\u043e\u0433\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0434\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c: \u0441\u043c \u0432\u044b\u0448\u0435. <\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u0443\u044e \u0434\u0430\u0442\u0443. <\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432\u043d\u0435 \u0431\u043b\u043e\u043a\u0430 (\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#171;10-20&#187; \u0447\u0438\u0441\u043b\u043e\u043c &#171;30&#187;).  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c  (\u0443\u0441\u043b\u043e\u0432\u0438\u0435 &#171;<em>.10.<\/em>&#187; \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 &#171;2010.11.1&#187; \u0434\u043e\u043b\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 2011 \u0433\u043e\u0434)<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0431\u043b\u043e\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f 3.  <br \/>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0431\u043b\u043e\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f 2.<\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043b. \u0421\u0443\u0434\u044f \u043f\u043e \u0442\u0435\u0441\u0442\u0430\u043c, \u043e\u043d\u043e \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. <\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0435\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">  TEST_METHOD(TestInitIterator2) {     \/\/ \"2010.5.5 10:01:01.001\"     scheduling::Iter iter;     iter.yearsSequence.emplace(std::make_unique&lt;scheduling::Const>(2010));     iter.monthsSequence.emplace(std::make_unique&lt;scheduling::Const>(5));     iter.daysSequence.emplace(std::make_unique&lt;scheduling::Const>(5));      iter.hoursSequence.emplace(std::make_unique&lt;scheduling::Const>(10));     iter.minutesSequence.emplace(std::make_unique&lt;scheduling::Const>(1));     iter.secondsSequence.emplace(std::make_unique&lt;scheduling::Const>(1));     iter.millisecondsSequence.emplace(std::make_unique&lt;scheduling::Const>(1));      iter.init(scheduling::DateTime{scheduling::Date{6, 6, 2011},                                    scheduling::Time{11, 2, 2, 2}});      Assert::IsFalse(iter);      iter.init(scheduling::DateTime{scheduling::Date{6, 6, 2009},                                    scheduling::Time{11, 2, 2, 2}});     Assert::IsTrue(*iter ==                    scheduling::DateTime{scheduling::Date{5, 5, 2010},                                         scheduling::Time{1, 1, 1, 10}});     ++iter;     Assert::IsFalse(iter);   } <\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0427\u0430\u0441\u0442\u044c 5: \u0424\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0434\u043d\u044f \u043c\u0435\u0441\u044f\u0446\u0430 \u0438 \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438<\/h2>\n<p>\u042d\u0442\u0438 \u0434\u0432\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e: \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>is_valid_date<\/code> \u0414\u0430, \u043c\u044b \u043e\u043f\u044f\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c, \u043d\u043e \u0432\u044b \u043e\u043f\u044f\u0442\u044c \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u044d\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<pre><code class=\"cpp\">bool Iter::is_valid_date() {   auto end_of_month_day =       boost::gregorian::gregorian_calendar::end_of_month_day(*yearsSequence,                                                              *monthsSequence);   if (end_of_month_day &lt; *daysSequence) {     return false;   }    if (lastMonth &amp;&amp; (end_of_month_day != *daysSequence)) {     return false;   }   boost::gregorian::greg_year_month_day ymd(*yearsSequence, *monthsSequence,                                             *daysSequence);   if (filterWeek &amp;&amp;       !valid_weekday(boost::gregorian::gregorian_calendar::day_of_week(ymd))) {     return false;    }    return true; }  bool Iter::valid_weekday(Unit weekDay) {   weekdaySequence.reset();   do {     if (*weekdaySequence == weekDay) {       return true;     }     ++weekdaySequence;   } while (weekdaySequence);   return false; } <\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0418 \u0442\u0435\u0441\u0442\u044b:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">TEST_METHOD(TestWeekdayFilterIterator) {     \/\/ \"*.*.* 0-2,4\"     scheduling::Iter iter;     iter.yearsSequence.emplace(std::make_unique&lt;scheduling::AnyYear>());     iter.monthsSequence.emplace(std::make_unique&lt;scheduling::AnyMonth>());     iter.daysSequence.emplace(std::make_unique&lt;scheduling::AnyDay>());      iter.hoursSequence.emplace(std::make_unique&lt;scheduling::Const>(0));     iter.minutesSequence.emplace(std::make_unique&lt;scheduling::Const>(0));     iter.secondsSequence.emplace(std::make_unique&lt;scheduling::Const>(0));     iter.millisecondsSequence.emplace(std::make_unique&lt;scheduling::Const>(0));      iter.filterWeek = true;     iter.weekdaySequence.emplace(std::make_unique&lt;scheduling::Const>(4));     iter.weekdaySequence.emplace(std::make_unique&lt;scheduling::Range>(0,2));      iter.init(scheduling::DateTime{scheduling::Date{13, 8, 2021},                                    scheduling::Time{0, 0, 0, 0}});      Assert::IsTrue(*iter ==                    scheduling::DateTime{scheduling::Date{15, 8, 2021},                                         scheduling::Time{0, 0, 0, 0}});     ++iter;      Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{16, 8, 2021},                                                  scheduling::Time{0, 0, 0, 0}});     ++iter;      Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{17, 8, 2021},                                                  scheduling::Time{0, 0, 0, 0}});     ++iter;      Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{19, 8, 2021},                                                  scheduling::Time{0, 0, 0, 0}});     ++iter;      Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{22, 8, 2021},                                                  scheduling::Time{0, 0, 0, 0}});     ++iter;  } <\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0427\u0430\u0441\u0442\u044c 6: \u0418\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443. <\/p>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435: \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u0445 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430,  \u0430 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u0439, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 <code>RangeStep<\/code> \u0438 <code>RRangeStep<\/code>. <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0435\u043c\u0443 \u0432\u0441\u0435-\u0440\u0430\u0432\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0443 \u043d\u0435\u0433\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c.  \u0412\u0430\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0443\u0447\u0443: \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440\u0435 \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u0441\u0430\u043c\u044b\u043c, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0430 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043d\u0430\u0434\u043e \u0431\u0440\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u044b\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c. <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. <\/p>\n<pre><code class=\"cpp\">template&lt;bool Reversed = false> class CombinerBase final : public ISequence { \/\/ ...    using Combiner = CombinerBase&lt;false>; using RCombiner = CombinerBase&lt;true>; <\/code><\/pre>\n<pre><code class=\"cpp\">template &lt;bool Reversed> bool CombinerBase&lt;Reversed>::heap_cmp(const condition_ptr&amp; l,                                       const condition_ptr&amp; r) {   if constexpr (Reversed) {     return **l &lt; **r;   } else {     return **l > **r;   } } <\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440.  \u041d\u0443, \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435-\u0440\u0430\u0432\u043d\u043e, \u0435\u043c\u0443 \u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u0438\u043f \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u0451\u0440\u0430<\/p>\n<pre><code class=\"cpp\">template&lt;bool Reversed> class IterBase {    typedef CombinerBase&lt;Reversed> combiner_t;    bool increment_sector(const std::vector&lt;combiner_t*>&amp; sector);    bool increment_date();   bool is_valid_date();   bool increment_time();    bool valid_weekday(Unit weekDay);   public:   combiner_t yearsSequence;   combiner_t monthsSequence;   combiner_t daysSequence;    combiner_t hoursSequence;   combiner_t minutesSequence;   combiner_t secondsSequence;   combiner_t millisecondsSequence;    bool lastMonth = false;   bool filterWeek = false;    Combiner weekdaySequence;    \/\/ init with current date   \/\/ Sets the first valid date   void init(const DateTime&amp; current);   \/\/ returns false if there is no next value   operator bool() const;   \/\/ returns next available value   DateTime operator*() const;   \/\/ iterates to the next time point   IterBase&lt;Reversed>&amp; operator++(); };   using Iter = IterBase&lt;false>; using RIter = IterBase&lt;true>; <\/code><\/pre>\n<p>\u0418 \u0432\u0441\u0435, \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0433\u043e\u0442\u043e\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0435\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">  TEST_METHOD(TestReverseIterator) {     \/\/ *.4.6,7 * *:*:*.1,2,3-5,10-20\/3     scheduling::RIter iter;      iter.yearsSequence.emplace(std::make_unique&lt;scheduling::RAnyYear>());     iter.monthsSequence.emplace(std::make_unique&lt;scheduling::RConst>(4));     iter.daysSequence.emplace(std::make_unique&lt;scheduling::RConst>(6));     iter.daysSequence.emplace(std::make_unique&lt;scheduling::RConst>(7));      iter.hoursSequence.emplace(std::make_unique&lt;scheduling::RAnyHour>());     iter.minutesSequence.emplace(std::make_unique&lt;scheduling::RAnyMinute>());     iter.secondsSequence.emplace(std::make_unique&lt;scheduling::RAnySecond>());      iter.millisecondsSequence.emplace(std::make_unique&lt;scheduling::RConst>(1));     iter.millisecondsSequence.emplace(std::make_unique&lt;scheduling::RConst>(2));     iter.millisecondsSequence.emplace(         std::make_unique&lt;scheduling::RRange>(3, 5));     iter.millisecondsSequence.emplace(         std::make_unique&lt;scheduling::RRangeStep>(3, 10, 20));       iter.init(scheduling::DateTime{scheduling::Date{7, 4, 2021},                                    scheduling::Time{7, 0, 0, 0}});           Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{7, 4, 2021},                                                  scheduling::Time{5, 0, 0, 0}});     ++iter;      Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{7, 4, 2021},                                                  scheduling::Time{4, 0, 0, 0}});     ++iter; \/\/ 3     ++iter; \/\/ 2     ++iter; \/\/ 1     Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{7, 4, 2021},                                                  scheduling::Time{1, 0, 0, 0}});     ++iter; \/\/ 0 is not valid millisecond. Prev day      Assert::IsTrue(*iter == scheduling::DateTime{scheduling::Date{6, 4, 2021},                                                  scheduling::Time{19, 59, 59, 23}});   } <\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0427\u0430\u0441\u0442\u044c 7: \u041f\u0430\u0440\u0441\u0435\u0440<\/h2>\n<p>\u041d\u0443, \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u044f \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0443\u0441\u0442\u0430\u043b, \u0434\u0430 \u0438 \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0441\u043c\u043e\u0433\u0443 \u0437\u0434\u0435\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0440\u0435\u0432\u043e\u043b\u044e\u0446\u0438\u044e.<\/p>\n<p>\u0411\u0435\u0440\u0438\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u0441\u0432\u043e\u0439 \u0432\u043a\u0443\u0441 (\u044f \u0431\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b <a href=\"https:\/\/github.com\/taocpp\/PEGTL\" rel=\"noopener noreferrer nofollow\">PEGTL<\/a>) \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 8: \u0417\u0430\u043c\u0435\u0440\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b \u0442\u0435\u0441\u0442\u044b \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>pattern<\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>date<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p>P90<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>P95<\/p>\n<\/td>\n<td>\n<p>P98<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>*.*.1 0:0:0 <\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>01-01-2001<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p> 700 ns;<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>705 ns; <\/p>\n<\/td>\n<td>\n<p>770 ns;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>*.*.1 0:0:0<\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>05-05-2080<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p>539 ns;<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>542 ns;<\/p>\n<\/td>\n<td>\n<p>662 ns;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>*.4.6,7 * *:*:*.1,2,3-5,10-20\/3  <\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>01-01-2001<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p>540 ns;<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>542 ns; <\/p>\n<\/td>\n<td>\n<p>582 ns;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>*.4.6,7 * *:*:*.1,2,3-5,10-20\/3  <\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>05-05-2080<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p>581 ns;<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>615 ns;<\/p>\n<\/td>\n<td>\n<p>794 ns;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>2100.12.31 23:59:59.999  <\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>01-01-2001<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p>384 ns;<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>612 ns;<\/p>\n<\/td>\n<td>\n<p>649 ns;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"225\" width=\"225\">\n<p>2100.12.31 23:59:59.999  <\/p>\n<\/td>\n<td data-colwidth=\"111\" width=\"111\">\n<p>05-05-2080<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p>352 ns; <\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p>353 ns; <\/p>\n<\/td>\n<td>\n<p>431 ns;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e &#8212; \u0441\u0430\u043c\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435. <\/p>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b <strong>\u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c (!!)<\/strong> \u0442\u0443\u043f\u043e &#171;\u0432 \u043b\u043e\u0431&#187;.  \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0430\u043c \u0434\u0430\u0442\u0430 \u043f\u0430\u0440\u0441\u0438\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439. <\/p>\n<p>\u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435, \u043c\u044b \u0442\u0443\u0442 \u043d\u0435 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0430\u043c\u0438 \u043c\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0448\u043b\u0438, \u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041d\u0443, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u043f\u0430\u0441\u0438\u0431\u043e <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a> \u0438 <a class=\"mention\" href=\"\/users\/novar\">@novar<\/a> \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0438\u043b\u0438 \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f &#171;\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445&#187; \u0441\u0435\u043a\u0443\u043d\u0434. \u041f\u0443\u0441\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435 \u043d\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u043b \u043f\u0430\u0440\u0441\u0435\u0440, \u043d\u043e \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0441\u0435-\u0440\u0430\u0432\u043d\u043e \u0432\u044b\u0448\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e. <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0431\u043e\u043b\u0435\u0435 12 \u0447\u0430\u0441\u043e\u0432, \u0447\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c  \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0434\u0432\u0430 \u0430\u0432\u0442\u043e\u0440\u0430. \u0417\u0430\u0442\u043e \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0438\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u0430\u0441\u044c \u0432 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0438: \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 N \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u0442. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f\/\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f &#8212; \u0431\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c. <\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0433\u0438\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u043f\u0443 <a href=\"https:\/\/github.com\/Cadovvl\/scheduler\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. <\/p>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\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\/articles\/572726\/\"> https:\/\/habr.com\/ru\/articles\/572726\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0432\u043e, \u0438 \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430, \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u043b \u0411\u043e\u0433 \u043d\u043e\u043b\u044c \u043e\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u044b, \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e. <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c, \u043e\u043f\u0443\u0441\u043a\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u0438\u0440\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0431\u044b\u043b\u0430<a href=\"https:\/\/habr.com\/ru\/post\/571342\/\" rel=\"noopener noreferrer nofollow\"> \u0432\u043e\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f<\/a>  \u043e\u0442 <a class=\"mention\" href=\"\/users\/novar\">@novar<\/a>. <\/p>\n<p>\u041d\u0443 \u0430 \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043f\u0443\u0441\u0442\u044f \u0432\u044b\u0448\u0435\u043b <a href=\"https:\/\/habr.com\/ru\/post\/572052\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u043d\u0438\u044f <\/a>\u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0442 <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a>.<\/p>\n<p>\u0418 \u043e\u0431\u043e\u0436\u0435\u043c\u043e\u0439, \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f. \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e, <a href=\"\/users\/psyhaste\" rel=\"noopener noreferrer nofollow\">@PsyHaSTe<\/a>, \u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0432\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a. \u041f\u0438\u0448\u0438 \u0435\u0449\u0435, \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u0432\u0441\u0435\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043a\u0440\u0443\u0442\u0438\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0430\u043c \u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u043d\u0430\u0447\u0435 (\u0442\u0430\u043a \u0431\u044b\u0432\u0430\u0435\u0442, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443). \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a. <\/p>\n<pre><code class=\"cs\">        public ScheduleInterval(int begin, int end)         {             Begin = begin;             End = end;             _allowedPoints = new bool[end - begin + 1];         }<\/code><\/pre>\n<hr\/>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0438 \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b <code>[0,999]<\/code>, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u043c.  \u041c\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0445\u043e\u043c\u044f\u043a \u0441\u0445\u0432\u0430\u0442\u0438\u043b\u0441\u044f \u0437\u0430 \u0441\u0435\u0440\u0434\u0446\u0435. \u0412 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 cron \u0438 Quartz \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u0435\u043d\u0435\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430: \u0432 \u043a\u0440\u043e\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e \u043c\u0438\u043d\u0443\u0442\u044b, \u0430 \u0432 \u043a\u0432\u0430\u0440\u0446\u0435 \u0434\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u041d\u043e \u0443 \u043d\u0430\u0441 &#8212; \u0442\u044b\u0441\u044f\u0447\u0438 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434. <\/p>\n<p>\u041b\u0430\u0434\u043d\u043e, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f BitSet, \u043d\u043e \u043f\u043e\u0442\u043e\u043c, \u0432 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0442\u0438\u043f\u0430 <code>0:0:0.999<\/code>  \u043c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e 1000 \u0440\u0430\u0437 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0431\u0438\u0442\u0441\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u0430\u044f. \u041d\u043e \u0432\u0435\u0434\u044c \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0437\u043d\u0430\u0435\u043c: \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 999.   <\/p>\n<p>\u041d\u0443 \u0430 \u043f\u043e\u0441\u043b\u0435 \u044f \u0433\u043b\u044f\u043d\u0443\u043b <code>Closest&lt;T><\/code>, \u0433\u0434\u0435 \u043a\u043e\u0434 \u0432\u0435\u0437\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0439, \u043d\u043e \u0443\u0436 \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443, \u0438 \u0440\u0443\u043a\u0430 \u0441\u0430\u043c\u0430 \u043f\u043e\u0442\u044f\u043d\u0443\u043b\u0430\u0441\u044c \u0433\u043b\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0443 \u0441\u0430\u043c\u043e\u0433\u043e: \u043a\u0440\u0438\u0442\u0438\u043a\u0443\u0435\u0448\u044c &#8212; \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0439.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>\u0414\u0430\u043d cron-\u043f\u043e\u0434\u043e\u0431\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0433\u043e\u0434\u044b, \u043c\u0435\u0441\u044f\u0446\u0430, \u0434\u043d\u0438, \u0434\u043d\u0438 \u043d\u0435\u0434\u0435\u043b\u0438, \u0447\u0430\u0441\u044b, \u043c\u0438\u043d\u0443\u0442\u044b, \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b:<\/p>\n<p><code>yyyy.MM.dd w HH:mm:ss.fff<\/code><\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 &#171;10 \u0443\u0442\u0440\u0430 \u0438 10 \u0432\u0435\u0447\u0435\u0440\u0430 \u0441 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a\u0430 \u043f\u043e \u043f\u044f\u0442\u043d\u0438\u0446\u0443&#187; \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p><code>*.*.* 1-5 10,22:0:0.000<\/code><\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0438 \u0443\u043c\u0435\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e<\/p>\n<ul>\n<li>\n<p>\u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043f\u043e\u0434 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435. <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043f\u043e\u0434 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435. <\/p>\n<\/li>\n<\/ul>\n<h2>\u0427\u0430\u0441\u0442\u044c 0: \u0412\u044b\u0431\u043e\u0440 \u044f\u0437\u044b\u043a\u0430<\/h2>\n<p>\u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430 C#, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u0441\u0442\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0443\u043c\u0430\u043b: \u0421++ \u044f \u0437\u043d\u0430\u044e \u043b\u0443\u0447\u0448\u0435 (\u0445\u043e\u0442\u044f \u0421++ \u0438 &#171;\u0437\u043d\u0430\u044e&#187; &#8212; \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435 \u0441\u0435\u0431\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435), \u0434\u0430 \u0438 pet-\u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u044e\u0431\u0438\u0448\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043b\u044e\u0431\u043e\u0432\u044c \u044d\u0442\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D0%BE%D0%BA%D0%B3%D0%BE%D0%BB%D1%8C%D0%BC%D1%81%D0%BA%D0%B8%D0%B9_%D1%81%D0%B8%D0%BD%D0%B4%D1%80%D0%BE%D0%BC\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c\u0441\u043a\u0438\u0439 \u0441\u0438\u043d\u0434\u0440\u043e\u043c<\/a>.  \u041d\u0443 \u0438, \u0435\u0441\u043b\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0447\u0435\u0441\u0442\u043d\u043e, \u043d\u0430 \u0444\u043e\u043d\u0435 \u043c\u043e\u043d\u0430\u0434 \u043e\u0442 <a class=\"mention\" href=\"\/users\/psyhaste\">@PsyHaSTe<\/a> \u043c\u043e\u0439 \u0421# \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0439.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c VS, \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043a\u0440\u0435\u0441\u0442\u0430\u0445, \u043f\u0440\u0438\u0441\u0442\u0435\u0433\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043f\u043e\u0433\u043d\u0430\u043b\u0438.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 1: \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043d\u0435 \u0441\u0432\u0435\u0440\u0445\u0443, \u0430 \u0441\u043d\u0438\u0437\u0443: \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0431\u0435 \u043e\u0431\u0445\u043e\u0434 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0434\u043d\u0435\u0439, \u0447\u0430\u0441\u043e\u0432 \u0438 \u0442.\u0434.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434 &#171;\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439&#187;: \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0431\u0435\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 ( <code>10-20\/3<\/code> &#8212; \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435, <code>1,5,8<\/code> &#8212; \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435).  \u0418 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0445\u043e\u0434 \u0432\u043f\u0435\u0440\u0435\u0434: \u043e\u0431\u0445\u043e\u0434 \u043d\u0430\u0437\u0430\u0434 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043d\u0435 \u0442\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u043e: \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435(\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430),  \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c.<\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043a\u0438\u0439 &#171;\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439&#187;. \u0427\u0442\u043e\u0431\u044b \u043c\u044b \u0448\u043b\u0438 \u043f\u043e &#171;\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445&#187;, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0432\u0441\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.  \u0414\u043b\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c: \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 <code>5<\/code>, \u0442\u043e \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 5, \u0430 \u043f\u043e\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043c,  \u0447\u0442\u043e \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 <code>1-5<\/code>, \u0442\u043e \u043c\u044b \u043e\u0442\u0434\u0430\u0435\u043c 1, \u043f\u043e\u0442\u043e\u043c 2, &#8230; , \u043f\u043e\u0442\u043e\u043c 5, \u0430 \u043f\u043e\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u0430 \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c. <\/p>\n<p>\u041f\u043b\u044e\u0441, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c &#171;\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#187; \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 &#171;\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u044b&#187; \u0447\u0438\u0441\u043b\u043e\u043c (\u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 3-\u0439 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d <code>1-5<\/code>),  \u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 &#171;\u043d\u0430\u0447\u0430\u043b\u043e&#187; (\u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0447\u0430\u0441, \u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u0438\u043d\u0443\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e).  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u043c\u0430\u044f. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0421++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0437\u0430 \u0436\u0438\u0437\u043d\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c 3 \u0432\u0435\u0449\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u0437\u0440\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u044b\u0442\u0430\u0435\u0448\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0442 \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 &#171;\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438&#187;:<\/p>\n<pre><code class=\"cpp\">using Unit = int16_t;  class ISequence {  public:   \/\/ Setup condition with current value   virtual void init(const Unit current) = 0;   \/\/ Reset condition to the beginning   virtual void reset() = 0;   \/\/ returns false if there is no current value   virtual operator bool() const = 0;   \/\/ returns current value   virtual Unit operator*() const = 0;   \/\/ iterate to the next value   virtual ISequence&amp; operator++() = 0; }; <\/code><\/pre>\n<p><em>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f <\/em><code>ICondition<\/code><em>, \u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u043b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/em> <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">  AnyDay day;   day.init(12);   while (day) {     std::cout &lt;&lt; \"AnyDay: \" &lt;&lt; *day &lt;&lt; std::endl;     ++day;   }      Range r(9, 17);   r.init(12);   while (r) {     std::cout &lt;&lt; \"Range: \" &lt;&lt; *r &lt;&lt; std::endl;     ++r;   }         RangeStep rs(4, 10, 20);   rs.init(12);   while (rs) {     std::cout &lt;&lt; \"RangeStep: \" &lt;&lt; *rs &lt;&lt; std::endl;     ++rs;   } <\/code><\/pre>\n<p>\u0412 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 <code>while (r)<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#171;\u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430&#187; <code>*r<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435,  \u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 <code>++r<\/code> \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0430\u0440\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ header template &lt;Unit Begin, Unit End> class Any : public ISequence {   typedef Any&lt;Begin, End> self_t;   protected:   Unit _current;   public:   Any();    \/*overrides*\/   void init(const Unit current) override final;   void reset() override final;   operator bool() const override final;   Unit operator*() const override final;   self_t&amp; operator++() override; };  using AnyYear = Any&lt;2000, 2100>; using AnyMonth = Any&lt;1, 12>; using AnyDay = Any&lt;1, 31>; <\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ source template &lt;Unit Begin, Unit End>  \/\/ Any template &lt;Unit Begin, Unit End> Any&lt;Begin, End>::Any() : _current(Begin) {}  template &lt;Unit Begin, Unit End> void Any&lt;Begin, End>::init(const Unit current) {   _current = current; }  template &lt;Unit Begin, Unit End> void Any&lt;Begin, End>::reset() {   _current = Begin; }  template &lt;Unit Begin, Unit End> Any&lt;Begin, End>::operator bool() const {   return _current &lt;= End; }  template &lt;Unit Begin, Unit End> Unit Any&lt;Begin, End>::operator*() const {   return _current; }  template &lt;Unit Begin, Unit End> typename Any&lt;Begin, End>::self_t&amp; Any&lt;Begin, End>::operator++() {   ++_current;   return *this; }   template class Any&lt;2000, 2100>; template class Any&lt;1, 12>; template class Any&lt;1, 31>; <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435: \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e. \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430, \u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 (\u044d\u0442\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&#187;, \u043d\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d&#187;: \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d <code>10-20<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 5).  <br \/>\u041c\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u043c \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0435 &#171;\u0442\u0435\u043a\u0443\u0449\u0435\u0435&#187; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u043b\u043e \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043d\u043e\u0433\u043e.  \u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 (\u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0421++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442)<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Begin \u0438 End &#8212; \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <strong>\u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong> \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0438\u043c\u0438: \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e,  \u0434\u043b\u044f \u0438\u0445 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 (\u043d\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430: \u0433\u0434\u0435-\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u043e\u043d\u0438 \u0435\u0441\u0442\u044c), \u0438 \u0442.\u0434. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, AnyYear, AnyMonth, AnyDay &#8212; \u044d\u0442\u043e \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0434\u0438\u043d \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f: \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438(definition), \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f (declaration),  \u0430 \u0432 cpp \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 &#8212; \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438.  \u0422\u0430\u043a\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441. <\/p>\n<p>\u0417\u0430\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Any&lt;0, 17>, \u0441\u0431\u043e\u0440\u043a\u0430 \u0443\u043f\u0430\u0434\u0435\u0442: \u043e\u043d \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 Any&lt;0, 17>.<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u0441\u0442\u044b \u043a \u043d\u0430\u0448\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <\/p>\n<pre><code class=\"cpp\">namespace UnitTests { typedef std::vector&lt;scheduling::Unit> Units;  TEST_CLASS(TestConditions) {     static void FillResults(Units&amp; units, scheduling::ISequence&amp; condition) {       units.clear();       while (condition) {         units.push_back(*condition);         ++condition;       }     }     public:              TEST_METHOD(TestYears)     {         Units units;         scheduling::AnyYear condition;          condition.init(2020);         FillResults(units, condition);          Units expected;         for (int i = 2020; i &lt;= 2100; ++i) {             expected.push_back(i);         }          Assert::IsTrue(units == expected);     } }; }  \/\/ namespace UnitTests <\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0436\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e, \u0443\u0442\u043e\u0447\u043d\u044e \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430. <\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430&#187; \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0444\u043b\u0430\u0433. \u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u043e\u043c <u>\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043c<\/u> \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0444\u043b\u0430\u0433 \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f (\u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 &#171;\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438&#187;, \u0438 \u043c\u044b \u0435\u0433\u043e \u0432\u0435\u0440\u043d\u0435\u043c). <\/p>\n<p>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0431\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433. <\/p>\n<pre><code class=\"cpp\">\/\/ Const Const::Const(const Unit val) : _val(val), _active(true) {} void Const::init(const Unit current) { _active = current &lt;= _val; } void Const::reset() { _active = true; } Const::operator bool() const { return _active; } Unit Const::operator*() const { return _val; } Const&amp; Const::operator++() {   _active = false;   return *this; }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 &#171;\u0441 \u0448\u0430\u0433\u043e\u043c&#187; \u043c\u043e\u0436\u043d\u043e \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439:  \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \u0442\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438 \u0432 &#171;\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435&#187;.<\/p>\n<pre><code class=\"cpp\"> \/\/ RangeStep RangeStep::RangeStep(const Unit step, const Unit from, const Unit to)     : Range(from, to), _step(step) {}  void RangeStep::init(const Unit current) {   if (current &lt;= _from) {     _current = _from;     return;   }   _current = current;   auto diffmod = (_current - _from) % _step;   if (diffmod != 0) {     _current += _step - diffmod;   } }  RangeStep&amp; RangeStep::operator++() {   _current += _step;   return *this; }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/ header #pragma once #include &lt;cstdint>  namespace<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-416066","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/416066","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=416066"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/416066\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=416066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=416066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=416066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}