<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/4.2.2">
</HEAD>
<BODY>
It seems to works (but i use Unqual!T directly)<BR>
<BR>
Thank you :)<BR>
<BR>
Il giorno mer, 18/07/2012 alle 11.13 +0200, bearophile ha scritto:
<BLOCKQUOTE TYPE=CITE>
<PRE>
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
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>