{"id":467694,"date":"2025-07-19T03:00:36","date_gmt":"2025-07-19T03:00:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=467694"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=467694","title":{"rendered":"<span>\u041e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c: C++ \u0438 compile\u2011time \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/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<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f3e\/0cb\/2d8\/f3e0cb2d8d2f14b30c6c2d4b763d14d8.png\" width=\"1469\" height=\"894\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f3e\/0cb\/2d8\/f3e0cb2d8d2f14b30c6c2d4b763d14d8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f3e\/0cb\/2d8\/f3e0cb2d8d2f14b30c6c2d4b763d14d8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 <code>constexpr<\/code>\/<code>consteval<\/code> \u0432\u00a0\u0421++ \u0436\u0438\u0432\u0443\u0442 \u0443\u0436\u0435 \u043d\u0435\u00a0\u043f\u0435\u0440\u0432\u044b\u0439 \u0433\u043e\u0434, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u043c\u2011\u0442\u043e \u043d\u0435\u044f\u0441\u043d\u044b\u043c\u0438\u0438\u043b\u0438\u00a0\u0447\u0435\u0440\u0435\u0441\u0447\u0443\u0440 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u043d\u044b\u043c\u0438. \u041f\u043e\u00a0\u0441\u0442\u0430\u0440\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0445 \u0440\u043e\u043b\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u043c\u2011\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u00ab\u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0432\u00a0compile\u2011time\u00bb, \u00ab\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0447\u0438\u0441\u0435\u043b\u00bb \u0438\u043b\u0438, \u0432\u00a0\u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u00ab\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0443 <code>if constexpr<\/code> \u0434\u043b\u044f\u00a0\u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb. \u0421\u043b\u043e\u0432\u043e\u043c, \u0438\u0433\u0440\u0443\u0448\u043a\u0430 \u0434\u043b\u044f\u00a0\u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u043e\u043a\u0443\u0441\u043e\u0432, \u043d\u043e\u00a0\u043d\u0435\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0443.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e C++ \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442. \u0421\u00a0\u0432\u044b\u0445\u043e\u0434\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 (C++20, C++23\u00a0\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e C++26) \u0438 \u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <code>constexpr<\/code>\u2011\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u00a0\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435,\u00a0\u2014 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f <code>constexpr<\/code> \u0438 <code>consteval<\/code> \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u00a0\u0440\u0430\u043c\u043a\u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u00a0\u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0443\u0436\u0435 \u0432\u00a0\u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430\u00a0\u043d\u0435\u00a0\u0433\u0434\u0435\u2011\u0442\u043e \u0432\u00a0CI \u0438\u043b\u0438, \u0447\u0442\u043e\u00a0\u0445\u0443\u0436\u0435, \u0432\u00a0runtime. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0435: <strong>\u0435\u0441\u043b\u0438 \u0447\u0442\u043e\u2011\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u00a0\u2014 \u043e\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u043e\u00a0\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/strong>. <\/p>\n<p>\u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <strong>\u043f\u043e\u043b\u043d\u0443\u044e compile\u2011time \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e <\/strong>SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u044f\u043c\u043e \u0432\u00a0\u043a\u043e\u0434. \u0411\u0435\u0437\u00a0\u043c\u0430\u0433\u0438\u0438, \u0431\u0435\u0437\u00a0\u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430, \u0431\u0435\u0437\u00a0\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0442\u0443\u043b\u043e\u0432. \u0422\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 C++ \u0438 \u0432\u0430\u0448\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0411\u0414. \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446, \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u0442\u0438\u043f\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u00a0\u2014 \u0432\u0441\u0451 \u043d\u0430\u00a0compile\u2011time. <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0435\u0441\u043b\u0438\u00a0\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u00ab\u0442\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435\u0442\u00bb, \u00ab\u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\u00bb, \u00ab\u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b\u00bb\u00a0\u2014 \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u00ab\u0441\u044e\u0440\u043f\u0440\u0438\u0437\u044b\u00bb \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 SQL \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0412\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435\u00a0\u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f.<\/p>\n<p><a href=\"https:\/\/godbolt.org\/z\/6KEYhTYGh\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<\/a><\/p>\n<hr\/>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 SQL \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445:<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414 \u0432\u00a0\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, XML, JSON \u0438\u043b\u0438\u00a0SQL DDL) \u0441\u00a0\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438, \u043f\u043e\u043b\u044f\u043c\u0438 \u0438 \u0438\u0445 \u0442\u0438\u043f\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b<\/strong>. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0445\u0435\u043c\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438. \u0412\u00a0\u0431\u0443\u0434\u0443\u0449\u0435\u043c C++26\u00a0\u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 #embed, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a\u00a0\u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442:<\/p>\n<p><code>constexpr const char data[] = { #embed \"test.json\", 0};<\/code><\/p>\n<p>\u0412\u00a0C++20\/23\u00a0\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0440\u0438\u043f\u0442\u2011\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u00a0\u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b<code>constexpr std::string_view<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0441\u0445\u0435\u043c\u044b \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>. \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <code>consteval<\/code> \u2011\u0444\u0443\u043d\u043a\u0446\u0438\u044f (\u0438\u043b\u0438 <code>constexpr<\/code> \u2011\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u043f\u0440\u0438\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438) \u0447\u0438\u0442\u0430\u0435\u0442 <code>string_view<\/code> \u0441\u0445\u0435\u043c\u044b \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0435\u0435. \u0412\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0411\u0414: \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u00a0constexpr \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438\u00a0\u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0441\u0442\u043e\u043b\u0431\u0446\u044b\u00a0\u2014 \u0432\u00a0constexpr \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u00a0\u043a\u043e\u0434\u0435 C++ \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b (\u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u00ab\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u00bb \u0438\u0437\u00a0\u0438\u043c\u0435\u043d \u0432\u00a0\u0442\u0438\u043f\u044b \u043f\u043e\u043b\u0435\u0439).<\/p>\n<\/li>\n<li>\n<p><strong>SQL\u2011\u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>. \u041b\u044e\u0431\u043e\u0439 SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u00a0\u043a\u043e\u0434\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a\u00a0\u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0441\u00a0\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0435\u0439. \u0421\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e consteval \u2011\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u00a0\u043b\u0435\u043a\u0441\u0435\u043c\u044b (SELECT, FROM, WHERE \u0438\u00a0\u0442.\u00a0\u0434.), \u0441\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043f\u043e\u043b\u044f \u0441\u00a0\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439. \u0415\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 (\u043d\u0435 \u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043d\u0435\u00a0\u0442\u043e\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446, \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b), \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c <code>static_assert<\/code> \u0441\u00a0\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u043a\u0438\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\/\u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u0438\u0445 \u0442\u0438\u043f\u044b. \u042d\u0442\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u00a0\u043a\u043e\u0434\u0435 (\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u0437\u00a0\u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f) \u0438 \u0438\u043c\u0435\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>constexpr<\/code>\u2011\u0434\u0430\u043d\u043d\u044b\u0435. \u0412\u00a0\u0441\u0445\u0435\u043c\u0435 \u043d\u0435\u0442 \u0434\u0443\u0431\u043b\u0435\u0439: \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 (\u0441\u0445\u0435\u043c\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u00a0C++\u2011\u0442\u0438\u043f\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443\u0436\u0435 \u043a\u00a0\u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u00ab\u0437\u043d\u0430\u0435\u0442\u00bb, \u043a\u0430\u043a\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u0432\u00a0\u043d\u0438\u0445 \u0435\u0441\u0442\u044c. <\/p>\n<h4>\u0421\u0445\u0435\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438:<\/h4>\n<p><code>Column<\/code>\u00a0\u2014 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f ( <code>std::string_view <\/code>) \u0438 \u0442\u0438\u043f \u043f\u043e\u043b\u044f.<\/p>\n<p><code>Table<\/code>\u00a0\u2014 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 std::array&lt;Column&gt; \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p><code>Schema<\/code>\u00a0\u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u00a0\u0431\u0430\u0437\u0435.<\/p>\n<pre><code class=\"cpp\"> constexpr size_t MAX_COLUMNS = 100; constexpr size_t MAX_TABLES = 100;  struct Table {    enum ColumnType : int    {       BOOLEAN,       DATETIME,       DOUBLE,       ENUM,       HASHTABLE,       IDENTIFIER,       INT64,       INTEGER,       MONEY,       STRING,       UUID,    };    struct Column    {        std::string_view mName;       ColumnType mType;       bool mIsNotNull = false;    };     std::string_view mName;    std::array&lt; Column, MAX_COLUMNS &gt; mColumns{};    size_t Column_count = 0; };  struct Schema {    std::array&lt; Table, MAX_TABLES &gt; mTables{};    size_t mTableCount = 0; };<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u00a0\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0447\u0435\u0440\u0435\u0437 <strong>std::array<\/strong>\u00a0\u2014 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c <code>\u0421++23<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u0432 <code>\u0421++26<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0438\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0441\u00a0\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. <\/p>\n<p>\u0414\u043b\u044f\u00a0\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 <strong>XML\u2011\u0444\u0430\u0439\u043b<\/strong>, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 <strong>\u0441\u0445\u0435\u043c\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/strong> \u0432\u00a0\u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u043c \u0434\u043b\u044f\u00a0\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e DSL), \u044f \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u00a0cmake:<\/p>\n<pre><code class=\"cmake\">add_custom_command(   OUTPUT ${CMAKE_BINARY_DIR}\/generated_dicx.hpp   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}   COMMAND python3 ${CMAKE_SOURCE_DIR}\/tools\/embed_dicx.py           ${CMAKE_SOURCE_DIR}\/db.dicx           ${CMAKE_BINARY_DIR}\/generated_dicx.hpp   DEPENDS ${CMAKE_SOURCE_DIR}\/db.dicx )<\/code><\/pre>\n<p>\u041a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 python\u2011\u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u00a0\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0441\u0445\u0435\u043c\u044b \u0432\u00a0\u0445\u044d\u0434\u0435\u0440\u2011\u0444\u0430\u0439\u043b\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0434\u043b\u044f\u00a0\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0432\u00a0\u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0421\u0443\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u00a0\u2014 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u0411\u0414 \u0432\u00a0constexpr \u0432\u0438\u0434\u0435:<\/p>\n<pre><code class=\"cpp\">constexpr std::string_view dicx_xml =    R\"DICX(&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;     &lt;table name=\"Company\" responsible=\"\u041a\u043e\u0441\u0438\u043d\u0446\u0435\u0432 \u0410.\u0412.\"&gt;       &lt;comment&gt;\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439&lt;\/comment&gt;       &lt;column index_in_pk=\"0\" is_pk_part=\"1\" name=\"Uuid\"&gt;         &lt;comment&gt;Uuid \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&lt;\/comment&gt;         &lt;format&gt;           &lt;type&gt;UUID&lt;\/type&gt;           &lt;not_null&gt;true&lt;\/not_null&gt;         &lt;\/format&gt;       &lt;\/column&gt;     &lt;\/table&gt;   &lt;!-- \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b... --&gt; )DICX\";<\/code><\/pre>\n<p>\u0412\u00a0C++26\u00a0\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 <code>#embed<\/code>, \u0431\u0435\u0437\u00a0\u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u00a0\u0421++23\u00a0\u0441\u043e\u0439\u0434\u0435\u0442 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. <\/p>\n<p>\u042d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a\u00a0\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0443 <code>dicx_xml<\/code>. <\/p>\n<p>\u0414\u043b\u044f\u00a0\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d CRTP (Curiously Recurring Template Pattern). \u0422\u0430\u043a, \u043d\u0430\u0448 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>BaseParserCRTP<\/code>\u00a0\u2014 \u044d\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0438\u043c\u0435\u0442\u044c <code>constexpr<\/code>-\u043f\u043e\u043b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442, \u043a\u0430\u043a\u00a0\u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0445\u0435\u043c\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0430\u043c\u00a0\u0436\u0435 BaseParserCRTP \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Schema, \u0435\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">template&lt; typename Derived &gt; class BaseParserCRTP { protected:    static inline constexpr Schema mSchema = Derived::Parse();  public:    consteval static size_t TableCount()    {       return mSchema.mTableCount;    }     consteval static const Table* GetTable( std::string_view name )    {       for( auto const&amp; t : mSchema.mTables )          if( t.mName == name )             return &amp;t;       return nullptr;    } };<\/code><\/pre>\n<p>\u0414\u043b\u044f\u00a0\u0441\u0432\u043e\u0435\u0433\u043e XML\u2011\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0441\u00a0\u043d\u0443\u0436\u043d\u044b\u043c \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u043c, \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u0430\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430\u0448\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0445\u0435\u043c\u044b \u0411\u0414:<\/p>\n<pre><code class=\"cpp\">#include \"base_parser.hpp\" #include \"generated_dicx.hpp\" #include &lt;string_view&gt;  class DicxParser : public BaseParserCRTP&lt; DicxParser &gt; { public:    consteval static Schema Parse();  private:    using ColumnType = Table::ColumnType;     static consteval size_t FindTag( std::string_view xml, std::string_view tag, size_t start = 0 );     static consteval std::string_view ExtractAttr( std::string_view tag, std::string_view key );     static consteval ColumnType ParseColumnType( std::string_view s ); };  inline consteval Schema DicxParser::Parse() {    Schema r;    size_t pos = 0;    while( true )    {       auto tbl_pos = FindTag( dicx_xml, \"&lt;table \", pos );       if( tbl_pos == dicx_xml.size() )          break;        auto end_tag = FindTag( dicx_xml, \"&gt;\", tbl_pos );       auto tag_str = dicx_xml.substr( tbl_pos, end_tag - tbl_pos );       auto name = ExtractAttr( tag_str, \"name=\" );       auto&amp; table = r.mTables[ r.mTableCount++ ];       table.mName = name;        size_t col_pos = end_tag;       auto table_close = FindTag( dicx_xml, \"&lt;\/table&gt;\", end_tag );       while( true )       {          auto cpos = FindTag( dicx_xml, \"&lt;column \", col_pos );          if( cpos &gt;= table_close )             break;           auto cend = FindTag( dicx_xml, \"&gt;\", cpos );          auto ctag = dicx_xml.substr( cpos, cend - cpos );          auto col_name = ExtractAttr( ctag, \"name=\" );           auto&amp; Column = table.mColumns[ table.Column_count++ ];          Column.mName = col_name;           auto tpos = FindTag( dicx_xml, \"&lt;type&gt;\", cend );          auto tend = FindTag( dicx_xml, \"&lt;\/type&gt;\", tpos );          auto type_name = utils::Trim( dicx_xml.substr( tpos + 6, tend - tpos - 6 ) );          Column.mType = ParseColumnType( type_name );           auto nn_pos = FindTag( dicx_xml, \"&lt;not_null&gt;\", tpos );          if( nn_pos &lt; table_close &amp;&amp; nn_pos &lt; FindTag( dicx_xml, \"&lt;\/not_null&gt;\", nn_pos ) )          {             auto nn_end = FindTag( dicx_xml, \"&lt;\/not_null&gt;\", nn_pos );             Column.mIsNotNull = dicx_xml.substr( nn_pos + 10, nn_end - nn_pos - 10 ) == \"true\";          }           col_pos = tend;       }        pos = table_close;    }    return r; }  inline consteval DicxParser::ColumnType DicxParser::ParseColumnType( std::string_view s ) {    if( s == \"UUID\" )       return ColumnType::UUID;    if( s == \"STRING\" )       return ColumnType::STRING;    if( s == \"INTEGER\" )       return ColumnType::INTEGER;    if( s == \"DOUBLE\" )       return ColumnType::DOUBLE;    if( s == \"BOOLEAN\" )       return ColumnType::BOOLEAN;    if( s == \"DATETIME\" )       return ColumnType::DATETIME;    if( s == \"ENUM\" )       return ColumnType::ENUM;    if( s == \"HASHTABLE\" )       return ColumnType::HASHTABLE;    if( s == \"IDENTIFIER\" )       return ColumnType::IDENTIFIER;    if( s == \"INT64\" )       return ColumnType::INT64;    if( s == \"MONEY\" )       return ColumnType::MONEY;     throw \"Unknown Column type: \" __FILE__; }<\/code><\/pre>\n<p><code>DicxParser<\/code> \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <code>BaseParserCRTP<\/code> \u0438 \u0437\u043d\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0430\u0448\u0435\u0433\u043e.dicx XML (\u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u0442\u043e\u043b\u0431\u0446\u044b, \u0442\u0438\u043f\u044b). \u0417\u0430\u00a0\u0441\u0447\u0451\u0442 CRTP \u0432\u0435\u0441\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 <code>\u0431\u0435\u0437\u00a0\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432.<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u00a0\u0441\u0445\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u00a0constexpr\u2011\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445, \u043b\u044e\u0431\u043e\u0439 SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e\u043b\u044c\u043a\u043e SELECT\u2011FROM\u2011WHERE \u0431\u0435\u0437\u00a0\u0441\u043b\u043e\u0436\u043d\u044b\u0445 JOIN), \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u0432\u00a0consteval \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430\u00a0\u0431\u044b\u043b \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e\u00a0\u0442\u0438\u043f\u0443 \u0442\u0430\u043a\u0438\u0445:<\/p>\n<pre><code class=\"cpp\">SQL::Select&lt; \"SELECT Folder, Id FROM CompanyFolderCounters\" &gt;(); SQL::Insert&lt; \"INSERT INTO Company (Description, Uuid, Name, Rating)\" &gt;            ( description, uuid, name, rate );<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e\u00a0\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c SQL\u2011\u044f\u0437\u044b\u043a\u0430, \u0438 \u043f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c \u043d\u0435\u00a0\u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p>\u041d\u0430\u0448 <code>SqlChecker<\/code> \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442 \u0438 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e \u0442\u0435\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u0432\u044b\u0448\u0435. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0435\u043d \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0421++ \u0434\u043b\u044f\u00a0\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">template&lt; typename T &gt; concept DBParser = std::derived_from&lt; T, BaseParserCRTP&lt; T &gt; &gt;;  template&lt; DBParser Parser &gt; class SqlChecker { public:    virtual ~SqlChecker() = default;    consteval SqlChecker() = default;     consteval static inline size_t TableCount();     template&lt; FixedString SQL, typename... Args &gt;    consteval void CheckInsert() const;     template&lt; FixedString SQL &gt;    consteval void ValidateSelect() const; private:    consteval static Table const* GetTable( std::string_view table_name )    {       return Parser::GetTable( table_name );    } };<\/code><\/pre>\n<p>\u0418\u0437\u2011\u0437\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0421++23\u00a0\u043d\u0430 <code>constexpr<\/code>\u2011\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c, \u043d\u0435\u00a0\u0434\u043e\u0436\u0438\u0434\u0430\u044f\u0441\u044c 26\u00a0\u0433\u043e\u0434\u0430, \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c <code>FixedString<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e, \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043c\u0435\u0449\u0430\u043b\u0441\u044f \u0432 constexpr \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:<\/p>\n<pre><code class=\"cpp\">template&lt; size_t N &gt; struct FixedString {    char mData[ N ]{};     constexpr FixedString( const char ( &amp;str )[ N ] )    {       for( size_t i = 0; i &lt; N; ++i )          mData[ i ] = str[ i ];    }     constexpr operator std::string_view() const    {       return { mData, N - 1 };    } };<\/code><\/pre>\n<p>\u0418\u043d\u0430\u0447\u0435 \u0432\u044b\u00a0\u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441\u00a0\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u043e\u0434\u0435: <\/p>\n<blockquote>\n<p>\u201cType &#8216;std::string_view&#8217; is not a structural type because it has a non\u2011static data member that is not public.\u201d<\/p>\n<\/blockquote>\n<p>\u041c\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0442\u043a\u0438 \u0438\u0437\u00a0\u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: <\/p>\n<pre><code class=\"cpp\">template&lt; FixedString SQL &gt;    consteval void ValidateSelect() const    {       constexpr std::string_view sql = SQL;       if constexpr( constexpr bool is_select = sql.starts_with( \"SELECT\" ); !is_select )          static_assert( is_select, \"It's not SELECT query\" );        constexpr auto from = sql.find( \"FROM\" );       if( constexpr bool is_from = from != std::string_view::npos; !is_from )          static_assert( is_from, \"FROM not found\" );        constexpr auto columns = sql.substr( 7, from - 7 );        if constexpr( utils::Trim( columns ) == \"*\" )       {          constexpr auto tbl = utils::Trim( sql.substr( from + 5 ) );          static_assert( GetTable( tbl ), \"Unknown table\" );       }       else       {          constexpr auto tbl = utils::Trim( sql.substr( from + 5 ) );          constexpr auto sd = GetTable( utils::Trim( tbl ) );           if constexpr( constexpr bool is_table_present = sd; !is_table_present )             static_assert( is_table_present, \"Unknown table\" );           constexpr auto column_result = utils::Split( columns, ',' );          constexpr auto column_tokens = column_result.first;          constexpr size_t column_count = column_result.second;          \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044e \u0432 \u0411\u0414          auto test_one = [ &amp; ]&lt; size_t I &gt;() consteval          {             constexpr auto name = utils::Trim( column_tokens[ I ] );              constexpr bool ok = [ &amp; ]             {                for( size_t j = 0; j &lt; sd-&gt;Column_count; ++j )                   if( sd-&gt;mColumns[ j ].mName == name )                      return true;                return false;             }();              if constexpr( !ok )             {                static_assert( ok, \"Unknown column\" );             }          };           [ &amp; ]&lt; size_t... Is &gt;( std::index_sequence&lt; Is... &gt; ) consteval          { ( test_one.template operator()&lt; Is &gt;(), ... ); }( std::make_index_sequence&lt; column_count &gt;{} );       }    }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0446\u0435\u043b\u0430\u044f \u044d\u043f\u043e\u043f\u0435\u044f \u0438\u0437\u00a0\u0441\u043b\u043e\u0432\u0430 <code>constexpr<\/code>, \u043d\u043e\u00a0\u0442\u0430\u043a\u043e\u0432\u044b \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043a\u00a0\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u00a0compile\u2011time \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0439 \u0438\u043b\u0438\u00a0\u0438\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u043e\u043b\u044c \u0434\u043b\u044f <code>column_result<\/code> \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043f\u043e\u043a\u0430 \u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c <code>constexpr<\/code>.<\/p>\n<p>\u041e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u0435 \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043c\u0438\u043d\u0443\u0441\u044b \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0438 \u044f\u0437\u044b\u043a\u0430 \u0438\u043c\u0435\u044e\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u00a0\u0433\u0440\u044f\u0434\u0443\u0449\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435, \u0430\u00a0\u0437\u043d\u0430\u0447\u0438\u0442, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0443\u044e \u0438 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u043f\u043e\u00a0\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0443\u043c\u043a\u0438.<\/p>\n<p>\u0420\u0430\u0434\u0438 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0443 \u0432\u0435\u0440\u0441\u0438\u044e <code>Insert<\/code> \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043d\u043e\u00a0\u043f\u043e\u043b\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u0441\u0435\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0438 \u043f\u043e\u0442\u044b\u043a\u0430\u0442\u044c <a href=\"https:\/\/godbolt.org\/z\/6KEYhTYGh\" rel=\"noopener noreferrer nofollow\">\u0417\u0414\u0415\u0421\u042c<\/a>:<\/p>\n<pre><code class=\"cpp\">template&lt; FixedString SQL, typename... Args &gt;    consteval void CheckInsert() const    {       constexpr std::string_view sqlv = SQL;        \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 INSERT       if constexpr( !sqlv.starts_with( \"INSERT\" ) )       {          static_assert( false, \"It's not INSERT query\" );       }        \/\/ \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \"INTO\" \u0438 \u0441\u043a\u043e\u0431\u043e\u043a       constexpr auto into_pos = sqlv.find( \"INTO\" );       if constexpr( into_pos == std::string_view::npos )       {          static_assert( false, \"INTO not found in INSERT query\" );       }       else       {           \/\/ \u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438          constexpr auto paren1 = sqlv.find( '(', into_pos );          constexpr std::string_view table = utils::Trim( sqlv.substr( into_pos + 4, paren1 - ( into_pos + 4 ) ) );          constexpr auto paren2 = sqlv.find( ')', paren1 );           constexpr std::string_view Columns_list = sqlv.substr( paren1 + 1, paren2 - ( paren1 + 1 ) );           constexpr auto split_result = utils::Split( Columns_list, ',' );          constexpr auto columns = split_result.first;          constexpr size_t fcount = split_result.second;           \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u0438\u043c\u0435\u043d\u0438          constexpr auto sd = GetTable( table );          if constexpr( !sd )          {             static_assert( false, \"Unknown table\" );          }           \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u0435\u0439          if constexpr( fcount != sizeof...( Args ) )          {             static_assert( false, \"Column count is not equal to argument count\" );          }          else          {             constexpr auto trimmed_Columns = [ &amp; ]() consteval             {                std::array&lt; std::string_view, sizeof...( Args ) &gt; out{};                for( size_t i = 0; i &lt; sizeof...( Args ); ++i )                {                   out[ i ] = utils::Trim( columns[ i ] );                }                return out;             }();             \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044e \u0432 \u0411\u0414             auto test_one = [ &amp; ]&lt; typename T, size_t I &gt;() consteval             {                constexpr std::string_view column_name = trimmed_Columns[ I ];                 \/\/ 1) \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432 sd-&gt;Columns                constexpr bool column_exists = [ &amp; ]() consteval -&gt; bool                {                   for( size_t j = 0; j &lt; sd-&gt;Column_count; ++j )                   {                      if( sd-&gt;mColumns[ j ].mName == column_name )                      {                         return true;                      }                   }                   return false;                }();                 if constexpr( !column_exists )                {                   static_assert( false, \"Unknown column name\" );                }                else                {                   \/\/ 2) \u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0434\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u043b\u044f (\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0442\u043e\u0447\u043d\u043e \u0435\u0441\u0442\u044c)                   constexpr size_t found_idx = [ &amp; ]() consteval                   {                      for( size_t j = 0; j &lt; sd-&gt;Column_count; ++j )                      {                         if( sd-&gt;mColumns[ j ].mName == column_name )                         {                            return j;                         }                      }                      return size_t( 42 );                   }();                    \/\/ 3) \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0442\u0438\u043f T \u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c \u043f\u043e\u043b\u044f                   using U = std::decay_t&lt; T &gt;;                   constexpr auto f_type = sd-&gt;mColumns[ found_idx ].mType;                   if constexpr( f_type == Table::INTEGER )                   {                      static_assert( std::is_same_v&lt; U, int &gt;, \"Type mismatch: expected INTEGER\" );                   }                   else if constexpr( f_type == Table::DOUBLE )                   {                      static_assert( std::is_same_v&lt; U, double &gt;, \"Type mismatch: expected DOUBLE\" );                   }                   else if constexpr( f_type == Table::STRING )                   {                      static_assert( std::is_same_v&lt; U, std::string &gt;, \"Type mismatch: expected STRING\" );                   }                   else if constexpr( f_type == Table::UUID )                   {                      static_assert( std::is_same_v&lt; U, Uuid &gt;, \"Type mismatch: expected UUID\" );                   }                   else if constexpr( constexpr bool is_Column_not_found = true )                   {                      static_assert( false &amp;&amp; sd-&gt;mColumns[ found_idx ].mType,                                     \"Type mismatch: unknown column type in table\" );                   }                }             };              [ &amp; ]&lt; size_t... Is &gt;( std::index_sequence&lt; Is... &gt; ) consteval             {                ( test_one.template operator()&lt; typename std::tuple_element&lt; Is, std::tuple&lt; Args... &gt; &gt;::type, Is &gt;(),                  ... );             }( std::make_index_sequence&lt; fcount &gt;{} );          }       }    }<\/code><\/pre>\n<p>\u0412\u00a0\u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442\u00a0SELECT, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f INSERT \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439\u00a0\u2014 \u0432\u00a0\u0442\u043e\u0447\u043d\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u043f\u043e\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 &#8212; Uuid &#8212; \u0437\u043d\u0430\u0447\u0438\u0442 &#8212; Uuid. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c, \u0447\u0442\u043e\u00a0\u0432 <code>constexpr<\/code> \u043f\u043e\u043a\u0430 \u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e\u00a0\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0442\u0438\u043f\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u043d\u0430\u0447\u0435, \u043a\u0430\u043a\u00a0\u0447\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043d\u043e\u00a0\u0434\u0430\u00a0\u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u043e \u043f\u043e\u043c\u0435\u0445\u043e\u0439. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0446\u0435\u043b\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0448\u0435\u0433\u043e <code>SqlChecker'a<\/code> \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f:<\/p>\n<p>1) \u041b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437: \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u0442\u043e\u043a\u0435\u043d\u044b (\u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0438\u043c\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\/\u043f\u043e\u043b\u0435\u0439,\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b).<\/p>\n<p>2) \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430: \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0430 SELECT). \u0415\u0441\u043b\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0435\u00a0\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 SQL, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code>static_assert<\/code>.<\/p>\n<p>3) \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\/\u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432: \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0449\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 <code>constexpr<\/code>\u2011\u0441\u0445\u0435\u043c\u0435. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u043b\u044f \u0438 \u0438\u0445 \u0442\u0438\u043f\u044b: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u0438\u043f \u043f\u043e\u043b\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u00a0\u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u0441\u00a0\u0442\u0435\u043a\u0441\u0442\u043e\u043c). \u041f\u0440\u0438\u00a0\u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u043e\u0432\u00a0\u2014 static_assert(\u00abType mismatch:&#8230;\u00bb).<\/p>\n<p>\u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f\u00a0SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0433\u043e\u0442\u043e\u0432, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">#include \"dicx_parser.hpp\" #include \"sql_checker.hpp\"  \/\/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 struct SQL {    template&lt; FixedString Query, typename... Args &gt;    constexpr static void Insert( Args const&amp;... args )    {       static_assert( mChecker.TableCount() &gt; 0, \"No tables loaded\" );       mChecker.CheckInsert&lt; Query, Args... &gt;();        \/\/ \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430       \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 compile-time \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e    }     template&lt; FixedString Query &gt;    consteval static void Select()    {       static_assert( mChecker.TableCount() &gt; 0, \"No tables loaded\" );       mChecker.ValidateSelect&lt; Query &gt;();        \/\/ \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430       \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 compile-time \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e    }  private:    inline static constexpr SqlChecker&lt; DicxParser &gt; mChecker; }; <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438.<\/p>\n<hr\/>\n<h2>\u041e\u0448\u0438\u0431\u043a\u0438, \u043e\u0442\u043b\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/h2>\n<pre><code class=\"cpp\">Uuid uuid; std::string description = \"description\", name = \"name\"; double rate = 4.6; int int_uuid;  \/\/ \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e Uuid-\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 - \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e SQL::Insert&lt; \"INSERT INTO Company (Description, Uuid, Name, Rating)\" &gt;            ( description, int_uuid, name, rate ); \/\/ \u0412\u042b\u0412\u041e\u0414: error: In template: static assertion failed due to requirement  \/\/ 'std::is_same_v&lt;int, Uuid&gt;': Type mismatch: expected UUID   \/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0435\u043c \u043f\u043e\u043b\u0435\u0439 \u043d\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 SQL::Insert&lt; \"INSERT INTO Company (Description, Uuid, Name, Rating)\" &gt;            ( description, name, rate ); \/\/ \u0412\u042b\u0412\u041e\u0414: error: In template: static assertion failed:  \/\/ Column count is not equal to argument count  \/\/ \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u0448\u0438\u0431\u0435\u043c\u0441\u044f \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 Uuid SQL::Insert&lt; \"INSERT INTO Company (Description, UUid, Name, Rating)\" &gt;            ( description, uuid, name, rate ); \/\/ \u0412\u042b\u0412\u041e\u0414: error: In template: static assertion failed: Unknown column name  \/\/ \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435\u0442, \u0442\u043e: SQL::Select&lt; \"SELECT Id FROM Car\" &gt;(); \/\/ \u0412\u042b\u0412\u041e\u0414: Unknown table<\/code><\/pre>\n<p>\u0418, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0433\u0434\u0435-\u0442\u043e \u044f \u043b\u0443\u043a\u0430\u0432\u043b\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0441\u0442\u043e\u043f\u043a\u043e\u0439 \u0432\u0430\u0440\u043d\u0438\u043d\u0433\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0433\u0430\u0434\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u0436\u0435 \u044d\u0442\u043e \u043f\u043e\u043b\u0435.. \u041d\u043e \u044d\u0442\u043e \u0442\u043e \u043c\u0430\u043b\u043e\u0435, \u0447\u0442\u043e \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441, \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0438 \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435. \u041d\u0435 \u0440\u0430\u0437 \u0438 \u043d\u0435 \u0434\u0432\u0430 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u0435\u0439, \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442, \u0447\u0442\u043e\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>constexpr<\/code>\u2011\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u043e\u043b\u0433\u0438\u0439 \u044d\u0442\u0430\u043f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0445\u0435\u043c\u0430\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445). \u0418\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 SQL, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0435 \u0434\u043b\u044f\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0422\u0435\u043c \u043d\u0435\u00a0\u043c\u0435\u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u00a0\u2014 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u0437\u0430\u00a0\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u00a0\u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.<\/p>\n<h2>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0435<\/h2>\n<p>\u041d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++26\u00a0\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 #embed \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441\u0445\u0435\u043c\u044b \u0438\u043b\u0438\u00a0\u0434\u0430\u043c\u043f \u0411\u0414 \u043f\u0440\u044f\u043c\u043e \u0432\u00a0\u043a\u043e\u0434 \u0431\u0435\u0437\u00a0\u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 constexpr \u2011\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0443\u043c\u043d\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432 <code>constexpr<\/code>\u2011\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u0441\u043a\u043e\u0440\u043e \u043d\u0435\u00a0\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0442\u0430\u0431\u043b\u0438\u0446\/\u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0436\u0451\u0441\u0442\u043a\u0438\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438\u00a0\u2014 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c std::vector, std::string.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0441\u00a0\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0435\u0439 \u0432\u00a0C++26: \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b\/\u0442\u0438\u043f\u044b \u043f\u043e\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u043b\u0438\u00a0\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0445\u0435\u043c, \u043d\u0435\u00a0\u043c\u0435\u043d\u044f\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434. \u0422\u0435\u043c \u043d\u0435\u00a0\u043c\u0435\u043d\u0435\u0435, \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, CMake) \u043d\u0435\u00a0\u0432\u00a0\u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a\/\u0440\u0435\u0441\u0443\u0440\u0441, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<blockquote>\n<p>\u00ab\u041e\u0448\u0438\u0431\u043a\u0438, \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c,\u00a0\u2014 \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u00a0\u0441\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c\u00bb<\/p>\n<\/blockquote>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 <code>constexpr<\/code> \u0438 <code>consteval<\/code>\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f\u00a0\u043f\u0440\u0435\u0434\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043d\u043e\u00a0\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0447\u0435\u0433\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u0438\u0445 \u043a\u00a0\u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u00a0\u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u044b \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432\u0441\u044e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u00a0\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440. \u041f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u0448\u044c \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439. \u042d\u0442\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u00a0\u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0435\u0449\u0451 \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u00a0\u043f\u0440\u0438\u0445\u043e\u0434\u043e\u043c C++26\u00a0\u044d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0430\u043d\u0435\u0442 \u0435\u0449\u0451 \u043c\u043e\u0449\u043d\u0435\u0435, \u043d\u043e\u00a0\u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u0434\u0441\u043f\u043e\u0440\u044c\u0435 \u0434\u043b\u044f\u00a0\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0440\u0430\u043d\u0442\u0430\u0439\u043c, \u043d\u0435\u00a0\u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044f \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f SQL. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<blockquote>\n<p>\u00ab\u041c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043a\u00a0\u0442\u043e\u043c\u0443, \u0447\u0442\u043e <code>constexpr<\/code>\u00a0\u2014 \u044d\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430. \u041f\u043e\u0440\u0430 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u00bb<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/godbolt.org\/z\/6KEYhTYGh\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<\/a><\/p>\n<div class=\"persona\"><img class=\"image persona__image\"\/><\/p>\n<h5 class=\"persona__heading\">\u041a\u043e\u0441\u0438\u043d\u0446\u0435\u0432 \u0410\u0440\u0442\u0451\u043c<\/h5>\n<p class=\"persona__text\">\u0418\u043d\u0436\u0435\u043d\u0435\u0440-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/929052\/\"> https:\/\/habr.com\/ru\/articles\/929052\/<\/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<figure class=\"full-width\"><\/figure>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 <code>constexpr<\/code>\/<code>consteval<\/code> \u0432\u00a0\u0421++ \u0436\u0438\u0432\u0443\u0442 \u0443\u0436\u0435 \u043d\u0435\u00a0\u043f\u0435\u0440\u0432\u044b\u0439 \u0433\u043e\u0434, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u043c\u2011\u0442\u043e \u043d\u0435\u044f\u0441\u043d\u044b\u043c\u0438\u0438\u043b\u0438\u00a0\u0447\u0435\u0440\u0435\u0441\u0447\u0443\u0440 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u043d\u044b\u043c\u0438. \u041f\u043e\u00a0\u0441\u0442\u0430\u0440\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0445 \u0440\u043e\u043b\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u043c\u2011\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u00ab\u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0432\u00a0compile\u2011time\u00bb, \u00ab\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0447\u0438\u0441\u0435\u043b\u00bb \u0438\u043b\u0438, \u0432\u00a0\u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u00ab\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0443 <code>if constexpr<\/code> \u0434\u043b\u044f\u00a0\u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb. \u0421\u043b\u043e\u0432\u043e\u043c, \u0438\u0433\u0440\u0443\u0448\u043a\u0430 \u0434\u043b\u044f\u00a0\u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u043e\u043a\u0443\u0441\u043e\u0432, \u043d\u043e\u00a0\u043d\u0435\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0443.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e C++ \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442. \u0421\u00a0\u0432\u044b\u0445\u043e\u0434\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 (C++20, C++23\u00a0\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e C++26) \u0438 \u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <code>constexpr<\/code>\u2011\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u00a0\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435,\u00a0\u2014 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f <code>constexpr<\/code> \u0438 <code>consteval<\/code> \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u00a0\u0440\u0430\u043c\u043a\u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u00a0\u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0443\u0436\u0435 \u0432\u00a0\u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430\u00a0\u043d\u0435\u00a0\u0433\u0434\u0435\u2011\u0442\u043e \u0432\u00a0CI \u0438\u043b\u0438, \u0447\u0442\u043e\u00a0\u0445\u0443\u0436\u0435, \u0432\u00a0runtime. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0435: <strong>\u0435\u0441\u043b\u0438 \u0447\u0442\u043e\u2011\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u00a0\u2014 \u043e\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u043d\u043e\u00a0\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/strong>. <\/p>\n<p>\u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <strong>\u043f\u043e\u043b\u043d\u0443\u044e compile\u2011time \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e <\/strong>SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u044f\u043c\u043e \u0432\u00a0\u043a\u043e\u0434. \u0411\u0435\u0437\u00a0\u043c\u0430\u0433\u0438\u0438, \u0431\u0435\u0437\u00a0\u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430, \u0431\u0435\u0437\u00a0\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0442\u0443\u043b\u043e\u0432. \u0422\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 C++ \u0438 \u0432\u0430\u0448\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0411\u0414. \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446, \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u0442\u0438\u043f\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u00a0\u2014 \u0432\u0441\u0451 \u043d\u0430\u00a0compile\u2011time. <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0435\u0441\u043b\u0438\u00a0\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u00ab\u0442\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435\u0442\u00bb, \u00ab\u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\u00bb, \u00ab\u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b\u00bb\u00a0\u2014 \u0434\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u00ab\u0441\u044e\u0440\u043f\u0440\u0438\u0437\u044b\u00bb \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 SQL \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0412\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435\u00a0\u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f.<\/p>\n<p><a href=\"https:\/\/godbolt.org\/z\/6KEYhTYGh\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<\/a><\/p>\n<hr\/>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 SQL \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445:<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414 \u0432\u00a0\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, XML, JSON \u0438\u043b\u0438\u00a0SQL DDL) \u0441\u00a0\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438, \u043f\u043e\u043b\u044f\u043c\u0438 \u0438 \u0438\u0445 \u0442\u0438\u043f\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b<\/strong>. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0445\u0435\u043c\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438. \u0412\u00a0\u0431\u0443\u0434\u0443\u0449\u0435\u043c C++26\u00a0\u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 #embed, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a\u00a0\u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442:<\/p>\n<p><code>constexpr const char data[] = { #embed \"test.json\", 0};<\/code><\/p>\n<p>\u0412\u00a0C++20\/23\u00a0\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0440\u0438\u043f\u0442\u2011\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u00a0\u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b<code>constexpr std::string_view<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0441\u0445\u0435\u043c\u044b \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>. \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <code>consteval<\/code> \u2011\u0444\u0443\u043d\u043a\u0446\u0438\u044f (\u0438\u043b\u0438 <code>constexpr<\/code> \u2011\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u043f\u0440\u0438\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438) \u0447\u0438\u0442\u0430\u0435\u0442 <code>string_view<\/code> \u0441\u0445\u0435\u043c\u044b \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0435\u0435. \u0412\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0411\u0414: \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u00a0constexpr \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438\u00a0\u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0441\u0442\u043e\u043b\u0431\u0446\u044b\u00a0\u2014 \u0432\u00a0constexpr \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u00a0\u043a\u043e\u0434\u0435 C++ \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b (\u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u00ab\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u00bb \u0438\u0437\u00a0\u0438\u043c\u0435\u043d \u0432\u00a0\u0442\u0438\u043f\u044b \u043f\u043e\u043b\u0435\u0439).<\/p>\n<\/li>\n<li>\n<p><strong>SQL\u2011\u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>. \u041b\u044e\u0431\u043e\u0439 SQL\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u00a0\u043a\u043e\u0434\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a\u00a0\u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0441\u00a0\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0435\u0439. \u0421\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e consteval \u2011\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u00a0\u043b\u0435\u043a\u0441\u0435\u043c\u044b (SELECT, FROM, WHERE \u0438\u00a0\u0442.\u00a0\u0434.), \u0441\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043f\u043e\u043b\u044f \u0441\u00a0\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439. \u0415\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 (\u043d\u0435 \u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043d\u0435\u00a0\u0442\u043e\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446, \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b), \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c <code>static_assert<\/code> \u0441\u00a0\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u043a\u0438\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\/\u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u0438\u0445 \u0442\u0438\u043f\u044b. \u042d\u0442\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u00a0\u043a\u043e\u0434\u0435 (\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u0437\u00a0\u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f) \u0438 \u0438\u043c\u0435\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>constexpr<\/code>\u2011\u0434\u0430\u043d\u043d\u044b\u0435. \u0412\u00a0\u0441\u0445\u0435\u043c\u0435 \u043d\u0435\u0442 \u0434\u0443\u0431\u043b\u0435\u0439: \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 (\u0441\u0445\u0435\u043c\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u00a0C++\u2011\u0442\u0438\u043f\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443\u0436\u0435 \u043a\u00a0\u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u00ab\u0437\u043d\u0430\u0435\u0442\u00bb, \u043a\u0430\u043a\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u0432\u00a0\u043d\u0438\u0445 \u0435\u0441\u0442\u044c. <\/p>\n<h4>\u0421\u0445\u0435\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438:<\/h4>\n<p><code>Column<\/code>\u00a0\u2014 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f ( <code>std::string_view <\/code>) \u0438 \u0442\u0438\u043f \u043f\u043e\u043b\u044f.<\/p>\n<p><code>Table<\/code>\u00a0\u2014 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 std::array&lt;Column&gt; \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p><code>Schema<\/code>\u00a0\u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u00a0\u0431\u0430\u0437\u0435.<\/p>\n<pre><code class=\"cpp\"> constexpr size_t MAX_COLUMNS = 100; constexpr size_t MAX_TABLES = 100;  struct Table {    enum ColumnType : int    {       BOOLEAN,       DATETIME,       DOUBLE,       ENUM,       HASHTABLE,       IDENTIFIER,       INT64,       INTEGER,       MONEY,       STRING,       UUID,    };    struct Column    {        std::string_view mName;       ColumnType mType;       bool mIsNotNull = false;    };     std::string_view mName;    std::array&lt; Column, MAX_COLUMNS &gt; mColumns{};    size_t Column_count = 0; };  struct Schema {    std::array&lt; Table, MAX_TABLES &gt; mTables{};    size_t mTableCount = 0; };<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u00a0\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0447\u0435\u0440\u0435\u0437 <strong>std::array<\/strong>\u00a0\u2014 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c <code>\u0421++23<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u0432 <code>\u0421++26<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0438\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0441\u00a0\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. <\/p>\n<p>\u0414\u043b\u044f\u00a0\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 <strong>XML\u2011\u0444\u0430\u0439\u043b<\/strong>, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 <strong>\u0441\u0445\u0435\u043c\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/strong> \u0432\u00a0\u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u043c \u0434\u043b\u044f\u00a0\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e DSL), \u044f \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u00a0cmake:<\/p>\n<pre><code class=\"cmake\">add_custom_command(   OUTPUT ${CMAKE_BINARY_DIR}\/generated_dicx.hpp   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}   COMMAND python3 ${CMAKE_SOURCE_DIR}\/tools\/embed_dicx.py           ${CMAKE_SOURCE_DIR}\/db.dicx           ${CMAKE_BINARY_DIR}\/generated_dicx.hpp   DEPENDS ${CMAKE_SOURCE_DIR}\/db.dicx )<\/code><\/pre>\n<p>\u041a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 python\u2011\u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u00a0\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0441\u0445\u0435\u043c\u044b \u0432\u00a0\u0445\u044d\u0434\u0435\u0440\u2011\u0444\u0430\u0439\u043b\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0434\u043b\u044f\u00a0\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0432\u00a0\u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0421\u0443\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u00a0\u2014 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u00a0\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u0411\u0414 \u0432\u00a0constexpr \u0432\u0438\u0434\u0435:<\/p>\n<pre><code class=\"cpp\">constexpr std::string_view dicx_xml =    R\"DICX(&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;     &lt;table name=\"Company\" responsible=\"\u041a\u043e\u0441\u0438\u043d\u0446\u0435\u0432 \u0410.\u0412.\"&gt;       &lt;comment&gt;\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439&lt;\/comment&gt;       &lt;column index_in_pk=\"0\" is_pk_part=\"1\" name=\"Uuid\"&gt;         &lt;comment&gt;Uuid \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&lt;\/comment&gt;         &lt;format&gt;           &lt;type&gt;UUID&lt;\/type&gt;           &lt;not_null&gt;true&lt;\/not_null&gt;         &lt;\/format&gt;       &lt;\/column&gt;     &lt;\/table&gt;   &lt;!-- \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b... --&gt; )DICX\";<\/code><\/pre>\n<p>\u0412\u00a0C++26\u00a0\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 <code>#embed<\/code>, \u0431\u0435\u0437\u00a0\u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u00a0\u0421++23\u00a0\u0441\u043e\u0439\u0434\u0435\u0442 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. <\/p>\n<p>\u042d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a\u00a0\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0443 <code>dicx_xml<\/code>. <\/p>\n<p>\u0414\u043b\u044f\u00a0\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d CRTP (Curiously Recurring Template Pattern). \u0422\u0430\u043a, \u043d\u0430\u0448 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>BaseParserCRTP<\/code>\u00a0\u2014 \u044d\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0438\u043c\u0435\u0442\u044c <code>constexpr<\/code>-\u043f\u043e\u043b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442, \u043a\u0430\u043a\u00a0\u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0445\u0435\u043c\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0430\u043c\u00a0\u0436\u0435 BaseParserCRTP \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Schema, \u0435\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">template&lt; typename Derived &gt; class BaseParserCRTP { protected:    static inline constexpr Schema mSchema = Derived::Parse();  public:    consteval static size_t TableCount()    {       return mSchema.mTableCount;    }     consteval static const Table* GetTable( std::string_view name )    {       for( auto const&amp; t : mSchema.mTables )          if( t.mName == name )             return &amp;t;       return nullptr;    } };<\/code><\/pre>\n<p>\u0414\u043b\u044f\u00a0\u0441\u0432\u043e\u0435\u0433\u043e XML\u2011\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u0441\u00a0\u043d\u0443\u0436\u043d\u044b\u043c \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u043c, \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u0430\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430\u0448\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0445\u0435\u043c\u044b \u0411\u0414:<\/p>\n<pre><code class=\"cpp\">#include \"base_parser.hpp\" #include \"generated_dicx.hpp\" #include &lt;string_view&gt;  class DicxParser : public BaseParserCRTP&lt; DicxParser &gt; { public:    consteval static Schema Parse();  private:    using ColumnType = Table::ColumnType;     static consteval size_t FindTag( std::string_view xml, std::string_view tag, size_t start = 0 );     static consteval std::string_view ExtractAttr( std::string_view tag, std::string_view key );     static consteval ColumnType ParseColumnType( std::string_view s ); };  inline consteval Schema DicxParser::Parse() {    Schema r;    size_t pos = 0;    while( true )    {       auto tbl_pos = FindTag( dicx_xml, \"&lt;table \", pos );       if( tbl_pos == dicx_xml.size() )          break;        auto end_tag = FindTag( dicx_xml, \"&gt;\", tbl_pos );       auto tag_str = dicx_xml.substr( tbl_pos, end_tag - tbl_pos );       auto name = ExtractAttr( tag_str, \"name=\" );       auto&amp; table = r.mTables[ r.mTableCount++ ];       table.mName = name;        size_t col_pos = end_tag;       auto table_close = FindTag( dicx_xml, \"&lt;\/table&gt;\", end_tag );       while( true )       {          auto cpos = FindTag( dicx_xml, \"&lt;column \", col_pos );          if( cpos &gt;= table_close )             break;           auto cend = FindTag( dicx_xml, \"&gt;\", cpos );          auto ctag = dicx_xml.substr( cpos, cend - cpos );          auto col_name = ExtractAttr( ctag, \"name=\" );           auto&amp; Column = table.mColumns[ table.Column_count++ ];          Column.mName = col_name;           auto tpos = FindTag( dicx_xml, \"&lt;type&gt;\", cend );          auto tend = FindTag( dicx_xml, \"&lt;\/type&gt;\", tpos );          auto type_name = utils::Trim( dicx_xml.substr( tpos + 6, tend - tpos - 6 ) );          Column.mType = ParseColumnType( type_name );           auto nn_pos = FindTag( dicx_xml, \"&lt;not_null&gt;\", tpos );          if( nn_pos &lt; table_close &amp;&amp; nn_pos &lt; FindTag( dicx_xml, \"&lt;\/not_null&gt;\", nn_pos ) )          {             auto nn_end = FindTag( dicx_xml, \"&lt;\/not_null&gt;\", nn_pos );             Column.mIsNotNull = dicx_xml.substr( nn_pos + 10, nn_end - nn_pos - 10 ) == \"true\";          }           col_pos = tend;       }        pos = table_close;    }    return r; }  inline consteval DicxParser::ColumnType DicxParser::ParseColumnType( std::string_view s ) {    if( s == \"UUID\" )       return ColumnType::UUID;    if( s == \"STRING\" )       return ColumnType::STRING;    if( s == \"INTEGER\" )       return ColumnType::INTEGER;    if( s == \"DOUBLE\" )       return ColumnType::DOUBLE;    if( s == \"BOOLEAN\" )       return ColumnType::BOOLEAN;    if( s == \"DATETIME\" )       return ColumnType::DATETIME;    if( s == \"ENUM\" )       return ColumnType::ENUM;    if( s == \"HASHTABLE\" )       return ColumnType::HASHTABLE;    if( s == \"IDENTIFIER\" )       return ColumnType::IDENTIFIER;    if( s == \"INT64\" )       return ColumnType::INT64;    if( s == \"MONEY\" )       return ColumnType::MONEY;     throw<\/code><\/pre>\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-467694","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467694","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=467694"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467694\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=467694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=467694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=467694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}