Andrea Fontana:

const(int) : int  <-- true
const(PP) : PP  <-- false

Is this behaviour correct?

I think it's correct, and it's caused by the difference between value types and reference types.


And how can I check if T is of a certain class ignoring consts (and avoiding double checks)?

There are some different ways to do it, one of them is to use something like (untested):

is(Unqual!typeof(x) == PP)

Where Unqual is in Phobos, std.traits.Unqual.

Bye,
bearophile

Reply via email to