Hi, I want to define an structure, where some math constants would be stored.
Here what I've got now:
struct consts {
//salt density kg/m3
static const double gamma;
};
const double consts::gamma = 2350;
It works fine, but there would be more than 10 floating point constants, so I doesn't want to wrote 'static const' before each of them. And define something like that:
static const struct consts {
//salt density kg/m3
double gamma;
};
const double consts::gamma = 2350;
It look fine, but I got these errors:
1. member function redeclaration not allowed
2. a nonstatic data member may not be defined outside its class
I wondering if there any C++ way to do it?