T : T*

Stewart Gordon smjg_1998 at yahoo.com
Wed Apr 18 11:07:48 PDT 2012


On 13/04/2012 19:47, Jonathan M Davis wrote:
> I'd just like to verify that my understanding of T : T* in this template is
> correct:
>
> struct S(T : T*)
<snip>
> it appears that the compiler is instead taking this to mean that the pointer
> part of the type should be stripped from the template argument's type.
<snip>

Yes.  It's more or less syntactic saccharin for

struct S(U : T*, T) {
     T t;
}

Stewart.


More information about the Digitalmars-d-learn mailing list