
On Jul 25, 2006, at 10:56 PM, David Bergman wrote:
What I *would have* considered, though, is to have two templates:
template<...> struct pod_endian { ... no constructor but all the endian logic ... }
and
template<...> struct endian : pod_endian { ... constructors and not much else ... }
And have conversion operator to get an endian from a pod_endian.
I actually like that. It would double the number of typedefs, but I think it's a decent compromise. Maybe use a naming convention like xxx_pod_t for the POD types, e.g. big32_pod_t?
Additionally, I would probably use my embed_type proposal and get:
template<.., typename IntType, ..> struct endian : embed_type<IntType, endian> { ... }
using proper policies.
I'm not familiar with this. Does that make it a non-POD type? -Dave