Today's weird D edge case

Walter Bright newshound2 at digitalmars.com
Sun Jul 14 23:10:33 UTC 2019


On 7/13/2019 5:22 PM, Ethan wrote:
> https://run.dlang.io/is/l5Vyn4
> 
> Using an is statement inside a template constraint doesn't propagate the is 
> results in to a function. You have to static if with the same is statement to 
> make it work.

URLs to those sand boxes tend to be ephemeral. Much better to just quote the 
text in the email, like this:


import std.stdio;

string SomeFunc( T )() if( is( T : AT[], AT ) )
{
     return AT.stringof;
}

void main()
{
     writeln(SomeFunc!( int[] ));
}


More information about the Digitalmars-d mailing list