Is std.typecons.Rebindable ever going to work for this?

Michel Fortin michel.fortin at michelf.com
Thu Dec 17 06:18:03 PST 2009


On 2009-12-17 08:57:32 -0500, "Steven Schveighoffer" 
<schveiguy at yahoo.com> said:

> Adding this to S(T) makes it not work:
> 
> struct S(T) if (is(T: Object))
> {
>     T t;
> }

Yes indeed. Interestingly you can change it to is(T == class) and now 
it works again!

There seem to be no difference between is(T : Object) and is(T == 
class), except that the former prevents forward declarations. I guess 
it means that is(T : Object) should not be used. I made a quick search 
and found 10 occurrences of it in Phobos.

The same problem happens with template arguments: "template S(T : 
Object)" does not work with forward declarations.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list