g++ -std=c++11 -Wall -o "Test7" "Test7.cpp" (in directory: /home/aceix/Documents/C++ Codes)
Test7.cpp:10:3: error: ‘constexpr const<lambda()> Test::func’, declared using local type ‘const<lambda()>’, is used but never defined [-fpermissive]
Compilation failed.
#include <iostream>
usingnamespace std;
class Test {
public:
staticconstexprauto func=[]()->int{
cout<<"Lambda has been assigned to auto";
return 0;
};
Test() {
}
};
int main() {
Test obj;
obj.func();
return 0;
}