In C ++ 14, since it is constexpr
no longer indirectly const
, can a member function constexpr
change the class data member:
struct myclass
{
int member;
constexpr myclass(int input): member(input) {}
constexpr void f() {member = 42;}
};
source
share