{"id":215939,"date":"2014-03-15T17:36:03","date_gmt":"2014-03-15T13:36:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=215939"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=215939","title":{"rendered":"<span class=\"post_title\">C++11 \u0438 64-\u0431\u0438\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/034\/947\/5c8\/0349475c8bf4008cc4b16c2e432f69ec.png\" alt=\"CryEngine 3 SDK and PVS-Studio\" align=\"left\"\/><br \/>  \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0430\u0443\u0437\u0443 \u0432 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430. \u0412\u0435\u0434\u044c \u0431\u043b\u043e\u0433 C++ \u0447\u0438\u0442\u0430\u044e\u0442 \u0438 \u0442\u0435, \u043a\u0442\u043e \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u0443 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e. \u0410 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c \u0432 \u043c\u0438\u0440\u0435 C++ \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u0442\u0430\u043a\u0443\u044e \u00ab\u0443\u0441\u0442\u043e\u044f\u0432\u0449\u0443\u044e\u0441\u044f\u00bb \u0442\u0435\u043c\u0443, \u043a\u0430\u043a 64-\u0431\u0438\u0442\u043d\u044b\u0439 \u043c\u0438\u0440. \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++11 \u0432\u043b\u0438\u044f\u0435\u0442 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0447\u0435\u043c) \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u0431 \u044d\u0442\u043e\u043c. <br \/>  <a name=\"habracut\"><\/a><br \/>  64-\u0431\u0438\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u0434\u0430\u0432\u043d\u043e \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441\u0442\u0430\u043b\u0438 64-\u0431\u0438\u0442\u043d\u044b\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438\/\u0421\u0438++ \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u0447\u0438\u043d, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u0434 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0434\u043b\u044f 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041f\u0440\u043e \u044d\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0432 C++11, \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h2>\u041c\u0438\u0440 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/h2>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u043e\u0432\u0443\u0448\u0435\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f 64-\u0431\u0438\u0442\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438\/\u0421\u0438++. \u041f\u0440\u043e \u044d\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f. \u0422\u0435\u043c, \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438\u043b\u0438 \u0442\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043e\u0441\u0432\u0435\u0436\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.viva64.com\/ru\/a\/0065\/\">\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445<\/a>;<\/li>\n<li><a href=\"http:\/\/www.viva64.com\/ru\/l\/\">\u0423\u0440\u043e\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438\/\u0421\u0438++<\/a>;<\/li>\n<li><a href=\"http:\/\/www.viva64.com\/go.php?url=1357\">All about 64-bit programming in one place<\/a>.<\/li>\n<\/ul>\n<p>\u0412\u0440\u0435\u043c\u044f \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0438 \u0432\u043e\u0442 \u0443\u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u044f\u0437\u044b\u043a\u0430 C++, \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f C++11. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435 \u044f\u0437\u044b\u043a\u0430 C++11, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043c\u043e\u0433\u0443\u0442 \u043b\u0438 \u044d\u0442\u0438 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0411\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0439 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043a\u0430\u043a \u0435\u0451 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f C++11. \u0421\u0440\u0430\u0437\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0421++11 \u043c\u043e\u0436\u0435\u0442 \u0445\u043e\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u043f\u043e\u043c\u043e\u0447\u044c. \u0417\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0410 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043b\u0438\u0448\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432 \u044d\u0442\u043e\u043c, \u043d\u043e \u043d\u0435 \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430.<\/p>\n<h2>\u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430<\/h2>\n<p>  \u0420\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u0430\u043a 4, 32, 0x7FFFFFFF, 0xFFFFFFFF (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0009\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>). \u041f\u043b\u043e\u0445\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u0435\u043d 4 \u0431\u0430\u0439\u0442\u0430\u043c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">int **array = (int **)malloc(n * 4);<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++11 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430, \u044d\u0442\u043e \u0437\u043b\u043e \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0445 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  <b><i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/i><\/b><i> \u0414\u0430, malloc() \u044d\u0442\u043e \u043d\u0435 C++, \u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 C. \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 std::vector. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043a \u0434\u0435\u043b\u0443 \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f. \u0420\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043f\u0440\u043e \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430.<\/i><\/p>\n<p>  \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0421++11 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0431\u043e\u044f\u0437\u043d\u0438 (\u0447\u0430\u0441\u0442\u043e \u043d\u0435\u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0439), \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043b\u043e\u0445\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 generalized constant expressions (\u0441onstexpr).<\/p>\n<p>  \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <b>constexpr<\/b> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">constexpr int Formula(int a) {   constexpr int tmp = a * 2;   return tmp + 55; } int n = Formula(1);<\/code><\/pre>\n<p>  \u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Formula(1) \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u0447\u0438\u0441\u043b\u043e. \u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u0440\u0430\u0442\u043a\u043e\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u00abconstexpr\u00bb \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<h2>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<p>  \u0420\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u043a printf, scanf (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0010\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>). \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">size_t value = ....; printf(&quot;%u&quot;, value);<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 64-\u0431\u0438\u0442\u043d\u0443\u044e.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u043e\u043a \u044f\u0437\u044b\u043a\u0430 \u0421\u0438. \u0418\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0442\u0438\u043f\u043e\u0432 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412 \u0421\u0438++ \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043f\u043e\u0440\u0430 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0438\u0445. \u0415\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c printf \u043d\u0430 cout, \u0430 sprintf \u043d\u0430 boost::format \u0438\u043b\u0438 std::stringstream.<\/p>\n<p>  \u0421 \u044f\u0437\u044b\u043a\u043e\u043c C++11 \u0436\u0438\u0437\u043d\u044c \u0441\u0442\u0430\u043b\u0430 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435. \u0412 C++11 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (Variadic Templates). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 printf:  <\/p>\n<pre><code class=\"cpp\">void printf(const char* s) {   while (s &amp;&amp; *s) {     if (*s=='%' &amp;&amp; *++s!='%')       throw runtime_error(&quot;invalid format: missing arguments&quot;);     std::cout &lt;&lt; *s++;   } } template&lt;typename T, typename... Args&gt; void printf(const char* s, T value, Args... args) {   while (s &amp;&amp; *s) {     if (*s=='%' &amp;&amp; *++s!='%') {       std::cout &lt;&lt; value;       return printf(++s, args...);     }     std::cout &lt;&lt; *s++;   } }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u0434\u043e\u0441\u0442\u0430\u0435\u0442\u00bb \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e. \u041a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043f\u0435\u0440\u0432\u0430\u044f (\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f) \u0432\u0435\u0440\u0441\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 printf().<\/p>\n<p>  \u0422\u0438\u043f Args\u2026 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u00ab\u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432\u00bb (\u00abparameter pack\u00bb). \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440 \u0442\u0438\u043f\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u00ab\u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u00bb \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 printf() \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 (printf(const char*)). \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 printf() \u0441 \u0434\u0432\u0443\u043c\u044f \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 (printf(const char*, T value, Args\u2026 args)), \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c s, \u0432\u0442\u043e\u0440\u044b\u043c \u2013 value, \u0438 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (\u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0435\u0441\u0442\u044c) \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u044b \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 args, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435:  <\/p>\n<pre><code class=\"cpp\">printf(++s, args...); <\/code><\/pre>\n<p>  \u0413\u0440\u0443\u043f\u043f\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 args \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d, \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 \u0432\u0438\u0434\u0435 value. \u0418 \u0442\u0430\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 args \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u043c (\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 printf()).<\/p>\n<h2>\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0434\u0432\u0438\u0433\u0430<\/h2>\n<p>  \u0427\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b 1 \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f int. \u0417\u043d\u0430\u0447\u0438\u0442, \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 31 \u0440\u0430\u0437\u0440\u044f\u0434 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0011\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>). \u041f\u0440\u043e \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442, \u0438 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">ptrdiff_t mask = 1 &lt;&lt; bitNum;<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 bitNum \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0432\u043d\u043e, \u0441\u043a\u0430\u0436\u0435\u043c 40, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a undefined behavior (<a href=\"http:\/\/www.viva64.com\/ru\/b\/0142\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>).<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0447\u044c C++11? \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0438\u0447\u0435\u043c.<\/p>\n<h2>\u0420\u0430\u0441\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h2>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:  <\/p>\n<pre><code class=\"cpp\">int A(DWORD_PTR x);<\/code><\/pre>\n<p>  \u0410 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f:  <\/p>\n<pre><code class=\"cpp\">int A(DWORD x);<\/code><\/pre>\n<p>  \u0412 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0442\u0438\u043f\u044b DWORD_PTR \u0438 DWORD \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0012\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>). \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 A \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0432 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u0438 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>  \u0411\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0432 C++11.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <b>override<\/b>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0447\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c override \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 64-\u0431\u0438\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0435\u0437\u0432\u0440\u0435\u0436\u0435\u043d\u0430:  <\/p>\n<pre><code class=\"cpp\">struct X {   virtual int A(DWORD_PTR) { return 1; } }; struct Y : public X {   int A(DWORD x) override { return 2; } };<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430<\/h2>\n<p>  \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0430\u0436\u043d\u0430\u044f \u0438 \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f \u0442\u0435\u043c\u0430. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0437\u0430\u0434\u0435\u043b\u043e\u043c \u00ab64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0443\u0440\u043e\u043a\u043e\u0432\u00bb: <a href=\"http:\/\/www.viva64.com\/ru\/l\/0017\/\">\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430<\/a>.<\/p>\n<p>  \u0421\u043e\u0432\u0441\u0435\u043c \u043a\u0440\u0430\u0442\u043a\u043e:<\/p>\n<ol>\n<li>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 &#8216;int&#8217;, \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;int&#8217;. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u0418 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u041e\u043f\u0430\u0441\u043d\u043e \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c 32-\u0431\u0438\u0442\u043d\u044b\u0435 \u0438 64-\u0431\u0438\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f: \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0432\u0435\u0447\u043d\u044b\u0435 \u0446\u0438\u043a\u043b\u044b.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">char *p = new char[1024*1024*1024*5];<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 5 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00ab1024*1024*1024*5\u00bb \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f int. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e 1073741824 (1 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442). \u0417\u0430\u0442\u0435\u043c, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217;, \u0447\u0438\u0441\u043b\u043e 1073741824 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043e \u0434\u043e \u0442\u0438\u043f\u0430 size_t, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0443\u0436\u0435 \u043f\u043e\u0437\u0434\u043d\u043e).<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0442\u043e \u0432\u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">unsigned a = 1024, b = 1024, c = 1024, d = 5; size_t n = a * b * c * d;<\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430 &#8216;size_t&#8217;. \u041e\u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c UINT_MAX. \u041d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 &#8216;unsigned&#8217; \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d.<\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e 64-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0431\u043e\u043b\u0435\u0435 2 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442. \u041f\u0440\u043e\u044f\u0432\u043b\u044f\u044e\u0442 \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0431\u044a\u0451\u043c\u0430\u043c\u0438 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h3>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0430\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">size_t Count = BigValue; for (unsigned Index = 0; Index &lt; Count; ++Index) { ... }  <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u0447\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u0435\u0441\u043b\u0438 Count &gt; UINT_MAX. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043d\u0430 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f, \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c UINT_MAX \u0440\u0430\u0437. \u041d\u043e 64-\u0431\u0438\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0435\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Index \u043b\u0435\u0436\u0430\u0442 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [0..UINT_MAX], \u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u00abIndex &lt; Count\u00bb \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u0446\u0438\u043a\u043b\u0443.<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">string str = .....; unsigned n = str.find(&quot;ABC&quot;); if (n != string::npos)<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d. \u0424\u0443\u043d\u043a\u0446\u0438\u044f find() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 string::size_type. \u0412\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0432 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>  \u0412 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 string::size_type \u0438 unsigned \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u044e\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f, \u0444\u0443\u043d\u043a\u0446\u0438\u044f find() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 string::npos, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0432\u043d\u043e 0xFFFFFFFFFFFFFFFFui64. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b 0xFFFFFFFFu \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 32-\u0431\u0438\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435: 0xFFFFFFFFu != 0xFFFFFFFFFFFFFFFFui64. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 (n != string::npos) \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e!<\/p>\n<h3>\u041c\u043e\u0436\u0435\u0442 \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043c\u043e\u0447\u044c C++11?<\/h3>\n<p>  \u041e\u0442\u0432\u0435\u0442 \u2014 \u0438 \u0434\u0430, \u0438 \u043d\u0435\u0442.<\/p>\n<p>  \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <b>auto<\/b>. \u0410 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u00abauto a = &#8230;..\u00bb, \u0442\u043e \u0435\u0451 \u0442\u0438\u043f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 <b>\u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434<\/b>: \u00abauto n = 1024*1024*1024*5;\u00bb.<\/p>\n<p>  \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c \u0441\u043b\u043e\u0432\u0435 <b>auto<\/b>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">auto x = 7;<\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#8216;x&#8217; \u0431\u0443\u0434\u0435\u0442 &#8216;int&#8217;, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0438\u043c\u0435\u0435\u0442 \u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"cpp\">auto x = expression;<\/code><\/pre>\n<p>  \u0418 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#8216;x&#8217; \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u0442\u0438\u043f\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e &#8216;auto&#8217; \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u0437 \u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u043b\u0438\u0431\u043e \u0441\u043b\u043e\u0436\u0435\u043d \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">template&lt;class T&gt; void printall(const vector&lt;T&gt;&amp; v) {   for (auto p = v.begin(); p!=v.end(); ++p)     cout &lt;&lt; *p &lt;&lt; &quot;\\n&quot;; }<\/code><\/pre>\n<p>  \u0412 \u0421++98, \u0432\u0430\u043c \u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">template&lt;class T&gt; void printall(const vector&lt;T&gt;&amp; v) {     for (typename vector&lt;T&gt;::const_iterator p = v.begin();           p!=v.end(); ++p)       cout &lt;&lt; *p &lt;&lt; &quot;\\n&quot;; }<\/code><\/pre>\n<p>  \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u044f\u0437\u044b\u043a\u0435 C++11.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00ab1024*1024*1024*5\u00bb \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;int&#8217;. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u043c &#8216;auto&#8217; \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442. <\/p>\n<p>  \u041d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c &#8216;auto&#8217; \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0446\u0438\u043a\u043b\u0430:  <\/p>\n<pre><code class=\"cpp\">size_t Count = BigValue; for (auto Index = 0; Index &lt; Count; ++Index)<\/code><\/pre>\n<p>  \u0421\u0442\u0430\u043b\u043e \u043b\u0443\u0447\u0448\u0435? \u041d\u0435\u0442. \u0427\u0438\u0441\u043b\u043e 0 \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;int&#8217;. \u0417\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f Index \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0442\u0438\u043f \u043d\u0435 &#8216;unsigned&#8217;, \u0430 \u00abint&#8217;. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0442\u0430\u043b\u043e \u0434\u0430\u0436\u0435 \u0445\u0443\u0436\u0435.<\/p>\n<p>  <b>\u0422\u0430\u043a \u0435\u0441\u0442\u044c \u043b\u0438 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u043e\u043a \u043e\u0442 &#8216;auto&#8217;?<\/b> \u0414\u0430, \u0435\u0441\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0434\u0435\u0441\u044c:  <\/p>\n<pre><code class=\"cpp\">string str = .....; auto n = str.find(&quot;ABC&quot;); if (n != string::npos)<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;n&#8217; \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0442\u0438\u043f string::size_type. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>  \u0412\u043e\u0442 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u043c \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e &#8216;auto&#8217;. \u041e\u0434\u043d\u0430\u043a\u043e, \u0431\u0443\u0434\u044c\u0442\u0435 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435. \u041d\u0435 \u043d\u0430\u0434\u043e \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0431\u043e\u0440\u043e\u0442\u044c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e &#8216;auto&#8217;. \u042d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043d\u0435 \u043f\u0430\u043d\u0430\u0446\u0435\u044f.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u0432 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u043c \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:  <\/p>\n<pre><code class=\"cpp\">unsigned n = str.find(&quot;ABC&quot;);<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 (narrowing) \u0442\u0438\u043f\u043e\u0432. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f\u0437\u044b\u043a\u0438 \u0421 \u0438 \u0421++ \u043d\u0435\u044f\u0432\u043d\u043e \u043e\u0431\u0440\u0435\u0437\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0438\u043f\u044b:  <\/p>\n<pre><code class=\"cpp\">int x = 7.3;  \/\/ \u041e\u0439! void f(int); f(7.3);  \/\/ \u041e\u0439!<\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043f\u0438\u0441\u043a\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0421++11 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 (narrowing) \u0442\u0438\u043f\u043e\u0432:  <\/p>\n<pre><code class=\"cpp\">int x0 {7.3}; \/\/compilation error int x1 = {7.3}; \/\/compilation error double d = 7; int x2{d}; \/\/compilation error<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0432\u043e\u0442 \u044d\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">size_t A = 1; unsigned X = A; unsigned Y(A); unsigned Q = { A }; \/\/compilation error unsigned W { A }; \/\/compilation error<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">unsigned n = { str.find(&quot;ABC&quot;) };    \u0438\u043b\u0438 \u0442\u0430\u043a unsigned n{str.find(&quot;ABC&quot;)};<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 32-\u0431\u0438\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 64-\u0431\u0438\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<p>  \u041e\u043f\u044f\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u043f\u0430\u043d\u0430\u0446\u0435\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h2>\u0410\u0434\u0440\u0435\u0441\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430<\/h2>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0441\u0445\u043e\u0436\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u201e\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430\u201c. \u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u043b\u0438\u0448\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0013\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>).<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">float Region::GetCell(int x, int y, int z) const {   return array[x + y * Width + z * Width * Height]; }<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0437\u044f\u0442 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0436\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438, \u043a\u0430\u043a \u0441 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 GetCell, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c. \u041d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0438 \u043c\u0435\u043d\u0435\u0435 INT_MAX \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 int \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043c\u043e\u0447\u044c C++11? \u041d\u0435\u0442.<\/p>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439.<\/h2>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0014\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>). \u0415\u0449\u0451 \u0431\u044b\u0432\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0015\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>).<\/p>\n<p>  \u041e\u0448\u0438\u0431\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u044f\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0442\u0438\u043f\u043e\u0432. \u0421 \u043d\u043e\u0432\u044b\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0421++11 \u0437\u0434\u0435\u0441\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043d\u0435\u0442. \u042f\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0449\u0451 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043f\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0445 (union). \u0422\u0430\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0443\u043c\u0435\u043d\u0438\u0439 \u0438 \u0437\u043d\u0430\u043d\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0016\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>).<\/p>\n<h2>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h2>\n<p>  \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a 32-\u0431\u0438\u0442\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0019\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>).<\/p>\n<p>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++11 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u043b \u0436\u0438\u0437\u043d\u044c, \u0432\u0432\u0435\u0434\u044f \u0442\u0438\u043f\u044b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0420\u0430\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0438\u043f\u044b, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430:<\/p>\n<ul>\n<li>int8_t <\/li>\n<li>int16_t<\/li>\n<li>int32_t<\/li>\n<li>int64_t<\/li>\n<li>uint8_t <\/li>\n<li>uint16_t<\/li>\n<li>uint32_t<\/li>\n<li>uint64_t<\/li>\n<\/ul>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 (data alignment). \u042d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0021\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>). <\/p>\n<p>  \u041a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u044b, \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0421++11 \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 &#8216;alignment&#8217;. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">\/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 double alignas(double) unsigned char c[1024];  \/\/ \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e 16 \u0431\u0430\u0439\u0442\u043d\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 alignas(16) char[100];<\/code><\/pre>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;alignof&#8217;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 (\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0438\u043f\u043e\u043c). \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">constexpr int n = alignof(int);<\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <\/h2>\n<p>  \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 64-\u0431\u0438\u0442\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u0430 \u0434\u043b\u044f 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043d\u0435\u0439 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0438\u043f\u0430 size_t \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 (<a href=\"http:\/\/www.viva64.com\/ru\/l\/0022\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a>).<\/p>\n<p>  \u042f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0438\u0437 \u043d\u043e\u0432\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0442\u0438\u043f\u0430<\/h2>\n<p>  \u0411\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043b\u044e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>  \u0427\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">assert(sizeof(unsigned) &lt; sizeof(size_t)); assert(sizeof(short) == 2);<\/code><\/pre>\n<p>  \u041f\u043b\u043e\u0445\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u044f\u0432\u044f\u0442 \u0441\u0435\u0431\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  \u0413\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 _STATIC_ASSERT, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c Visual Studio. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cpp\">_STATIC_ASSERT(sizeof(int) == sizeof(long));<\/code><\/pre>\n<p>  C++11 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u0430\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. \u0412 \u044f\u0437\u044b\u043a \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 (static assertions).<\/p>\n<p>  \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f (\u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438) \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b:  <\/p>\n<pre><code class=\"cpp\">static_assert(expression, string);<\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0438 \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d false (\u0442.\u0435. \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u043e), \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. \u041f\u0440\u0438\u043c\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"cpp\">static_assert(sizeof(long)&gt;=8,    &quot;64-bit code generation required for this library.&quot;);  struct S { X m1; Y m2; }; static_assert(sizeof(S)==sizeof(X)+sizeof(Y),   &quot;unexpected padding in S&quot;);<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u044f\u0437\u044b\u043a\u0430 C++11 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u041e\u0434\u043d\u0430\u043a\u043e, \u044f\u0437\u044b\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c.<\/p>\n<h2>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043a\u0430\u043a \u0441 \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 C++11. \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 \u043d\u043e\u0432\u044b\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ol>\n<li>Bjarne Stroustrup. <a href=\"http:\/\/www.viva64.com\/go.php?url=1359\">C++11 \u2014 the new ISO C++ standard<\/a>.<\/li>\n<li>Wikipedia. <a href=\"http:\/\/www.viva64.com\/go.php?url=1360\">C++11<\/a>.<\/li>\n<li>Scott Meyers. <a href=\"http:\/\/www.viva64.com\/go.php?url=1361\">An Effective C++11\/14 Sampler<\/a>.<\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/215939\/\"> http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/215939\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/034\/947\/5c8\/0349475c8bf4008cc4b16c2e432f69ec.png\" alt=\"CryEngine 3 SDK and PVS-Studio\" align=\"left\"\/><br \/>  \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0430\u0443\u0437\u0443 \u0432 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430. \u0412\u0435\u0434\u044c \u0431\u043b\u043e\u0433 C++ \u0447\u0438\u0442\u0430\u044e\u0442 \u0438 \u0442\u0435, \u043a\u0442\u043e \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u0443 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e. \u0410 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c \u0432 \u043c\u0438\u0440\u0435 C++ \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u0442\u0430\u043a\u0443\u044e \u00ab\u0443\u0441\u0442\u043e\u044f\u0432\u0449\u0443\u044e\u0441\u044f\u00bb \u0442\u0435\u043c\u0443, \u043a\u0430\u043a 64-\u0431\u0438\u0442\u043d\u044b\u0439 \u043c\u0438\u0440. \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++11 \u0432\u043b\u0438\u044f\u0435\u0442 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0447\u0435\u043c) \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u0431 \u044d\u0442\u043e\u043c.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-215939","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/215939","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=215939"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/215939\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}