Boost logo

Boost :

Subject: Re: [boost] [GIL] scoped_channel_value type
From: Christian Henning (chhenning_at_[hidden])
Date: 2010-07-22 11:48:01

Hi there,

On Thu, Jul 22, 2010 at 11:26 AM, Lubomir Bourdev <lbourdev_at_[hidden]> wrote:
> Hi Fabien,
> Notice that, even after Christian's changes, ChannelValue::base_channel_t
> will not always be available because ChannelValue could be a built-in type.

True. But, is that the reason why this typedef never was added to
scoped_channel_value or is it that no one thought that this typedef
would be useful? I always wonder which it is when I use a c++ lib.

> So if you want to extract this, you will have to special-case
> scoped_channel_value anyway. So in this case you don't need a typedef
> inside.
> You can just define a specialization like this:
> Template <typename ChannelValue>
> Struct base_channel_value {
>   typedef ChannelValue type;
> };
> Template <typename ChannelValue, typename MinV, typename MaxV>
> Struct base_channel_value<scoped_channel_value<ChannelValue, MinV, MaxV> >
> {
>   typedef ChannelValue type;
> };

I really have to write that one down. I keep on forgetting this trick.


Boost list run by bdawes at, gregod at, cpdaniel at, john at