Ticket #6973: limit_repeat.cpp
File limit_repeat.cpp, 370 bytes (added by , 10 years ago) |
---|
Line | |
---|---|
1 | #include <boost/preprocessor/config/limits.hpp> |
2 | #include <boost/preprocessor/repetition/enum.hpp> |
3 | #include <boost/preprocessor/repetition/repeat.hpp> |
4 | |
5 | #define DATA(z,n,data) data |
6 | #define DECL(z,n,text) text##n = n; |
7 | |
8 | void foo() |
9 | { |
10 | int arr[] = { BOOST_PP_ENUM(BOOST_PP_LIMIT_REPEAT, DATA, 0) }; |
11 | (void)arr; |
12 | |
13 | BOOST_PP_REPEAT(BOOST_PP_LIMIT_REPEAT, DECL, int x) |
14 | } |