== Quote from Andrei Alexandrescu ([email protected])'s article
> There is a wart in D I'd like to eliminate. Unfortunately, that would
> also eliminate some valid uses.
I'll say. One more example that I forgot to include, but I think is pretty
important:
struct CheckedInt {
int num;
/// Rest of implementation.
bool opEquals(CheckedInt rhs) const {
return num == rhs.num;
}
}
CheckedInt fun() {
return CheckedInt(5);
}
assert(fun() == CheckedInt(5)); // Wouldn't compile.
Requiring an explicit temp variable here is so utterly ridiculous that, if D
required one, it would rightfully be made the laughing stock among programming
languages.