Replace (ie: substitute) a type in varadic args

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 2 04:12:33 PDT 2016


On Tuesday, 2 August 2016 at 08:22:15 UTC, Saurabh Das wrote:
> On Tuesday, 2 August 2016 at 08:20:22 UTC, Saurabh Das wrote:
>> On Tuesday, 2 August 2016 at 08:16:48 UTC, Sean Campbell wrote:
>>> [...]
>>
>> Thanks. Yes that is one approach. I figured out another 
>> approach that seems decent:
>>
>> auto targetFunctionProxy(Args...)(Args args)
>> {
>>     import std.meta;
>>     return targetFunction!(ReplaceAll!(bool, ubyte, 
>> Args))(args);
>> }
>
> PS: I'm unsure if this results in additional copying of 
> arguments in the case where there are no bools in the arguments.

Even if it does, the optimiser should take care of it. If it 
doesn't file a bug report.


More information about the Digitalmars-d-learn mailing list