Array of Template instantiations

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 20 11:44:25 PDT 2017


On Thursday, 20 July 2017 at 13:11:56 UTC, Alex wrote:
> On Thursday, 20 July 2017 at 12:33:43 UTC, Alex wrote:
>> The Problem is, i dont know what type WHAT_TYPE is / i donĀ“t 
>> know how to build a loopable something of futures.
>
> Ok, i think i understood now.
>
> my function `load` returns `KpiResponseEntity`
> so
>>Future!(KpiResponseEntity)[] futures;
> seems to work

To get the type you can also use `typeof`.

alias ResponseType = typeof(async(&load , queryA ));
ResponseType[] futures;
futures ~= async( &load , queryA );
futures ~= async( &load , queryB );
futures ~= async( &load , queryC );


More information about the Digitalmars-d-learn mailing list