so:
> Reading it again, how i missed page 34, awesome!
Page 6 is about The Rule of Least Astonishment, D tries hard (and often
succeeds) to be uniform, to do the same things when you use the same syntax in
different parts of the language.
But I have hitted a case, "T : T*" can mean different things when used in a
template or in a is():
template IsPointer1(T : T*) {
enum bool IsPointer1 = true;
}
template IsPointer1(T) {
enum bool IsPointer1 = false;
}
template IsPointer2(T) {
enum bool IsPointer2 = is(T : T*);
}
void main() {
static assert(IsPointer1!(int*));
static assert(IsPointer2!(int*)); // asserts
}
This is a dis-uniformity. I have found it only years of using D1, and it has
caused me few troubles.
Bye,
bearophile