Boost logo

Boost :

From: me22 (me22.ca_at_[hidden])
Date: 2006-06-06 17:21:13


On 6/6/06, Yuval Ronen <ronen_yuval_at_[hidden]> wrote:
> Christopher Kohlhoff wrote:
> > tempalte <endianness E>
> > struct message
> > {
> > endian<E, short, 2> first;
> > endian<E, int, 4> second;
> > endian<E, int, 4> third;
> > ...
> > };
> >
> On the other hand, the definition of struct message, can benefit from
> it, I agree. So to provide a solution for the struct, I suggest to add a
> 'type selector' to the suggestion I described (too many times) in this
> thread.
>
How about template template parameters?

  template <template <typename> class E>
  struct message
  {
    E< exact_int_t<2> > first;
    E< exact_int_t<4> > second;
    E< exact_int_t<4> > third;
    ...
  };

Though that might unnecessarily restrict the possible compilers.

~ Scott McMurray


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk