www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - UFCS on template alias ?

reply "Baz" <bb.temp gmx.com> writes:
Is this a normal behaviour ?

void main()
     import std.algorithm;
     auto list = [0,1,2,3];
     alias poly = map;
     list.poly!(a => a + a);


"Error: no property 'poly' for type 'int[]'"
Feb 21 2015
parent "bearophile" <bearophileHUGS lycos.com> writes:

 Is this a normal behaviour ?
Try to move the definition of "poly" to module-level scope. This is a design decision to avoid other troubles. Bye, bearophile
Feb 21 2015