Jump to content
  • Advertisement
Sign in to follow this  
Nanoprobe

[Resolved... sorta] Nesting Boost's FOR_EACH macro

This topic is 4999 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I'm trying to create a macro using Boost's preprocessor library that has nested BOOST_PP_LIST_FOR_EACH's. Something akin to this:
#define MACRO2(r,data,elem) elem
#define MACRO1(r,data,elem) BOOST_PP_LIST_FOR_EACH(MACRO2,NULL,elem)

#define LIST ( (1,(2,(3,BOOST_PP_NIL))), ( (4,(5,(6,BOOST_PP_NIL))), BOOST_PP_NIL ) )

#define MACRO BOOST_PP_LIST_FOR_EACH(MACRO1,NULL,LIST)


But it doesn't work - the first FOR_EACH works fine but the nested one isn't expanded. Any ideas? [UPDATE] I managed to find a solution for the problem by rearranging the order things are done in - basically placing the FOR_EACH directly inside MACRO in place of LIST. [Edited by - Nanoprobe on November 14, 2004 5:03:30 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!