Forum Navigation
Can't create TreeMap!(double, myclass)()
Moderators:
kris
Posted: 03/11/07 17:20:34It looks like the key in TreeMap?! is required to be able to be null. This means you can't create a map with a numeric key! I got it to compile by creating a container for the double:
class TheKey? {
this(double aD) {
mD = aD;
}
bool opCmp(double aD) { return mD < aD; }
double mD;
}
But this is a silly thing to have to do; should I file a ticket on this?
HashMap? has the same problem, and also requires some kind of IReader stuff on the 'myclass' part. Maybe this read/write stuff should be in a HashMap? descendant, so you aren't required to have your class be capable of IReader or whatever.