What is the benefit over the namespace suggestion above? You are just making things more complicated for absolutely no benefit [unless you can give a benefit that you think is worth the extra complexity]. Why is putting an enum inside a class more beneficial?
Its because the communication betwen the server and client uses serialization (message classes) and I would like one particular class to have same enums and they could be accessed (written) this way: the_class::the_enum; (without writing them two times - once in a namespace and once in that class).
Originally Posted by matsp
It makes more sense if you write some_message test; test.set_state(some_message::some_state) instead of test.set_state(client::some_state);
In that case, I would put the enum INSIDE the class, and also produce the serialization code in that class.
I don't know for sure if you can achieve this with templates...