Creating a List Type Using std.variant.algebraic

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 27 13:54:01 PDT 2014


Meta:

> I should specify. This did not work:
>
> alias T = Algebraic!(int, This*);
>
> void main() {
> 	auto l = T(1, new T(2, new T(3, null)));
> }

An Algebraic is a sum type, so you can't store two value in it, 
only one, an int or a T*. But this is not going to solve your 
problems...

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list