ttt.cc:6:24: error: non-staticdata member ‘value’ declared ‘constexpr’ constexprintvalue=a+b;^ttt.cc: In function ‘intmain()’: ttt.cc:14:30: error: invalid use of non-staticdata member ‘Add_<2,3>::value’ constexprintx1=Add_<2,3>::value;^~~~ttt.cc:6:24: note: d...
constexpr int value=a+b; ^ ttt.cc: In function ‘int main()’: ttt.cc:14:30: error: invalid use of non-static data member ‘Add_<2, 3>::value’ constexpr int x1=Add_<2,3>::value; ^~~~ ttt.cc:6:24: note: declared here constexpr int value=a+b; 1. 2. 3. 4. 5. ...
Non-static data members are declared in a member specification of a class. class S { int n; // non-static data member int& r; // non-static data member of reference type int a[2] = {1, 2}; // non-static data member with default member initializer (C++11) std::string s, *...