Template type deduction and specialization

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 20 01:45:36 PDT 2015


On 5/20/2015 4:36 PM, Namespace wrote:

> What about:
> ----
> import std.stdio;
>
> void printVal(T)(T t) {
>      static if (is(T : U*, U))
>          printVal(*t);
>      else
>          writeln(t);
> }

Thanks, but I'm not looking for alternatives. I'm trying to figure out 
why it doesn't work as expected.



More information about the Digitalmars-d-learn mailing list