Expand|Select|Wrap|Line Numbers
- /////////////////////////////////
- // *.h file
- /////////////////////////////////
- class ParameterTypeNames
- {
- public:
- static const std::string FLOAT;
- static const std::string INT;
- // ...
- private:
- inline ParameterTypeNames() {};
- };
- /////////////////////////////////
- // *.cpp file
- /////////////////////////////////
- const std::string ParameterTypeNames::FLOAT = "Float";
- const std::string ParameterTypeNames::INT = "Int";
- // ....
- /////////////////////////////////
- // usage of the constants in a constructor of other class
- /////////////////////////////////
- // ...
- std::string s = ParameterTypeNames::FLOAT;
- // ...
Btw, I'm using VC 8.0 and it was in debug mode, if that is of any importance here.
I'd be happy about suggestions :-).
Greetings,
Felix