Expression tuples
Simen kjaeraas
simen.kjaras at gmail.com
Wed Mar 16 13:28:48 PDT 2011
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
>
> // this example fails
> Tuple!(3, 7, 'c')
>
> typecons.d(298): Error: static assert "Attempted to instantiate Tuple
> with an invalid argument: 3"
>
> Even this fails:
> alias Tuple!(0) T;
>
> Is Tuple only meant to store types or named types?
std.typecons.Tuple is a value type, mostly like those tuples you find in
other languages like Python, Haskell, etc.
What you are likely looking for is std.typetuple.Typetuple.
--
Simen
More information about the Digitalmars-d-learn
mailing list