param2 = param1

"Luís "Luís
Mon Aug 26 15:22:41 PDT 2013


Is there a reason why template parameters can default to other 
template parameters, but not regular parameters? For instance:

     // OK
     int foo(int x, int y = x)()
     {
         return x*y;
     }

     // Not OK
     int foo(int x, int y = x)
     {
         return x*y;
     }

When I noticed this it seemed arbitrary, but maybe there's a 
reason?


More information about the Digitalmars-d mailing list