|
Boost Users : |
Subject: Re: [Boost-users] [preprocessor]
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-12-07 11:32:45
Hi Roman, thanks for your answer. How can do that with MPL? Any pointers?
Thanks,
Christian
On Mon, Dec 7, 2009 at 4:30 AM, Roman Perepelitsa
<roman.perepelitsa_at_[hidden]> wrote:
> 2009/12/6 Christian Henning <chhenning_at_[hidden]>
>>
>> Hi there,
>>
>> let's assume I have a structure which takes 5 ints as template parameters.
>>
>> template< int NumChannel
>> , int FirstChannelBits = 0
>> , int SecondChannelBits = 0
>> , int ThirdChannelBits = 0
>> , int FourthChannelBits = 0
>> , int FifthChannelBits = 0
>> >
>> struct pixel_type_generator { /* omitted*/ }
>>
>> The first parameter is different as it defines how many of the other
>> parameters are actually used.
>>
>> How can I use boost::preprocessor to get this kind of code repetition:
>
> <cut>
> FWIW, this can be achieved with Boost.MPL instead of preprocessor.
> Roman Perepelitsa.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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