
2009/6/2 Ryan McConnehey
Scott McMurray wrote:
They're at least simple, but it's still a violation of DRY, so I'm not a big fan.
If a non-expanding interface is needed (non-template so that every type isn't accepted) does it really violate DRY?
Sure. Just 'cause it's templated doesn't mean it'll accept anything. In the inheriting version, for example, the delegating to a type-specific base class keeps it from accepting "anything".
What are the types really, anyways?
I've create true_typedef of the basic type like uint16, uint32, int16, etc. I've written my own serialization interface (I know boost already has one) and I'm restricting the interface to only allow certain types. I'm trying to centralize the were the real work happens so if new types are needed then added them won't be difficult.
So you want a way where you have an MPL typelist of the types, and just adding a type to that typelist is all you need to do. (Or to a PP sequence, or ...)