Typed variadic template syntax?

anonymous anonymous at example.com
Wed Jan 29 14:59:49 PST 2014


On Wednesday, 29 January 2014 at 22:25:45 UTC, inout wrote:
>> int value(int xs[]...) {
>>  int result = 0;
>>  foreach (i; xs) {
>> 	result += 10 * result + i;
>>  }
>>  return result;
>> }
>>
>> unittest
>> {
>>  static assert(value(1, 2) == 21);
>> }
>>
>>
>> Andrei
>
> This allocates memory

no


More information about the Digitalmars-d mailing list