function template specialization question D vs. C++

kdevel kdevel at vogtner.de
Sun Jan 14 01:02:46 UTC 2018


On Sunday, 14 January 2018 at 00:30:37 UTC, Nicholas Wilson wrote:
> The usual way to do what you are trying to do is with template 
> constraints.
>
> void foo(T)() if (is(T== float)) { ...}

Thanks. That works but looks a bit ugly. Am I right that I have 
to leave out the primary (unconstrained) template?


More information about the Digitalmars-d-learn mailing list