Boost logo

Boost :

Subject: Re: [boost] [gil] ToolBox uploaded
From: TONGARI (tongari95_at_[hidden])
Date: 2013-02-13 12:48:38


2013/2/14 Christian Henning <chhenning_at_[hidden]>

> Hi,
>
> >
> > I wonder why `get_num_bits` only applies to packed_channel_reference
> > & packed_dynamic_channel_reference.
> >
> > Wouldn't it be nice if it also applies to packed_channel_value & those
> > bitsN ?
> >
>
> Good point. I have fixed that on the trunk.
>

Thanks, but not for bitsN? Like:

    template <typename T, class = void>
    struct get_num_bits;

    template<class T>
    struct get_num_bits<T, typename enable_if_c<is_integral<T>::value &&
!is_class<T>::value>::type>
      : mpl::int_<sizeof(T) * 8>
    {};

And you could avoid all the const duplicates as:

    template <typename T>
    struct get_num_bits<T const>
      : get_num_bits<T>
    {};

Regards


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