write a function template specialisation that tests if an argument is known at compile time

Alex sascha.orlov at gmail.com
Sun Aug 12 12:27:59 UTC 2018


On Saturday, 11 August 2018 at 05:17:51 UTC, Cecil Ward wrote:
> T myfunc(T)( T x, uint mask )
>    if ( mask == 3 )
>    {
>    return fast_func( x, mask );
>    }
>
> [...]

Is it the volcano pattern you are looking for?
https://p0nce.github.io/d-idioms/#Is-this-available-at-compile-time-or-runtime?


More information about the Digitalmars-d-learn mailing list