diff --git a/include/boost/preprocessor/tuple.hpp b/include/boost/preprocessor/tuple.hpp index 88d5b98..3f5b22e 100644 --- a/include/boost/preprocessor/tuple.hpp +++ b/include/boost/preprocessor/tuple.hpp @@ -19,5 +19,6 @@ Includes all tuple headers. */ +#include #include #endif diff --git a/include/boost/preprocessor/tuple/eat.hpp b/include/boost/preprocessor/tuple/eat.hpp new file mode 100644 index 0000000..2438fa7 --- /dev/null +++ b/include/boost/preprocessor/tuple/eat.hpp @@ -0,0 +1,47 @@ +#ifndef BOOST_PREPROCESSOR_TUPLE_EAT_HPP +#define BOOST_PREPROCESSOR_TUPLE_EAT_HPP + +// Copyright (C) 2001 +// Housemarque Oy +// http://www.housemarque.com +// +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This +// software is provided "as is" without express or implied warranty, and +// with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version. + +/*! \file + +Click here to see the header. +*/ + +//! Expands to a macro that eats a tuple of the specified length. +/*! +BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like +BOOST_PP_EMPTY(). + +For example: + +
\verbatim
+  BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P)
+\endverbatim
+ +The above expands to nothing. +*/ +#define BOOST_PP_TUPLE_EAT(N) BOOST_PP_TUPLE_EAT_DELAY(N) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +#define BOOST_PP_TUPLE_EAT_DELAY(N) BOOST_PP_TUPLE##N##_EAT +#define BOOST_PP_TUPLE0_EAT() +#define BOOST_PP_TUPLE1_EAT(A) +#define BOOST_PP_TUPLE2_EAT(A,B) +#define BOOST_PP_TUPLE3_EAT(A,B,C) +#define BOOST_PP_TUPLE4_EAT(A,B,C,D) +#define BOOST_PP_TUPLE5_EAT(A,B,C,D,E) +#define BOOST_PP_TUPLE6_EAT(A,B,C,D,E,F) +#define BOOST_PP_TUPLE7_EAT(A,B,C,D,E,F,G) +#define BOOST_PP_TUPLE8_EAT(A,B,C,D,E,F,G,H) +#endif +#endif diff --git a/include/boost/preprocessor/while.hpp b/include/boost/preprocessor/while.hpp index 6bf60fb..9fc01a9 100644 --- a/include/boost/preprocessor/while.hpp +++ b/include/boost/preprocessor/while.hpp @@ -18,6 +18,7 @@ */ #include +#include //! Iterates F(D,X) while C(D,X) is true. /*! @@ -113,8 +114,7 @@ it possible to compute N*N functions. #define BOOST_PP_WHILE(C,F,X) BOOST_PP_WHILE_C(C(1,X),0,X)(C,F,F(1,X)) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_WHILE_C(C,D,X) BOOST_PP_IF(C,BOOST_PP_WHILE##D,X BOOST_PP_WHILE_E) -#define BOOST_PP_WHILE_E(C,F,X) +#define BOOST_PP_WHILE_C(C,D,X) BOOST_PP_IF(C,BOOST_PP_WHILE##D,X BOOST_PP_TUPLE3_EAT) #define BOOST_PP_WHILE0(C,F,X) BOOST_PP_WHILE_C(C(2,X),1,X)(C,F,F(2,X)) #define BOOST_PP_WHILE1(C,F,X) BOOST_PP_WHILE_C(C(3,X),2,X)(C,F,F(3,X)) #define BOOST_PP_WHILE2(C,F,X) BOOST_PP_WHILE_C(C(4,X),3,X)(C,F,F(4,X))