Fallback 'catch-all' template functions

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 1 01:46:07 PDT 2016


On Thursday, 1 September 2016 at 08:44:38 UTC, Stefan Koch wrote:
> void f(T)(T t) {
>   static if (is(fImpl(t) == void)) {
>     f(t);
>   } else {
>     // default impl here
>   }
> }

Was meant to be
  void f(T)(T t) {
    static if (is(fImpl(t) == void)) {
      fImpl(t);
    } else {
      // default impl here
    }
  }



More information about the Digitalmars-d mailing list