{"id":260374,"date":"2015-06-30T08:54:02","date_gmt":"2015-06-30T04:54:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=260374"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=260374","title":{"rendered":"Compile-time \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f D"},"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>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 D \u0442\u0430\u043a\u0438\u043c \u0433\u0438\u0431\u043a\u0438\u043c \u0438 \u043c\u043e\u0449\u043d\u044b\u043c \u2014 compile-time \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438. D \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0430 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0435\u0451 \u0445\u0438\u0442\u0440\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u0422\u0430\u043a \u043a\u0430\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438 \u043a\u0430\u043a \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u044b\u0445 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u043f\u0440\u0438\u0451\u043c\u043e\u0432 \u2014 \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code>__traits( compiles, a + b ); is( typeof( a + b ) ); <\/code><\/pre>\n<p>  \u0418 __traits(compiles, expr) \u0438 is(typeof(expr)) \u0436\u0434\u0443\u0442 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043b\u0435\u043a\u0441\u0438\u043a\u0438, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 expr (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 12thb \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443). \u0412\u0435\u0434\u0443\u0442 \u0441\u0435\u0431\u044f \u043e\u043d\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e, \u043d\u043e \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u0442\u043e\u043d\u043a\u043e\u0435 \u0438\u0434\u0435\u0439\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u2014 is(typeof(expr)) \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0442\u0438\u043f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u043d\u043e \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044f \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0445 <b>\u043f\u043e\u043a\u0430<\/b> \u043d\u0435\u0442 \u0432 \u044f\u0437\u044b\u043a\u0435).<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\u0417\u0430\u0434\u0430\u0447\u0430: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439 \u043b\u044e\u0431\u044b\u0435 \u00ab\u043f\u043e\u0445\u043e\u0436\u0438\u0435\u00bb \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u00ab\u043f\u043e\u0445\u043e\u0436\u0438\u0435\u00bb \u043d\u0430 \u0447\u0438\u0441\u043b\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043c\u0430\u0442. \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435).<br \/>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code>template isNumArray(T) {     enum isNumArray = __traits(compiles,     {         auto a = T.init[0]; \/\/ opIndex \u0441 int \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c          static if( !__traits(isArithmetic,a) ) \/\/ \u0435\u0441\u043b\u0438 \u0442\u0438\u043f \u043d\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u0442\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d         {             static assert( __traits( compiles, a=a+a ) ); \/\/ \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f             static assert( __traits( compiles, a=a-a ) ); \/\/ \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f             static assert( __traits( compiles, a=a*.0f ) ); \/\/ \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 float         }          auto b = T.init.length; \/\/ \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e length         static assert( is( typeof(b) : size_t ) );     }); }  auto mean(T)( T arr ) @property if( isNumArray!T ) in { assert( arr.length &gt; 0 ); } body {     \/\/ \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e arr[index] \u0438 arr.length     \/\/ \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 arr[index] \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438     auto ret = arr[0] - arr[0]; \/\/ \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f (0)     foreach( i; 0 .. arr.length )         ret = ret + arr[i]; \/\/ \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u043f\u0440\u0430\u0442\u043e\u0440\u0430 +=     return ret * ( 1.0f \/ arr.length ); } <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435:  <\/p>\n<pre><code>import std.string : format;  struct Vec2 {     float x=0, y=0;      \/\/ \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f     auto opBinary(string op)( auto ref const Vec2 rhs ) const         if( op == &quot;+&quot; || op == &quot;-&quot; )     { mixin( format( &quot;return Vec2( x %1$s rhs.x, y %1$s rhs.y );&quot;, op ) ); }      \/\/ \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f     auto opBinary(string op)( float rhs ) const         if( op == &quot;*&quot; )     { return Vec2( x * rhs, y * rhs ); } }  struct Triangle {     Vec2 p1, p2, p3;      \/\/ \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 var[index]     auto opIndex(size_t v)     {         switch(v)         {             case 0: return p1;             case 1: return p2;             case 2: return p3;             default: throw new Exception( &quot;triangle have only three elements&quot; );         }     }      static pure size_t length() { return 3; } }  void main() {     auto f = [ 1.0f, 2, 3 ];     assert( f.mean == 2.0f ); \/\/ \u0441 float \u0447\u0438\u0441\u043b\u0430\u043c\u0438      auto v = [ Vec2(1,6), Vec2(2,7), Vec2(3,5) ];     assert( v.mean == Vec2(2,6) ); \/\/ \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 user-defined \u0442\u0438\u043f\u0430      auto t = Triangle( Vec2(1,6), Vec2(2,7), Vec2(3,5) );     assert( t.mean == Vec2(2,6) ); \/\/ \u0441 user-defined \u0442\u0438\u043f\u043e\u043c } <\/code><\/pre>\n<p>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/b>: \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 (isNumArray), \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 (opIndex \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f).  <\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f is(\u2026 )<\/h4>\n<p>  \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f is \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.  <\/p>\n<pre><code>is( T ); \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c T <\/code><\/pre>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0442\u0438\u043f T \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c.  <\/p>\n<pre><code>is( T == Type ); \/\/ \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0442\u0438\u043f T \u0442\u0438\u043f\u043e\u043c Type is( T : Type ); \/\/ \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0442\u0438\u043f T \u0431\u044b\u0442\u044c \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043a \u0442\u0438\u043f\u0443 Type <\/code><\/pre>\n<p> \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0444\u043e\u0440\u043c\u044b is, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043d\u043e\u0432\u044b\u0435 alias&#8217;\u044b  <\/p>\n<pre><code>is( T ident ); <\/code><\/pre>\n<p> \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u0430 T, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d alias \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c ident. \u041d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0441 \u043a\u0430\u043a\u043e\u0439 \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439  <\/p>\n<pre><code>is( T ident : Type ); is( T ident == Type ); <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>void foo(T)( T value ) {     static if( is( T U : long ) ) \/\/ \u0435\u0441\u043b\u0438 \u0442\u0438\u043f T \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a long         alias Num = U; \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e     else         alias Num = long; \/\/ \u0438\u043d\u0430\u0447\u0435 long } <\/code><\/pre>\n<\/div>\n<\/div>\n<p> \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0447\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0438\u043f, \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b  <\/p>\n<pre><code>is( T == Specialization ); <\/code><\/pre>\n<p> \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Specialization \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439: struct, union, class, interface, enum, function, delegate, const, immutable, shared. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0442\u0438\u043f T \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c, \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0438 \u0442.\u0434. \u0418 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u043e\u0440\u043c\u0430, \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 alias&#8217;\u0430  <\/p>\n<pre><code>is( T ident == Specialization ); <\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u0451\u043c \u2014 pattern-matching \u0442\u0438\u043f\u043e\u0432.  <\/p>\n<pre><code>is( T == TypeTempl, TemplParams... ); is( T : TypeTempl, TemplParams... );   \/\/ \u0441 \u043e\u0431\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c alias'\u043e\u0432 is( T ident == TypeTempl, TemplParams... ); is( T ident : TypeTempl, TemplParams... ); <\/code><\/pre>\n<p> \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 TypeTempl \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 (\u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0433\u043e), \u0430 TemplParams \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 TypeTempl.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>struct Foo(size_t N, T) if( N &gt; 0 ) { T[N] data; } struct Bar(size_t N, T) if( N &gt; 0 ) { float[N] arr; T value; }  void func(U)( U val ) {     static if( is( U E == S!(N,T), alias S, size_t N, T ) )     {         pragma(msg, &quot;struct like Foo: &quot;, E );         pragma(msg, &quot;S: &quot;, S.stringof);         pragma(msg, &quot;N: &quot;, N);         pragma(msg, &quot;T: &quot;, T);     }     else static if( is( U T : T[X], X ) )     {         pragma(msg, &quot;associative array T[X]: &quot;, U );         pragma(msg, &quot;T(value): &quot;, T);         pragma(msg, &quot;X(key):   &quot;, X);     }     else static if( is( U T : T[N], size_t N ) )     {         pragma(msg, &quot;static array T[N]: &quot;, U );         pragma(msg, &quot;T(value):  &quot;, T);         pragma(msg, &quot;N(length): &quot;, N);     }     else pragma(msg, &quot;other: &quot;, U );     pragma(msg,&quot;&quot;); }  void main() {     func( Foo!(10,double).init );     func( Bar!(12,string).init );     func( [ &quot;hello&quot;: 23 ] );     func( [ 42: &quot;habr&quot; ] );     func( Foo!(8,short).init.data );     func( 0 ); } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438  <\/p>\n<pre><code>struct like Foo: Foo!(10LU, double) S: Foo(ulong N, T) if (N &gt; 0) N: 10LU T: double  struct like Foo: Bar!(12LU, string) S: Bar(ulong N, T) if (N &gt; 0) N: 12LU T: string  associative array T[X]: int[string] T(value): int X(key):   string  associative array T[X]: string[int] T(value): string X(key):   int  static array T[N]: short[8] T(value):  short N(length): 8LU  other: int <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f __traits(keyWord, &#8230;)<\/h4>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c __traits, \u043f\u043e\u0441\u043b\u0435 \u043a\u043b\u044e\u0447\u0435\u0433\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 (\u0438\u043b\u0438 \u0438\u0445 \u0441\u043f\u0438\u0441\u043e\u043a, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438), \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u0442\u0438\u043f, \u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430. \u0414\u0440\u0443\u0433\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0435, \u043d\u0435\u0436\u0435\u043b\u0438 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u0447\u0435\u0433\u043e \u043b\u0438\u0431\u043e).<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0435 __traits:  <\/p>\n<ul>\n<li>compiles \u2014 \u0432\u0430\u043b\u0438\u0434\u043d\u043e \u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/li>\n<li>isAbstractClass \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b<\/li>\n<li>isArithmetic \u2014 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0438\u043f\u044b (\u0447\u0438\u0441\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f)<\/li>\n<li>isAssociativeArray \u2014 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b<\/li>\n<li>isFinalClass \u2014 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b (\u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c)<\/li>\n<li>isPOD \u2014 Plain Old Data \u2014 \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u043e\u0431\u0430\u0439\u0442\u043d\u044b\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c (\u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u043b\u044f, \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b)<\/li>\n<li>isNested \u2014 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (\u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430)<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class A { class B {} } pragma(msg, __traits(isNested,A.B)); \/\/ true <\/code><\/pre>\n<p>  <\/p>\n<pre><code>void f1() {     auto f2() { return 12; }     pragma(msg,__traits(isNested,f2)); \/\/ true } <\/code><\/pre>\n<p>  <\/p>\n<pre><code>auto f1() {     auto val = 12;     struct S { auto f2() { return val; } } \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 f1     return S.init; } pragma(msg,__traits(isNested,typeof(f1()))); \/\/ true <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>isFloating \u2014 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435)<\/li>\n<li>isIntegral \u2014 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/li>\n<li>isScalar \u2014 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (\u0447\u0438\u0441\u043b\u0430, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438), \u0445\u043e\u0442\u044f __vector(int[4]) \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c<\/li>\n<li>isStaticArray \u2014 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b<\/li>\n<li>isUnsigned \u2014 \u0446\u0435\u043b\u044b\u0435 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/li>\n<li>isVirtualMethod \u2014 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 (\u0442\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0438\u0442\u044c)<\/li>\n<li>isVirtualFunction \u2014 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0442\u0435, \u0447\u0442\u043e \u043b\u0435\u0436\u0430\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439)<\/li>\n<li>isAbstractFunction \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>isFinalFunction \u2014 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>isStaticFunction \u2014 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>isOverrideFunction \u2014 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>isRef \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u0441\u044b\u043b\u043a\u0430<\/li>\n<li>isOut \u2014 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u0441\u044b\u043b\u043a\u0430<\/li>\n<li>isLazy \u2014 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 (\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e)<\/li>\n<li>isSame \u2014 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435<\/li>\n<li>hasMember \u2014 \u0438\u043c\u0435\u0435\u0442 \u043b\u0438 \u043a\u043b\u0430\u0441\u0441\/\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043b\u0435\/\u043c\u0435\u0442\u043e\u0434, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0438\u043f (\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430), \u0432\u0442\u043e\u0440\u044b\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u043b\u044f\/\u043c\u0435\u0442\u043e\u0434\u0430<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>struct Foo { float value; } pragma(msg, __traits(hasMember, Foo, &quot;value&quot;)); \/\/ true pragma(msg, __traits(hasMember, Foo, &quot;data&quot;)); \/\/ false <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e is&lt;Some&gt;Function \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 isVirtualMethod \u0438 isVirtualFunction<\/b><\/p>\n<div class=\"spoiler_text\">\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0435\u0441\u0442, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0443  <\/p>\n<pre><code>import std.stdio, std.string;  string test(alias T)() {     string ret;     ret ~= is( typeof(T) == delegate ) ? &quot;D &quot; :            is( typeof(T) == function ) ? &quot;F &quot; : &quot;? &quot;;      ret ~= __traits(isVirtualMethod,T)    ? &quot;m|&quot; : &quot;-|&quot;;     ret ~= __traits(isVirtualFunction,T)  ? &quot;v|&quot; : &quot;-|&quot;;     ret ~= __traits(isAbstractFunction,T) ? &quot;a|&quot; : &quot;-|&quot;;     ret ~= __traits(isFinalFunction,T)    ? &quot;f|&quot; : &quot;-|&quot;;     ret ~= __traits(isStaticFunction,T)   ? &quot;s|&quot; : &quot;-|&quot;;     ret ~= __traits(isOverrideFunction,T) ? &quot;o|&quot; : &quot;-|&quot;;     return ret; }  class A {     static void stat() {}     void simple1() {}     void simple2() {}     private void simple3() {}     abstract void abstr() {}     final void fnlNOver() {} }  class B : A {     override void simple1() {}     final override void simple2() {}     override void abstr() {} }  class C : B {     final override void abstr() {} }  interface I {     void abstr();     final void fnl() {} }  struct S { void func(){} }  void globalFunc() {}  void main() {     A a; B b; C c; I i; S s;     writeln( &quot;        id  T m|v|a|f|s|o|&quot; );     writeln( &quot;--------------------------&quot; );     writeln( &quot;    lambda: &quot;, test!(x=&gt;x) );     writeln( &quot;  function: &quot;, test!((){ return 3; }) );     writeln( &quot;  delegate: &quot;, test!((){ return b; }) );     writeln( &quot;    s.func: &quot;, test!(s.func) );     writeln( &quot;    global: &quot;, test!(globalFunc) );     writeln( &quot;    a.stat: &quot;, test!(a.stat) );     writeln( &quot; a.simple1: &quot;, test!(a.simple1) );     writeln( &quot; a.simple2: &quot;, test!(a.simple2) );     writeln( &quot; a.simple3: &quot;, test!(a.simple3) );     writeln( &quot;   a.abstr: &quot;, test!(a.abstr) );     writeln( &quot;a.fnlNOver: &quot;, test!(a.fnlNOver) );     writeln( &quot; b.simple1: &quot;, test!(b.simple1) );     writeln( &quot; b.simple2: &quot;, test!(b.simple2) );     writeln( &quot;   b.abstr: &quot;, test!(b.abstr) );     writeln( &quot;   c.abstr: &quot;, test!(c.abstr) );     writeln( &quot;   i.abstr: &quot;, test!(i.abstr) );     writeln( &quot;     i.fnl: &quot;, test!(i.fnl) ); } <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442  <\/p>\n<pre><code>        id  T m|v|a|f|s|o| --------------------------     lambda: ? -|-|-|-|-|-|   function: ? -|-|-|-|s|-|   delegate: D -|-|-|-|-|-|     s.func: F -|-|-|-|-|-|     global: F -|-|-|-|s|-|     a.stat: F -|-|-|-|s|-|  a.simple1: F m|v|-|-|-|-|  a.simple2: F m|v|-|-|-|-|  a.simple3: F -|-|-|-|-|-|    a.abstr: F m|v|a|-|-|-| a.fnlNOver: F -|v|-|f|-|-|  b.simple1: F m|v|-|-|-|o|  b.simple2: F m|v|-|f|-|o|    b.abstr: F m|v|-|-|-|o|    c.abstr: F m|v|-|f|-|o|    i.abstr: F m|v|a|-|-|-|      i.fnl: F -|-|a|f|-|-| <\/code><\/pre>\n<p>  isVirtualMethod \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043e. \u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u043b\u0430\u0441\u044c, \u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0430 final, \u043e\u043d\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<br \/>  \u041d\u0430\u0441\u0447\u0451\u0442 \u0437\u043d\u0430\u043a\u043e\u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043e\u043a\u043e\u043b\u043e \u043b\u044f\u043c\u0431\u0434\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430) \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443, \u043e\u043d\u0438 \u043f\u043e \u043d\u0435\u0432\u0435\u0434\u043e\u043c\u043e\u0439 \u043c\u043d\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0438 \u043d\u0430 function \u043d\u0438 \u043d\u0430 delegate.  <\/div>\n<\/div>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u0447\u0442\u043e-\u043b\u0438\u0431\u043e:  <\/p>\n<ul>\n<li>identifier \u2014 \u043f\u0440\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 (\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d .stringof)<\/li>\n<li>getAliasThis \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430, \u0435\u0441\u043b\u0438 \u0443 \u0442\u0438\u043f\u0430 \u0435\u0441\u0442\u044c alias this, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0440\u0442\u0435\u0436\u0430 \u0441\u0442\u0440\u043e\u043a, \u0438\u043d\u0430\u0447\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u0440\u0442\u0435\u0436 (\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043c\u043d\u044e, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d alias this \u0434\u043b\u044f \u0442\u0438\u043f\u0430)<\/li>\n<li>getAttributes \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (UDA \u2014 user defined attributes)<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>enum Foo; class Bar { @&#8203;(42) @&#8203;Foo void func() pure @&#8203;nogc @&#8203;property {} }  pragma(msg, __traits(getAttributes, Bar.func)); \/\/ tuple(42, (Foo)), @&#8203;nogc \u0438 @&#8203;property \u043d\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u044d\u0442\u043e\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 @&#8203;Foo float value; pragma(msg, __traits(getAttributes, value)); \/\/ tuple((Foo)), \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>getFunctionAttributes \u043f\u0440\u043d\u0438\u043c\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a (UDA \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0441\u044e\u0434\u0430). \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f pure, nothrow, @\u200bnogc, @\u200bproperty, @\u200bsystem, @\u200btrusted, @\u200bsafe \u0438 ref (\u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443), \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432\/\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c const, immutable, inout \u0438 shared. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>enum Foo; class Bar { @&#8203;(42) @&#8203;Foo void func() pure @&#8203;nogc @&#8203;property {} }  pragma(msg, __traits(getFunctionAttributes, Bar.func)); \/\/ tuple(&quot;pure&quot;, &quot;@&#8203;nogc&quot;, &quot;@&#8203;property&quot;, &quot;@&#8203;system&quot;) <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>getMember \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0447\u0442\u043e \u0438 hasMember, \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class Bar { float value; } Bar bar;  __traits(getMember, bar, &quot;value&quot;) = 10; \/\/ \u0442\u043e\u0436\u0435 \u0447\u0442\u043e \u0438 bar.value = 10; <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>getOverloads \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\/\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\/\u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0443\u044e \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\/\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\/\u043c\u043e\u0434\u0443\u043b\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>import std.stdio;  class A {     void foo( float ) {}     void foo( string ) {}     int foo( int ) { return 12; } }  void main() {     foreach( f; __traits(getOverloads, A, &quot;foo&quot;) )         writeln( typeof(f).stringof ); } <\/code><\/pre>\n<p> \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442  <\/p>\n<pre><code>void(float _param_0) void(string _param_0) int(int _param_0) <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>getPointerBitmap \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 size_t. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0432\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c \u043c\u0443\u0441\u043e\u0440\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class A {     \/\/ \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0440\u0430\u0437\u043c\u0435\u0440 1 \u0441\u043b\u043e\u0432\u043e, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f GC: \u043d\u0435\u0442     \/\/ monitor, \u043d\u0435 \u043e\u0442\u043c\u0435\u0447\u0435\u043d, \u0440\u0430\u0437\u043c\u0435\u0440 1, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f GC: \u043d\u0435\u0442     float val1; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 1, GC: \u043d\u0435\u0442     A val2; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 1, GC: \u0434\u0430     void* val3; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 1, GC: \u0434\u0430     void[] val4; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 2 {\u0440\u0430\u0437\u043c\u0435\u0440 GC: \u043d\u0435\u0442,\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c GC: \u0434\u0430}     void function() val5; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 1, GC: \u043d\u0435\u0442     void delegate() val6; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 2 {\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 GC: \u0434\u0430,\u0444\u0443\u043d\u043a\u0446\u0438\u044f GC: \u043d\u0435\u0442} }  enum bm = 0b101011000; \/\/          ||||||||+- \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \/\/          |||||||+-- \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 monitor \/\/          ||||||+--- float val1 \/\/          |||||+---- A val2 \/\/          ||||+----- void* val3 \/\/          |||+------ void[] val4 \u0440\u0430\u0437\u043c\u0435\u0440 \/\/          ||+------- void[] val4 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \/\/          |+-------- void function() val5 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \/\/          +--------- void delegate() val6 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \/\/         0---------- void delegate() val6 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c static assert( __traits(getPointerBitmap,A) == [10*size_t.sizeof, bm] );  struct B { float x, y, z; } static assert( __traits(getPointerBitmap,B) == [3*float.sizeof, 0] ); \/\/ \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 B \u043d\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c \u043c\u0443\u0441\u043e\u0440\u0430 <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>getProtection \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b: \u00abpublic\u00bb, \u00abprivate\u00bb, \u00abprotected\u00bb, \u00abexport\u00bb \u0438 \u00abpackage\u00bb<\/li>\n<li>getVirtualMethods \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u043a getOverloads, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/li>\n<li>getVirtualFunctions \u2014 \u0442\u043e\u0436\u0435, \u0447\u0442\u043e \u0438 getVirtualMethods, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u044e\u0434\u0430 \u0432\u0445\u043e\u0434\u044f\u0442 final \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u043b\u0438<\/li>\n<li>getUnitTests \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\/\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\/\u043c\u043e\u0434\u0443\u043b\u044c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u044e\u043d\u0438\u0442\u0442\u0435\u0441\u0442\u043e\u0432 \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, UDA \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f<\/li>\n<li>parent \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>import std.stdio;  struct B {     float value;     void func() {} }  alias F = B.func;  void main() {     writeln( __traits(parent,writeln).stringof ); \/\/ module stdio     writeln( typeid( typeof( __traits(parent,F).value ) ) ); \/\/ float } <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>classInstanceSize \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430<\/li>\n<li>getVirtualIndex \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430), \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 (ptrdiff_t) \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 -1<\/li>\n<li>allMembers \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u0441\u0442\u0440\u043e\u043a \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 (sizeof, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/li>\n<li>derivedMembers \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0438\u043f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u0442\u0435\u0436 \u0441\u0442\u0440\u043e\u043a \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439, \u0431\u0435\u0437 \u0432\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u0431\u0435\u0437 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (\u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432)<\/li>\n<\/ul>\n<h4>\u0428\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b<\/h4>\n<p>  \u0412 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a  <\/p>\n<pre><code>void func(T)( T val ) { ... } <\/code><\/pre>\n<p>  \u041d\u043e \u0442\u0430\u043a \u0436\u0435 \u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u044b \u043a\u0430\u043a \u0438 \u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 is \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0435\u044f\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f pattern-matching&#8217;\u0430. \u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044f \u044d\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:  <\/p>\n<pre><code>import std.stdio;  void func(T:long)( T val ) { writeln( &quot;number&quot; ); } void func(T: U[E], U, E)( T val ) if( is( E == string ) ) { writeln( &quot;AA with string key&quot; ); } void func(T: U[E], U, E)( T val ) if( is( E : long ) ) { writeln( &quot;AA with num key&quot; ); }  void main() {     func( 120 ); \/\/ number     func( [&quot;hello&quot;: 12] ); \/\/ AA with string key     func( [10: 12] ); \/\/ AA with num key } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/h4>\n<p>  \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u0430\u043c \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u043d\u043d\u044b template&#8217;\u044b, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043b\u0438 \u0442\u0438\u043f \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430). \u041d\u043e \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 __traits \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f.  <\/p>\n<ul>\n<li><a href=\"http:\/\/dlang.org\/phobos\/std_traits.html\">std.traits<\/a> \u2014 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0438 \u043e\u0431\u0451\u0440\u0442\u043e\u043a<\/li>\n<li><a href=\"http:\/\/dlang.org\/phobos\/std_typetuple.html\">std.typetuple<\/a> \u2014 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u0440\u0442\u0435\u0436\u0430\u043c\u0438 \u0442\u0438\u043f\u043e\u0432<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  \u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044f \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0432\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043c\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0438 \u0433\u0438\u0431\u043a\u0438\u0435 \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 D \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0433\u0438\u0431\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u043e\u043c \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 (\u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0412\u044b \u0441\u0430\u043c\u0438) \u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e. \u0412\u0441\u0435\u0433\u0434\u0430 \u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b.   \t\t\t\t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u041f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c \u043b\u0438 \u0412\u044b \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"261349\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"13743\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv67723\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"67723\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv67723\">\u0414\u0430, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv67725\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"67725\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv67725\">\u0414\u0430, \u043d\u0435 \u0447\u0430\u0441\u0442\u043e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv67727\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"67727\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv67727\">\u0418\u043d\u043e\u0433\u0434\u0430, \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv67729\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"67729\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv67729\">\u041d\u0435\u0442, \u044d\u0442\u043e \u043d\u0435 \u0434\u043b\u044f \u043c\u0435\u043d\u044f (\u043c\u043e\u0439 \u042f\u041f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442)<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u041d\u0443\u0436\u043d\u0430 \u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f compile-time \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 D?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"261349\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"13745\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv67731\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"67731\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv67731\">\u0414\u0430<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv67733\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"67733\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv67733\">\u041d\u0435\u0442<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\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\/261349\/\"> http:\/\/habrahabr.ru\/post\/261349\/<\/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>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 D \u0442\u0430\u043a\u0438\u043c \u0433\u0438\u0431\u043a\u0438\u043c \u0438 \u043c\u043e\u0449\u043d\u044b\u043c \u2014 compile-time \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438. D \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0430 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0435\u0451 \u0445\u0438\u0442\u0440\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u0422\u0430\u043a \u043a\u0430\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438 \u043a\u0430\u043a \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?  <\/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-260374","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260374","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=260374"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260374\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}