I want a header file with a non-integral constant in it, e.g. a class. Note the constant does not need to be a compile-time constant.
stati
I think the other answers here are better, but if you're dead-set on doing it all with headers, you can effectively inline your object (as you specifically ask) with a simple wrapper function.
inline const std::string &get_ten() {
static const std::string ten = "10";
return ten;
}
There will be only one string, initialized once, and you don't need anything outside of the header file.