Re: C++ to D - recursion with std.variant

2015-04-05 Thread Dennis Ritchie via Digitalmars-d-learn
On Sunday, 5 April 2015 at 09:48:01 UTC, thedeemon wrote: On Friday, 3 April 2015 at 16:46:08 UTC, Dennis Ritchie wrote: Hi, Is it possible to write on D recursion using std.variant? Using Algebraic from std.variant and some additional templates: http://dpaste.dzfl.pl/65afd3a7ce52 (taken from

Re: C++ to D - recursion with std.variant

2015-04-05 Thread thedeemon via Digitalmars-d-learn
On Friday, 3 April 2015 at 16:46:08 UTC, Dennis Ritchie wrote: Hi, Is it possible to write on D recursion using std.variant? Using Algebraic from std.variant and some additional templates: http://dpaste.dzfl.pl/65afd3a7ce52 (taken from this thread: http://forum.dlang.org/thread/yidovyrczgdiveq

C++ to D - recursion with std.variant

2015-04-03 Thread Dennis Ritchie via Digitalmars-d-learn
Hi, Is it possible to write on D recursion using std.variant? - #include #include struct Nil {}; auto nil = Nil{}; template struct Cons; template using List = boost::variant>>; template struct Cons { Cons(T val, List list) : head(val), tail(list) {} T head; L