Concatenating Tuples

dsimcha dsimcha at yahoo.com
Tue Oct 14 20:44:29 PDT 2008


== Quote from BCS (ao at pathlink.com)'s article
> Reply to dsimcha,
> > Is there a way to concatenate tuples at compile time in D2?  The
> > obvious ~ operator doesn't work on tuples.  Also, while I'm at it,
> > maybe there's a better way to achieve my end goal here.  Is there a
> > way to get a tuple representation of a class object that includes the
> > stuff from the base classes?
> >
> just put them side by side.
> template Tpl(T...) { alias T Tpl; }
> alias Tpl!(a,b,c) A;
> alias Tpl!(d,e,f) B;
> alias Tpl!(A,B) C;

Sorry for the poorly worded question.  What you suggested would work for type
tuples.  I'm looking for a way to do this for value tuples, i.e. the kind you
would get from Object.tupleof.



More information about the Digitalmars-d mailing list