|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-08-30 12:37:11
"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> writes:
> "Jonathan Turkanis" wrote:
>
>> > I believe the attached file does what Pavel has in mind. Let someone
> else
>> > check it, though, since I'm not preprocessor expert.
>>
>> One last try ... the version I just posted had the include guards out of
> order.
>>
>>
> The technique used here is called file iteration. It works well.
Actually that's called "local iteration".
> It is the most powerful mechanism in PP.
>
That's debatable, I guess ;-). It is cool, though.
>
> The local iteration approach is bit simpler and would look like:
> -------------
> #define BOOST_PP_LOCAL_MACRO( n ) \
> template < BOOST_PP_ENUM_PARAMS(n, typename T) > \
> explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \
> : member( BOOST_PP_ENUM_PARAMS(n, x) ) \
> {} \
> /**/
>
> #define BOOST_PP_LOCAL_LIMITS (1, BOOST_BASE_FROM_MEMBER_MAX_ARITY)
> #include BOOST_PP_LOCAL_ITERATE()
> -------------
>
> I think file iteration makes no harm.
>
> /Pavel
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk