Is this template constraint a bug?

Daniel N via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 12 08:53:39 PDT 2016


On Thursday, 12 May 2016 at 15:33:24 UTC, Eric wrote:
>
> is(T : A!T) tells if T can automatically be converted to A!T.  
> The
> last line below is doing just that, yet the template constraint 
> does not work.
>
> class A(T) if (is(T : A!T))
> {
> }
>

Yes, it's a bug. Please file an issue.

Meanwhile try this workaround:
class A(T)
{
   static assert(is(T : A!T), "...");
}



More information about the Digitalmars-d-learn mailing list