parameter type tuple or alias for std.traits templates ?
Timon Gehr
timon.gehr at gmx.ch
Fri Jun 22 16:05:06 PDT 2012
On 06/22/2012 11:50 PM, Guillaume Chatelet wrote:
> While reading the source code of std.traits I came across a bunch of
> variadic templates enforcing the length of their parameter type tuple to
> be of 1.
>
> Is there any semantic difference between
>> template ReturnType(func...) if (func.length == 1&& isCallable!func)
> and
>> template ReturnType(alias func) if (isCallable!func)
>
Yes there is, but I have argued that this is a bug in the past. With
DMD, the (func...) accepts built-in types, while the (alias func) does
not.
> If not, is there any reason why this syntax is used ?
>
> Guillaume
> --
More information about the Digitalmars-d
mailing list