Boost logo

Boost Users :

Subject: [Boost-users] [preprocessor] Nested FOR_EACHs
From: Reimund Klemm (klemm_at_[hidden])
Date: 2009-04-27 03:12:34


Hello,

is it possible to nest FOR_EACH statements with the preprocessor? In my
example it seems not to work:

#include <boost/preprocessor/seq/for_each_i.hpp>

#define DECLARE_TEST2(r,data,i,elem) \
    1;
/**/

#define DECLARE_TEST(r,data,i,elem) \
    BOOST_PP_SEQ_FOR_EACH_I(DECLARE_TEST2,data,data);
/**/

#define SEQ ((1)(NACK_SN)(10)) ((1)(E1)(1)) ((1)(E2)(1))

int main(){
  BOOST_PP_SEQ_FOR_EACH_I(DECLARE_TEST,SEQ,SEQ)
  return 0;
}

Thanks a lot for comments.

Reimund
  


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