Re: Not getting expected behavior from compile-time conditional

2016-01-26 Thread pineapple via Digitalmars-d-learn
On Wednesday, 27 January 2016 at 00:17:18 UTC, Ali Çehreli wrote: Remove the extra is: :) Huh, I swear I tried that. Thanks!

Re: Not getting expected behavior from compile-time conditional

2016-01-26 Thread Ali Çehreli via Digitalmars-d-learn
On 01/26/2016 04:12 PM, pineapple wrote: > Here's a simple programming showing where I'm tripping up - > > void test(T)(in T value){ > import std.traits; > static if(is(T == char)){ > writeln("char"); > }else static if(is(isNumeric!(T))){ Remove the extra is: :) }else

Not getting expected behavior from compile-time conditional

2016-01-26 Thread pineapple via Digitalmars-d-learn
Here's a simple programming showing where I'm tripping up - void test(T)(in T value){ import std.traits; static if(is(T == char)){ writeln("char"); }else static if(is(isNumeric!(T))){ writeln("number"); } writeln("hi"); } public void main(){ test('g');