Const Tuples
Dicebot via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Apr 25 05:32:06 PDT 2014
On Friday, 25 April 2014 at 12:17:31 UTC, bearophile wrote:
> In general a tuple is a higher level data structure compared to
> a struct. So it's not unreasonable to expect a Tuple to be more
> flexible than a struct.
Well, wrong :) std.typecons.Tuple IS a struct -
https://github.com/D-Programming-Language/phobos/blob/master/std/typecons.d#L388
> But in the specific const tuple case I don't know if it's a
> good idea to ask for a const tuple to be of the same type of a
> tuple with all const fields.
It would be weird exception of general type system rules with no
practical justification I can readily imagine.
> I was just expressing a little frustration :-)
>
> Bye,
> bearophile
More information about the Digitalmars-d-learn
mailing list