Template substitution for function parameters

user1234 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 1 03:58:51 PDT 2017


On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson 
wrote:
> So I have the following types
> ...
> i.e. it substitutes the template DevicePointer for the template 
> Buffer in Parameters!foo,
> The templates can be assumed to not be nested templates, i.e. 
> DevicePointer!(DevicePointer!(float)) will never occur neither 
> will Buffer!(Buffer!(float) or any cross templates)

Wow, this Question triggers an immediate headache...What about 
this ?

import std.traits: Parameters;
alias HostArgsOf(alias A) = AliasSeq!(Parameters!A[0], 
Parameters!A[1], Parameters!A[2]);


More information about the Digitalmars-d-learn mailing list