Today's weird D edge case

bauss jj_1337 at live.dk
Tue Jul 16 14:09:05 UTC 2019


On Sunday, 14 July 2019 at 23:10:33 UTC, Walter Bright wrote:
> 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[] ));
> }

I think that's an opinion. Since I use the web interface mainly 
then it's much more convenient to me at least that there is a 
link I can just click and run the example instead of having to 
copy-paste it.


More information about the Digitalmars-d mailing list