1

clang -std=c++1z accepts

void foo();

template <auto f>
struct F {};

int main()
{
   F<+[](){foo();}> f;
}

Note the + to force the conversion to function pointer.

But gcc 7.1 rejects it error: lambda-expression in template-argument. Which one is right?

Trass3r
  • 5,858
  • 2
  • 30
  • 45

0 Answers0