
Hi Beman, Beman Dawes <bdawes@acm.org> wrote:
That said, I guess there could be an argument to expose the templates for those who prefer them.
Here's an argument for exposing templates: it allows the template parameter to propagate up into my own types. I'm thinking something like: template <typename Endianness> struct my_message { integer<4, Endianness> foo; integer<2, Endianness> bar; ... }; This permits me to write one function template to handle my_message structures in programs that need to deal with both little- and big-endian at runtime (i'm thinking "receiver makes right" protocols). With this scheme there should probably also be a type for native endianness so we could write: my_message<endian::big> msg1; my_message<endian::little> msg2; my_message<endian::native> msg3; etc. In my opinion a similar argument applies to exposing the alignment as a template parameter. Cheers, Chris