#include <iostream> struct Foo { static constexpr const auto lambda = [](){return 42;}; template<class U = decltype(lambda)> void func(U u = lambda) { std::cout << u();}}; int main() { Foo f; f.func();}
Standard input is empty
prog.cpp:4:30: error: ‘constexpr const Foo::__lambda0 Foo::lambda’, declared using local type ‘const Foo::__lambda0’, is used but never defined [-fpermissive] static constexpr const auto lambda = [](){return 42;}; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!