template constraints when non-constrained template exists

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 5 01:18:38 PDT 2015


AFAIK D has intentionally simplified resolution rules to make it 
possible to reason about what is best match without referring to 
copy of ANSI standard :) And plain unconstrained `T` is thus as 
good match as any other.

In your example intended approach is to either put 
`if(someCondition!T)` into original template as another `static 
if` branch or turn first template into constrained one too.


More information about the Digitalmars-d mailing list