{"id":225507,"date":"2014-06-06T18:51:06","date_gmt":"2014-06-06T14:51:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=225507"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=225507","title":{"rendered":"<span class=\"post_title\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 D \u0438 C++ \u0438 Rust \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/225003\/\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Rust \u0438 \u0421++ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/a> \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u043e\u043c \u043d\u0430 D \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439.<\/p>\n<p>  \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 DMD v2.065 x86_64.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0438\u043f\u043e\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/h4>\n<blockquote><p>\u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0432 Rust \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e \u0438\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0447\u0451\u0442\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435 (\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0412\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0447\u0443\u0436\u043e\u0439\/\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d) \u0438 \u0432 \u043c\u0435\u0441\u0442\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0433\u0434\u0435 \u0432\u0441\u0451, \u0447\u0442\u043e \u043e\u0442 \u0412\u0430\u0441 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0442\u0438\u043f\u0443, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435:  <\/p>\n<pre><code class=\"rust\">trait Sortable {} fn sort&lt;T: Sortable&gt;(array: &mut [T]) {} fn main() {     sort(&mut [1,2,3]); } <\/code><\/pre>\n<p>  <\/p><\/blockquote>\n<p>  \u0412 D \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c guard, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 overload set, \u0435\u0441\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c.  <\/p>\n<pre><code class=\"cpp\">import std.traits;  \/\/ auto sort(T)(T[] array) {} - \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0435\u0437 guard \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f auto sort(T)(T[] array) if(isFloatingPoint!T) {}  void main() {     sort([1,2,3]); } <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0440\u0430\u0437\u0438\u0442 \u043d\u0435\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<blockquote><p>source\/main.d(27): Error: template main.sort cannot deduce function from argument types !()(int[]), candidates are:<br \/>  source\/main.d(23): main.sort(T)(T[] array) if (isFloatingPoint!T)  <\/p><\/blockquote>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0435 \u00ab\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435\u00bb \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 Rust \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"cpp\">template Sortable(T) {     \/\/ \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f swap \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430     enum Sortable = __traits(compiles, swap(T.init, T.init));     \/\/ \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435     static assert(Sortable, &quot;Sortable isn't implemented for &quot;~T.stringof~&quot;. swap function isn't defined.&quot;); }  auto sort(T)(T[] array) if(Sortable!T) {}  void main() {     sort([1,2,3]); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430:  <\/p>\n<blockquote><p>source\/main.d(41): Error: static assert \u00abSortable isn&#8217;t implemented for int. swap function isn&#8217;t defined.\u00bb<br \/>  source\/main.d(44): instantiated from here: Sortable!int<br \/>  source\/main.d(48): instantiated from here: sort!()  <\/p><\/blockquote>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u043e\u0432\u044b\u0445 \u043b\u043e\u0433\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438, \u043d\u043e \u0438 \u0446\u0435\u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b \u0432\u044b\u0441\u043e\u043a\u0430 \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0432\u043e\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435(!) \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0421 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 T \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c: \u0442\u0438\u043f\u043e\u043c, \u043b\u044f\u043c\u0431\u0434\u043e\u0439, \u0434\u0440\u0443\u0433\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c (\u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u0442.\u0434., \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c depended types), \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u2014 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e <s>\u0438\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/s> \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<h4>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/h4>\n<p>  \u0412 D \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443, \u0430 \u043d\u0435 GC. \u041d\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 C-\u0448\u043d\u043e\u0435 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 malloc:  <\/p>\n<pre><code class=\"cpp\">import std.c.stdlib;  void main() {     auto x = cast(int*)malloc(int.sizeof);     \/\/ \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 scope     scope(exit) free(x);           \/\/ \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u043c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443     free(x);     *x = 0; } <\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>*** Error in `demo&#8217;: double free or corruption (fasttop): 0x0000000001b02650 ***<\/p><\/blockquote>\n<p>  D \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430. \u041e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 GC \u2014 \u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u0441\u0435\u0431\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u043a\u043b\u0430\u0441\u0441 \u043e\u0448\u0438\u0431\u043e\u043a: \u0443\u0442\u0435\u0447\u043a\u0438, \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 RAII (scope \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435) \u043c\u043e\u0436\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u043d\u0443\u044e \u0431\u043e\u043b\u044c \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435.<\/p>\n<p>  \u0412 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u044b\u0448\u0435\u0434\u0448\u0435\u0439 \u043a\u043d\u0438\u0433\u0435 <a href=\"http:\/\/www.packtpub.com\/discover-advantages-of-programming-in-d-cookbook\/book\">D Cookbook<\/a> \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u044b, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u0440\u0443\u0447\u043d\u044b\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 \u043d\u0430 D (\u0431\u0435\u0437 GC \u0438 \u0431\u0435\u0437 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430). \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u043c \u043e\u0442\u043a\u0430\u0437\u0435 \u043e\u0442 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0438 GC, \u043d\u043e \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439. \u041c\u0435\u0441\u0442\u043e embedded-style \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0438\u043a\u0435\u043c \u043d\u0435 \u0437\u0430\u043d\u044f\u0442\u043e.<\/p>\n<h4>\u041f\u043e\u0442\u0435\u0440\u044f\u0432\u0448\u0438\u0439\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/h4>\n<p>  <\/p>\n<blockquote><p>\u0412\u0435\u0440\u0441\u0438\u044f Rust:  <\/p>\n<pre><code class=\"rust\">fn bar&lt;'a&gt;(p: &'a int) -&gt; &'a int {     return p; } fn foo(n: int) -&gt; &int {     bar(&n) } fn main() {     let p1 = foo(1);     let p2 = foo(2);     println!(&quot;{}, {}&quot;, *p1, *p2); } <\/code><\/pre>\n<p>  <\/p><\/blockquote>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 D (\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 C++ \u0438\u0437 \u043f\u043e\u0441\u0442\u0430-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430):  <\/p>\n<pre><code class=\"cpp\">import std.stdio;  int* bar(int* p) {     return p; }  int* foo(int n) {     return bar(&n); }  void main() {     int* p1 = foo(1);     int* p2 = foo(2);     writeln(*p1, &quot;,&quot;, *p2); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:  <\/p>\n<blockquote><p>2,2<\/p><\/blockquote>\n<p>  Rust \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e, \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u043d\u0438 \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u044f\u0437\u044b\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0449\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0438\u0437\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0437\u0430\u0449\u0438\u0442\u0443 D, \u0447\u0442\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 safe \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442:  <\/p>\n<blockquote><p>Error: cannot take address of parameter n in @ safe function foo<\/p><\/blockquote>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432 90% \u043a\u043e\u0434\u0430 \u043d\u0430 D \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f (\u043d\u0438\u0437\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u2014 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c), \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 ref:  <\/p>\n<pre><code class=\"cpp\">import std.stdio;  ref int bar(ref int p) {     return p; }  ref int foo(int n) {     return bar(n); }  void main()  {     auto p1 = foo(1);     auto p2 = foo(2);     writeln(p1, &quot;,&quot;, p2); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:<\/p>\n<blockquote><p>1,2<\/p><\/blockquote>\n<h4>\u041d\u0435\u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/h4>\n<p>  <\/p>\n<blockquote><p>C++  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; int minval(int *A, int n) {   int currmin;   for (int i=0; i&lt;n; i++)     if (A[i] &lt; currmin)       currmin = A[i];   return currmin; } int main() {     int A[] = {1,2,3};     int min = minval(A,3);     printf(&quot;%d\\n&quot;, min); } <\/code><\/pre>\n<p>  <\/p><\/blockquote>\n<p>  \u0412 D \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c T.init, \u043d\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:  <\/p>\n<pre><code class=\"cpp\">import std.stdio;  int minval(int[] A)  {     int currmin = void; \/\/ undefined behavior     foreach(a; A)         if (a &lt; currmin)             currmin = a;     return currmin; }  void main() {     auto A = [1,2,3];     int min = minval(A);     writeln(min); } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0432 \u043d\u043e\u0433\u0443 \u043d\u0443\u0436\u043d\u043e <b>\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e<\/b> \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c. \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 D \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, copy-paste \u043c\u0435\u0442\u043e\u0434\u043e\u043c).<\/p>\n<blockquote><p>\u0411\u043e\u043b\u0435\u0435 \u0438\u0434\u0438\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 (\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439) \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"rust\">fn minval(A: &[int]) -&gt; int {   A.iter().fold(A[0], |u,&a| {     if a&lt;u {a} else {u}   }) } <\/code><\/pre>\n<p>  <\/p><\/blockquote>\n<p>  \u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 D:  <\/p>\n<pre><code class=\"cpp\">int minval(int[] A) {     return A.reduce!&quot;a &lt; b ? a : b&quot;;     \/\/ \u0438\u043b\u0438     \/\/return A.reduce!((a,b) =&gt; a &lt; b ? a : b); } <\/code><\/pre>\n<h4>\u041d\u0435\u044f\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>  <\/p>\n<blockquote><p>C++  <\/p>\n<pre><code class=\"cpp\">struct A{     int *x;     A(int v): x(new int(v)) {}     ~A() {delete x;} };  int main() {     A a(1), b=a; } <\/code><\/pre>\n<p>  <\/p><\/blockquote>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 D:  <\/p>\n<pre><code class=\"cpp\">struct A {     int *x;          this(int v)     {         x = new int;         *x = v;     } }  void main() {     auto a = A(1);     auto b = a;          *b.x = 5;     assert(*a.x == 1); \/\/ fails } <\/code><\/pre>\n<p>  \u0412 D \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f (\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0441\u044f\u043c\u0438), \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0443\u0441\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e. \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c postblit \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u043f\u043e\u0447\u0442\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f):  <\/p>\n<pre><code class=\"cpp\">    this(this) \/\/ \u0432 \u0442\u0430\u043a\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a this     {             \/\/ \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043e\u0442\u043a\u0443\u0434\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0435 \u0438\u043c\u0435\u0435\u043c         auto newx = new int;         *newx = *x;         x = newx;     } <\/code><\/pre>\n<blockquote><p>Rust \u043d\u0438\u0447\u0435\u0433\u043e \u0437\u0430 \u0412\u0430\u0448\u0435\u0439 \u0441\u043f\u0438\u043d\u043e\u0439 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0425\u043e\u0442\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Eq \u0438\u043b\u0438 Clone? \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e deriving \u043a \u0412\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:  <\/p>\n<pre><code class=\"rust\">#[deriving(Clone, Eq, Hash, PartialEq, PartialOrd, Ord, Show)] struct A{     x: Box&lt;int&gt; } <\/code><\/pre>\n<p>  <\/p><\/blockquote>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0432 D \u043d\u0435\u0442. \u0414\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0432\u0441\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Structural_type_system\">structual typing<\/a> (\u0447\u0430\u0441\u0442\u043e \u043f\u0443\u0442\u0430\u044e\u0442 \u0441 duck typing), \u0435\u0441\u043b\u0438 \u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043d, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. <\/p>\n<h4>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438<\/h4>\n<p>  <\/p>\n<blockquote>\n<pre><code class=\"rust\">#include &lt;stdio.h&gt; struct X {  int a, b; };  void swap_from(X& x, const X& y) {     x.a = y.b; x.b = y.a; } int main() {     X x = {1,2};     swap_from(x,x);     printf(&quot;%d,%d\\n&quot;, x.a, x.b); } <\/code><\/pre>\n<p>  \u0412\u044b\u0434\u0430\u0451\u0442 \u043d\u0430\u043c:  <\/p>\n<blockquote><p>2,2<\/p><\/blockquote>\n<p>  <\/p><\/blockquote>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 D, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:  <\/p>\n<pre><code class=\"cpp\">struct X { int a, b; }  void swap_from(ref X x, const ref X y) {     x.a = y.b; x.b = y.a; }  void main() {     auto x = X(1,2);     swap_from(x, x);     writeln(x.a, &quot;,&quot;, x.b); } <\/code><\/pre>\n<p>  Rust \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u043e\u0431\u0435\u0436\u0434\u0430\u0435\u0442. \u042f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c memory overlapping \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430 D.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440<\/h4>\n<p>  \u0412 D \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u0430 \u043d\u0430 <a href=\"http:\/\/ddili.org\/ders\/d.en\/ranges.html\">Ranges<\/a>, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0440\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0435:  <\/p>\n<pre><code class=\"cpp\">import std.stdio;  void main() {     int[] v;     v ~= 1;     v ~= 2;          foreach(val; v)     {         if(val &lt; 5)         {             v ~= 5 - val;         }     }     writeln(v); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:  <\/p>\n<blockquote><p>[1, 2, 4, 3]<\/p><\/blockquote>\n<p>  \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 range, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0431\u043b\u043e\u043a\u0430 foreach \u0434\u0430\u043d\u043d\u044b\u0439 range \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u0441\u0442\u0430\u0440\u043e\u0433\u043e\u00bb \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0445\u0432\u043e\u0441\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">import std.stdio; import std.container;  void main() {     DList!int v;     v.insert(1);     v.insert(2);          foreach(val; v[]) \/\/ \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 [] \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 range      {         if(val &lt; 5)         {             v.insertFront(5 - val);             v.insertBack(5 - val);         }     }     writeln(v[]); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:  <\/p>\n<blockquote><p>[3, 4, 1, 2, 4, 3]<\/p><\/blockquote>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0435\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0441\u0442\u0430\u0440\u044b\u0439 range \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0430 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043f\u0438\u044f\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f GC \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u0432\u0438\u0441\u0448\u0438\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0433\u0440\u044b\u0437\u043a\u0430\u0445. \u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<h4>\u041e\u043f\u0430\u0441\u043d\u044b\u0439 Switch<\/h4>\n<p>  <\/p>\n<blockquote>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; enum {RED, BLUE, GRAY, UNKNOWN} color = GRAY; int main() {   int x;   switch(color) {     case GRAY: x=1;     case RED:     case BLUE: x=2;   }   printf(&quot;%d&quot;, x); }  <\/code><\/pre>\n<p>  \u0412\u044b\u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u00ab2\u00bb. \u0412 Rust \u0436\u044b \u0412\u044b \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0440\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442 break.  <\/p><\/blockquote>\n<p>  \u0412 D \u043f\u0435\u0440\u0435\u0434 switch \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e final, \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0430\u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 final \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 default \u0431\u043b\u043e\u043a\u0430. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043d\u0435\u044f\u0432\u043d\u043e\u0435 \u00ab\u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u043d\u0438\u0435\u00bb \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043e \u043a\u0430\u043a deprecated, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u044f\u0432\u043d\u044b\u0439 goto case. \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">import std.stdio;  enum Color {RED, BLUE, GRAY, UNKNOWN} Color color = Color.GRAY;  void main() {     int x;     final switch(color) {         case Color.GRAY: x = 1;         case Color.RED:         case Color.BLUE: x = 2;     }          writeln(x); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430:  <\/p>\n<blockquote><p>source\/main.d(227): Error: enum member UNKNOWN not represented in final switch<br \/>  source\/main.d(229): Warning: switch case fallthrough \u2014 use &#8216;goto case;&#8217; if intended<br \/>  source\/main.d(229): Warning: switch case fallthrough \u2014 use &#8216;goto case;&#8217; if intended<\/p><\/blockquote>\n<h4>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439<\/h4>\n<p>  <\/p>\n<blockquote>\n<pre><code class=\"cpp\">int main() {   int pixels = 1;   for (int j=0; j&lt;5; j++);     pixels++; } <\/code><\/pre>\n<p>  \u0412 Rust \u0412\u044b \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u043e\u0432 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438. \u041c\u0435\u043b\u043e\u0447\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e \u043e\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435.  <\/p><\/blockquote>\n<p>  \u0412 D \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u2014 \u043e\u0448\u0438\u0431\u043a\u0438) \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c; \u043d\u0430 {}.<\/p>\n<h4>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>  <\/p>\n<blockquote>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;pthread.h&gt; #include &lt;unistd.h&gt;  class Resource {     int *value; public:     Resource(): value(NULL) {}     ~Resource() {delete value;}     int *acquire() {         if (!value) {             value = new int(0);         }         return value;     } };  void* function(void *param) {     int *value = ((Resource*)param)-&gt;acquire();     printf(&quot;resource: %p\\n&quot;, (void*)value);     return value; }  int main() {     Resource res;     for (int i=0; i&lt;5; ++i) {         pthread_t pt;         pthread_create(&pt, NULL, function, &res);     }     \/\/sleep(10);     printf(&quot;done\\n&quot;); } <\/code><\/pre>\n<p>  \u041f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e:<br \/>  done  <\/p>\n<blockquote><p>resource: 0x7f229c0008c0<br \/>  resource: 0x7f22840008c0<br \/>  resource: 0x7f228c0008c0<br \/>  resource: 0x7f22940008c0<br \/>  resource: 0x7f227c0008c0  <\/p><\/blockquote>\n<p>  <\/p><\/blockquote>\n<p>  \u0412 D \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e Rust \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u043c\u043e\u0439, \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u043a\u043e\u043f\u0438\u0435\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Thread-local_storage\">TLS<\/a>), \u0430 \u0432\u0441\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u043e\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c shared. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 D:  <\/p>\n<pre><code class=\"cpp\">import std.concurrency; import std.stdio;  class Resource {     private int* value;          int* acquire()     {         if(!value)         {             value = new int;         }         return value;     } }  void foo(shared Resource res) {     \/\/ Error: non-shared method main.Resource.acquire is not callable using a shared object     writeln(&quot;resource &quot;, res.acquire); }  void main() {     auto res = new shared Resource();     foreach(i; 0..5)     {         spawn(&foo, res);     }     writeln(&quot;done&quot;); } <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b \u044f\u0432\u043d\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435 \u0434\u0430\u043b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0441 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 race condition. \u0412 D \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c Java-like \u043c\u043e\u043d\u0438\u0442\u043e\u0440-\u043c\u044c\u044e\u0442\u0435\u043a\u0441 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"cpp\">synchronized class Resource {     private int* value;          shared(int*) acquire()     {         if(!value)         {             value = new int;         }         return value;     } } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:  <\/p>\n<blockquote><p>done<br \/>  resource 7FDED3805FF0<br \/>  resource 7FDED3805FF0<br \/>  resource 7FDED3805FF0<br \/>  resource 7FDED3805FF0<br \/>  resource 7FDED3805FF0<\/p><\/blockquote>\n<p>  \u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 acquire, \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 acquire, \u0432 D \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043a\u0430\u043a shared, const, immutable \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438, \u0435\u0441\u043b\u0438 \u0438\u043c\u0438 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441, \u0442\u043e \u0438 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043f\u043e\u043b\u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0442\u044f\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c. <\/p>\n<h4>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434<\/h4>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Rust \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0432 D \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f @ system, \u0442.\u0435. \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c. \u041a\u043e\u0434, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 @ safe, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0438 \u043d\u0435 \u0434\u0430\u0435\u0442 \u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430, \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438. \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 @ trusted, \u044d\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044b \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0441 Rust, \u044f \u043e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u044e \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0449\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0438\u0437\u043d\u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043b\u044f D. \u00ab\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u043d\u044b\u0439\u00bb \u043e\u0431\u043c\u0435\u043d \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u0443.      \t<\/p>\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\/post\/225507\/\"> http:\/\/habrahabr.ru\/post\/225507\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/225003\/\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Rust \u0438 \u0421++ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/a> \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u043e\u043c \u043d\u0430 D \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439.<\/p>\n<p>  \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 DMD v2.065 x86_64.  <\/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-225507","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/225507","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=225507"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/225507\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}