Default argument for template tuple function parameter

Vladimir Panteleev vladimir at thecybershadow.net
Tue Sep 6 14:04:48 PDT 2011


On Tue, 06 Sep 2011 14:37:55 +0300, Timon Gehr <timon.gehr at gmx.ch> wrote:

> Workaround:
>
> AddressInfo[] getAddressInfo()(string node){return  
> getAddressInfo(node,cast(string)null);}
> AddressInfo[] getAddressInfo(T...)(string node, string service, T  
> options);

Thanks, I tried this at first as well, but was turned off by having to  
cast null to string. In the end I just made the string parameter part of  
the variadic tuple.

> And this smells like a compiler bug.

Posted http://d.puremagic.com/issues/show_bug.cgi?id=6613.

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d-learn mailing list