Sequence separation

Alexandru Ermicioi via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 21 13:28:34 PDT 2016


On Wednesday, 17 August 2016 at 19:38:22 UTC, Engine Machine 
wrote:
> Well, the is does work and that probably is the best solution. 
> I don't mind the extra type at this point. Of course, a library 
> solution for this type of stuff would be nice. I'd rather not 
> have to even use a type but rather use arrays:
> [a,b,[c,d]].

Maybe you can use Tuple from std.typecons, instead of custom 
structs, that group the arguments.

Ex:

alias seqWithSubSeq = AliasSeq!(a, b, Tuple!(c, d))

http://dlang.org/phobos/std_typecons.html#.Tuple


More information about the Digitalmars-d-learn mailing list