Expression tuples
Steven Schveighoffer
schveiguy at yahoo.com
Wed Mar 16 14:43:20 PDT 2011
On Wed, 16 Mar 2011 17:31:06 -0400, Simen kjaeraas
<simen.kjaras at gmail.com> wrote:
> On Wed, 16 Mar 2011 21:51:37 +0100, Steven Schveighoffer
> <schveiguy at yahoo.com> wrote:
>
>> On Wed, 16 Mar 2011 16:28:48 -0400, Simen kjaeraas
>> <simen.kjaras at gmail.com> wrote:
>>
>>> On Wed, 16 Mar 2011 21:07:08 +0100, simendsjo
>>> <simen.endsjo at pandavre.com> wrote:
>>>
>>>> http://www.digitalmars.com/d/2.0/tuple.html
>
>> If you read that page he is referring to, it seems like you should be
>> able to create an expression tuple.
>>
>> I don't know if that works with std.typecons.tuple.
>>
>> In fact, I don't think I've ever seen some of the stuff that's in that
>> page, especially the mixed type+expression tuple. Is it valid?
>
> Oh, absolutely. Given that you use the Tuple template declared at the top
> of the page. However, I would recommend the page be rewritten so as not
> to cause confusion between that and std.typecons.Tuple.
>
As I was confused there and thought we were talking about
std.typecons.Tuple, I wholeheartedly agree :)
Now I am concerned, this looks like an oxymoron:
TypeTuple!(1, 2, 3)
Should we think about changing the name of std.typetuple.TypeTuple since
it can clearly contain expressions as well as types? I would actually
argue that TypeTuple should be called Tuple, and Tuple be called
ValueTuple or something, but I understand we probably cannot do that at
this point...
-Steve
More information about the Digitalmars-d-learn
mailing list