ADL

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 3 18:34:47 PDT 2016


On 9/3/2016 5:36 PM, Timon Gehr wrote:
> Does not work. Local overloads are not supported.

Yeah, you're right, should have tested that:

   void abc(int);
   void def(uint);

   void foo()
   {
     alias func = abc;
     alias func = def; // error

       func(1);
   }

fails. Pushing it out a level works:

   void abc(int);
   void def(uint);

   template foo()
   {
     alias func = abc;
     alias func = def;

     void foo()
     {
         func(1);
     }
   }

   void main()
   {
     foo();
   }


More information about the Digitalmars-d mailing list