
Henning Basold wrote :
Robert Ramey talked about wrapping some POD to increase type safety. Some time ago I used something similar to ensure that misuse of values can be found by the compiler.
So I think that is something that can be generalized. The concept is to wrap a type into a class and restrict the interface. This ensures that values from one context (e.g. an id) can't be used in another context (e.g. adding of number or as an id for other objects). [...] Do you think this might be a useful utility? Or is there something similar already available? [...]
Personnaly, I simply use a strongtypedef macro. A good news is that there is already one done in serialization : strong_typedef.hpp (maybe this one could have gone into boost.utility?). I think you have got something to dig, even if I am not convinced that I would use your interface in a real project over the already existing strong_typedef. Could you give some real world cunny examples of use? Best regards, Pierre Morcello