Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2006-08-23 12:13:11


>
> Not sure. Why not simply make IMAGE::color_t the key? Then give
> std::map a template key compare function templated by color_t;
> the template can be specialized for each color definition.
>

I suppose that would work, as well. But since I'm lazy ;-) and do not
want to create a specialized template for each color defintion, I
thought it might be cool to use some metaprogramming magic. Also, GIL
is suppose to be extensible for users. Meaning they can define
whatever color type they want. It would lessen their learning curve
when there is a generic solution for all kinds of colors definitions.

Isn't the purpose of metaprogramming to avoid programming that can be
done by the compiler? As I said all the information is available at
compile time.

For example earlier in this thread there is a solution using
boost::array. But this one is limited for homogeneous color types.

I think you mentioned earlier that there is a solution. I would like
to know. It would be very educational to me to see what it's like.

Thanks,
Christian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net