Const Tuples

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 25 04:51:47 PDT 2014


They are not the same type:


void main() {
     import std.typecons: Tuple;
     alias T1 = const Tuple!(int, int);
     alias T2 = Tuple!(const int, const int);
     static assert(is(T1 == T2)); // Fails.
}


This type difference causes some troubles when you use tuples.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list