{"id":260059,"date":"2015-06-24T19:16:01","date_gmt":"2015-06-24T15:16:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=260059"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=260059","title":{"rendered":"D \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"<p>     \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0445\u0430\u0431\u0440!<\/p>\n<p>  \u0423\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0439 \u044f\u0437\u044b\u043a, \u0430 \u0432 \u0441\u0435\u0442\u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c. \u041d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b. \u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0443\u0447\u043d\u043e\u0439, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432, \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445. \u0418\u0445 \u043e\u0431\u0438\u043b\u0438\u0435 \u0432 D \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0443\u0433\u043d\u0443\u0442\u044c \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u043e\u043c. \u0414\u0430 \u0438 \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041d\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u0443 \u0434\u0440\u0443\u0433\u0438\u0445)<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e:  <\/p>\n<pre><code>int z; \/\/ z == int.init == 0 int a = 5; \/\/ \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0438\u043f auto b = 5; \/\/ int auto bl = 5_000_000_000; \/\/ long, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 int \u043d\u0435 \u0432\u043b\u0435\u0437\u0435\u0442 auto bu = 5U; \/\/ uint, u \u0438\u043b\u0438 U \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0442\u0438\u043f unsigned auto bl2 = 5L; \/\/ long, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u0430\u044f L, l (\u0441\u0442\u0440\u043e\u0447\u043d\u0430\u044f L) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043f\u0443\u0442\u0430\u043d\u043d\u0430 1  auto bul = 5UL; \/\/ ulong, \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c U \u0438 L \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 const c = 5; \/\/ const(int) immutable d = 5; \/\/ immutable(int) shared e = 5; \/\/ shared(int) shared const f = 5; \/\/ shared(const(int)) shared immutable g = 5; \/\/ immutable(int) auto k; \/\/ \u043e\u0448\u0438\u0431\u043a\u0430: \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f, \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d import std.variant; Variant k2; \/\/ \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0412\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <\/code><\/pre>\n<p>  \u042f\u0432\u043d\u043e \u0442\u0438\u043f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f z, a, k2, \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u043d \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430, \u0442.\u043a. \u043f\u043e \u043d\u0435\u043c\u0443 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u041f\u0440\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/226565\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u043e\u043c\u0438\u043c\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0451 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 D \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u0430 (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Thread-local_storage\">TLS<\/a>), \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c shared \u0438\u043b\u0438 immutable. \u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0447\u0435\u043c immutable \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 const. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0442\u043e \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442, \u0438 \u0442\u0443 \u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0438\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043f\u043e \u0441\u0435\u043c\u0443 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043f\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<h4>\u0422\u0438\u043f\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432<\/h4>\n<p>  <\/p>\n<pre><code>int[] a; \/\/ \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 int[3] b; \/\/ \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 int[int] c; \/\/ \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 (\u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0442\u0438\u043f \u043a\u043b\u044e\u0447\u0430) int[][] d; \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 int[int[]] e; \/\/ \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0445\u043e\u0442\u044c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u043d\u043e \u043d\u0435 \u0443\u0434\u043e\u0431\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (immutable):  <\/p>\n<pre><code>e[cast(immutable(int)[])[8,3]] = 42; <\/code><\/pre>\n<p>  \u0418 \u0432\u043e\u0442 \u043c\u044b \u043f\u043b\u0430\u0432\u043d\u043e \u043a\u043e\u0441\u043d\u0443\u043b\u0438\u0441\u044c \u0442\u0435\u043c\u044b \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0442\u0438\u043f\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432  <\/p>\n<pre><code>immutable(int)[] a = [3,4]; \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 int'\u043e\u0432 a = [ 1, 2, 3, 4 ]; \/\/ \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0430\u043c\u0443 \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e a, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c (\u0442\u043e\u043b\u0441\u0442\u044b\u0439, \u0441 \u0434\u043b\u0438\u043d\u043e\u0439) a.length = 8; \/\/ \u0438 \u0442\u0430\u043a \u043c\u043e\u0436\u0435\u043c a ~= a; \/\/ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 a a[0] = 3; \/\/ \u043e\u0448\u0438\u0431\u043a\u0430: \u0441\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u043e\u043d\u0438 immutable(int)  immutable(int[]) b = [8,3]; \/\/ \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 int, \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f immutable int[] c = [1,2,3]; \/\/ immutable(int[]), \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 <\/code><\/pre>\n<p>  \u041d\u0435 \u043d\u0430\u0448\u0451\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c:  <\/p>\n<pre><code>const(shared(int)[]) a = [1]; \/\/ \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 shared(const(int)[]) b = [2]; \/\/ \u0440\u0430\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 const(shared int[]) c = [3]; \/\/ \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 shared(const int[]) d = [4]; \/\/ \u0440\u0430\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 <\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418 \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>void main() {     void fnc_a( const(shared(int)[]) a ) {}     void fnc_b( shared(const(int)[]) a ) {}     void fnc_c( const(shared int[]) a ) {}     void fnc_d( shared(const int[]) a ) {}      const(shared(int)[]) a = [1];     shared(const(int)[]) b = [2];     const(shared int[]) c = [3];     shared(const int[]) d = [4];      fnc_a( a );     fnc_a( b );     fnc_a( c );     fnc_a( d );      fnc_b( a );     fnc_b( b );     fnc_b( c );     fnc_b( d );      fnc_c( a );     fnc_c( b );     fnc_c( c );     fnc_c( d );      fnc_d( a );     fnc_d( b );     fnc_d( c );     fnc_d( d ); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u0435\u0436\u0434\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442 (\u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0442\u0438\u043f). \u041d\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u0440\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440 \u00ab\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00bb).<\/p>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e string, wstring, dstring \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e alias&#8217;\u044b \u0434\u043b\u044f immutable \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 const \u0438 immutable:  <\/p>\n<pre><code>import std.stdio; class A { int val; } void func1( const A a ) { writeln( a.val ); } void func2( immutable A a ) { writeln( a.val ); } void main() {     auto a = new A; \/\/ \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043d\u0435 const \u0438 \u043d\u0435 immutable     func1( a ); \/\/ \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435     func2( a ); \/\/ \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e func2 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0438\u043f\u0430 A, \u043d\u0443\u0436\u0435\u043d \u0438\u043c\u0435\u043d\u043d\u043e immutable } <\/code><\/pre>\n<p>  \u0418 \u0442\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e immutable \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e const. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c const \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0442\u043e \u043c\u044b \u0434\u0430\u0451\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044e, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 immutable \u043c\u044b \u0434\u0430\u0451\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044e, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c immutable \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a shared \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 (\u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0438 \u043d\u0438 \u043f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445).<br \/>  \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u0437\u043a\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043c class \u043d\u0430 struct (\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043d\u0435 \u043a\u0430\u043a new A, \u0430 \u043a\u0430\u043a A.init), \u0442\u043e \u043a\u043e\u0434 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u042d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0430 \u043a\u043b\u0430\u0441\u0441\u044b, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435. \u0410 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435\u044f\u0432\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443.<\/p>\n<p>  \u0422\u0438\u043f\u044b \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435:  <\/p>\n<pre><code>import std.stdio; struct A { int val; } void func0( ref A a ) { writeln( a.val ); } void func1( ref const A a ) { writeln( a.val ); } void func2( ref immutable A a ) { writeln( a.val ); } void main() {     auto a = A.init;     func0( a );     func1( a ); \/\/ \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0449\u0430\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438     func2( a ); \/\/ \u0442\u0443\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043a\u0430\u043a \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c     immutable A b;     func2( b );     func1( b ); \/\/ \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, immutable \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0442\u0438\u043f\u043e\u043c const     func0( b ); \/\/ \u0442\u0443\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0438\u0442, \u0447\u0442\u043e \u0442\u0430\u043a \u043d\u0435\u043b\u044c\u0437\u044f } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>void main() {     void fnc_a( ref const(shared(int)[]) a ) {}     void fnc_b( ref shared(const(int)[]) a ) {}     void fnc_c( ref const(shared int[]) a ) {}      const(shared(int)[]) a = [1];     shared(const(int)[]) b = [2];     const(shared int[]) c = [3];      fnc_a( a );     \/\/fnc_a( b );     \/\/fnc_a( c );      \/\/fnc_b( a );     fnc_b( b );     \/\/fnc_b( c );      \/\/fnc_c( a );     fnc_c( b );     fnc_c( c ); } <\/code><\/pre>\n<p>  \u041c\u0430\u0441\u0441\u0438\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u0441\u0442\u044b\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c (\u0432 D \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0443\u043a\u0437\u0430\u0442\u0435\u043b\u044c), \u0430 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443, \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438. \u0410 \u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0443\u0436\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439 ref const(shared int[]) \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c shared(const(int)[]), \u043d\u043e \u0442\u0443\u0442 \u0432\u0441\u0451 \u043b\u043e\u0433\u0438\u0447\u043d\u043e: \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 shared(const(int)), \u0430 \u0441\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432 shared, \u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f shared const. \u041f\u043e \u0441\u0443\u0442\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443. \u041d\u043e \u0432\u043e\u0442 \u0441 immutable \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u043f\u0440\u043e\u043a\u0430\u0442\u0438\u0442. \u0417\u0430\u0442\u043e \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 shared \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code>void main() {     void fnc_a( ref immutable(shared(int)[]) a ) {}     void fnc_b( ref shared(immutable(int)[]) a ) {}     void fnc_c( ref immutable(shared int[]) a ) {}      immutable(shared(int)[]) a = [1];     shared(immutable(int)[]) b = [2];     immutable(shared int[]) c = [3];      fnc_a( a );     \/\/fnc_a( b );     fnc_a( c );      \/\/fnc_b( a );     fnc_b( b );     \/\/fnc_b( c );      fnc_c( a );     \/\/fnc_c( b );     fnc_c( c ); } <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 a \u0438 \u0441 \u0441\u043e\u0432\u043f\u0430\u0434\u0451\u0442: immutable(int[]). \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 immutable \u00ab\u0441\u044a\u0435\u0434\u0430\u0435\u0442\u00bb \u0432\u0441\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438.  <\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u0442\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 const, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0412\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 inout:  <\/p>\n<pre><code>import std.stdio; inout(int)[] func( inout(int)[] a ) { return a[2..4]; } void main() {     auto a = [ 1,2,3,4,5 ];     auto af = func(a);     static assert( is( typeof(af) == int[] ) );      const(int)[] b = [ 1,2,3,4,5 ];     auto bf = func(b);     static assert( is( typeof(bf) == const(int)[] ) );      immutable(int)[] c = [ 1,2,3,4,5 ];     auto cf = func(c);     static assert( is( typeof(cf) == immutable(int)[] ) ); } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 (\u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043d\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0441 \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0435\u0442) \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e out:  <\/p>\n<pre><code>struct A { int val; } void func( out A a ) { } \/\/ \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c void main() {     auto a = A(5);     assert( a.val == 5 );     func( a );     assert( a.val == 0 ); \/\/ \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c } <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0437\u043e\u0432\u0430 func \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 a \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 A.init (\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0441 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0435\u0439, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0451\u043d. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e in, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, in \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f const scope, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435:  <\/p>\n<pre><code>void func( ref const int v ) {} <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0432 \u0446\u0435\u043b\u044f\u0445 \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 rvalue \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u043e\u0435\u0441\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u0430\u043a func(5), \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u043b \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 (\u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0445\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438). \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b:  <\/p>\n<pre><code>void func(T)( auto ref const T v ) if( is(T==int) ){} <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f auto ref \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u043a \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438, \u0430 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u043a\u043e\u043f\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b if( is(T==int) ) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u0430 T \u0441 int), \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f compile-time. \u041f\u043e \u0441\u0443\u0442\u0438 \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043e\u043a \u0438 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f 2 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f auto ref \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 <a href=\"http:\/\/forum.dlang.org\/post\/mm81tt$bph$1@digitalmars.com\">\u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f<\/a>, \u0438 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/D-Programming-Language\/dmd\/pull\/4717\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>. \u0412\u043e\u0442 \u0442\u0443\u0442 \u043d\u0435 \u0442\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f.  <\/div>\n<\/div>\n<p>  \u0412 D, \u043a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0435\u0441\u0442\u044c \u043b\u0435\u043d\u0438\u0432\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0430\u0433\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f) \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code>import std.stdio; void foo( bool x, lazy string str ) {     writeln( &quot;foo call&quot; );     if( x ) writeln( str ); } string bar() { writeln( &quot;build string&quot; ); return &quot;hello habr&quot;; } void main() {     writeln( &quot;x = false&quot; );     foo( false, bar() );     writeln( &quot;x = true&quot; );     foo( true, bar() ); } <\/code><\/pre>\n<p>  \u0432\u044b\u0432\u0435\u0434\u0435\u0442  <\/p>\n<pre><code>x = false foo call x = true foo call build string hello habr <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f (storage class) \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<ul>\n<li>\u043d\u0435\u0442 \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0430\u044f \u043a\u043e\u043f\u0438\u044f<\/li>\n<li>in \u2014 \u0442\u043e\u0436\u0435 \u0447\u0442\u043e \u0438 const scope<\/li>\n<li>out \u2014 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/li>\n<li>ref \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/li>\n<li>scope \u2014 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u043d\u0430 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u00ab\u0432\u044b\u043f\u0443\u0449\u0435\u043d\u043d\u044b \u043d\u0430\u0440\u0443\u0436\u0443\u00bb (escaped), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439*<\/li>\n<li>lazy \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/li>\n<li>const \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a const \u0442\u0438\u043f\u0443<\/li>\n<li>immutable \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a immutable \u0442\u0438\u043f\u0443<\/li>\n<li>shared \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a shared \u0442\u0438\u043f\u0443<\/li>\n<li>inout \u2014 \u0430\u0433\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a inout \u0442\u0438\u043f\u0443<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 scope<\/b><\/p>\n<div class=\"spoiler_text\">\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044f \u043d\u0435 \u043f\u043e\u043d\u044f\u043b \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442. \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e:  <\/p>\n<blockquote><p>scope \u2014 references in the parameter cannot be escaped (e.g. assigned to a global variable)<\/p><\/blockquote>\n<p>  \u0427\u0442\u043e \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430:  <\/p>\n<pre><code>int* glob1; int* glob2; struct A { int val; int* ptr; } void func( scope A a ) {     glob1 = &(a.val);     glob2 = a.ptr; } void main() {     auto val = 10;     auto a = A(5,&val);     func( a );     assert( &val != &(a.val) ); \/\/ a \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f     assert( &val == glob2 ); } <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u044f \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u043b? \u041c\u043e\u0436\u0435\u0442 \u043e\u043d\u0438 \u0432\u044b\u043f\u0438\u043b\u0438\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0445\u043e\u0442\u044f\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e scope deprecated. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0430\u0433.  <\/div>\n<\/div>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0435\u043d\u043d\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e auto \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code>auto func( int a ) { return a * 2; } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 return \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043c\u043b\u044e\u0449\u0438\u0439 \u0442\u0438\u043f:  <\/p>\n<pre><code>auto func( int a, double b ) \/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f double {     if( a &gt; b ) return a;     else if( b &gt; a ) return b;     else return 0UL; } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c auto ref \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f.  <\/p>\n<pre><code>class A {     auto ref int foo( ref int x ) { return 3; } } class B : A {     override auto ref int foo( ref int x ) { return x; } } class C : A {     int k;     override auto ref int foo( ref int x ) { return k; } } void main() {     auto a = new A;     auto b = new B;     auto c = new C;      int val = 10;     \/\/a.foo( val ) = 12; \/\/ \u043e\u0448\u0438\u0431\u043a\u0430: \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 rvalue \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435     b.foo( val ) = 14; \/\/ \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 val     assert( val == 14 );     c.foo( val ) = 16; \/\/ \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 c     assert( val == 14 );     assert( c.k == 16 ); } <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e @\u200bsafe, pure, nothrow \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u0445.<br \/>  \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0433 \u0437\u0430\u0431\u044b\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0430\u0436\u043d\u043e\u0435 (\u043d\u0435\u044f\u0432\u043d\u043e\u0435 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0432 \u044f\u0437\u044b\u043a\u0435), \u0442\u0430\u043a \u0447\u0442\u043e \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0442\u043e\u0440\u0430\u043c \u0432\u0435\u043b\u043a\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u043b\u044e.     \t<\/p>\n<div class=\"clear\"><\/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\/post\/261043\/\"> http:\/\/habrahabr.ru\/post\/261043\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0445\u0430\u0431\u0440!<\/p>\n<p>  \u0423\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0439 \u044f\u0437\u044b\u043a, \u0430 \u0432 \u0441\u0435\u0442\u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c. \u041d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b. \u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0443\u0447\u043d\u043e\u0439, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432, \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445. \u0418\u0445 \u043e\u0431\u0438\u043b\u0438\u0435 \u0432 D \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0443\u0433\u043d\u0443\u0442\u044c \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u043e\u043c. \u0414\u0430 \u0438 \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041d\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u0443 \u0434\u0440\u0443\u0433\u0438\u0445)  <\/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-260059","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260059","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=260059"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260059\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}