enum and tuples

Ali Çehreli acehreli at yahoo.com
Sat Aug 10 22:29:40 PDT 2013


On 08/09/2013 10:41 AM, H. S. Teoh wrote:

 > 1) There's the built-in tuple, which is a compiler concept, and
 > basically means any sequential collections of "things" (for lack of a
 > better word). For example, you can have a sequence of types, like (int,
 > string, float), or a sequence of values, like (1, "a", 3.0), or even a
 > mixture of both, like (1, int, "a", float, string, 3.14). These
 > sequences are called "tuples".

Thank you and Jonathan. The above is exactly what helped me understand 
them finally. Your explanation matches my understanding exactly.

 > we abstract away the list of function/template arguments and
 > say those arguments are tuples, so then if something else
 > produces or returns a tuple, then we can plug that in where a
 > parameter list would be expected.

That was the missing piece of the puzzle for me.

And a very important point to make is that "the list of 
function/template arguments" are not TypeTuples. TypeTuple is just a 
tool that makes them available to the code.

Thank you,
Ali



More information about the Digitalmars-d-learn mailing list