Dynamic Ctors ?

Voitech via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 6 10:07:26 PST 2016


On Saturday, 6 February 2016 at 18:05:05 UTC, Voitech wrote:
> Hi, i have a variadic args template, with a class inside 
> something like:
>
> template foo(T...){
>
>
> class Inner(){
>
> ...
> ...
> }
>
>
>
> }
>
> Now i want to make Inner create or i will create manually, 
> constructor for each of T... parameter types, but don't know 
> what is syntax for it. I found that there is possibility to 
> initialize T... types static variables with AliasSeq!(T) but 
> how to do this automatically, or with static ifs,for 
> constructors ?
> I tried ...
>
> template foo(T...){
> alias Types=AliasSeq!(T);
> Algebraic!(T) value;
> this(Types value)
> this.value=value;
> }
> }
> But this dosn't work

This gives  Error: memcpy cannot be interpreted at compile time, 
because it has no available source code


More information about the Digitalmars-d-learn mailing list