O(N*N) space and O(1) time BOOST_PP_TUPLE_ELEM()

[SVN r14149]
This commit is contained in:
Vesa Karvonen
2002-06-16 08:06:36 +00:00
parent 54d0da5221
commit 8854c2c573
19 changed files with 81 additions and 276 deletions

View File

@ -33,11 +33,7 @@ single token).</p>
/** <p>Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).</p> */
#define BOOST_PP_DIV_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_DIV_C,BOOST_PP_DIV_F,(0,X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
# define BOOST_PP_DIV_C(D,RCY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,RCY),BOOST_PP_TUPLE_ELEM(3,1,RCY))
# define BOOST_PP_DIV_F(D,RCY) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,RCY)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,RCY),BOOST_PP_TUPLE_ELEM(3,2,RCY)),BOOST_PP_TUPLE_ELEM(3,2,RCY))
#else
# define BOOST_PP_DIV_C(D,RCY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE3_ELEM2 RCY,BOOST_PP_TUPLE3_ELEM1 RCY)
# define BOOST_PP_DIV_F(D,RCY) (BOOST_PP_INC(BOOST_PP_TUPLE3_ELEM0 RCY),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE3_ELEM1 RCY,BOOST_PP_TUPLE3_ELEM2 RCY),BOOST_PP_TUPLE3_ELEM2 RCY)
#endif
#define BOOST_PP_DIV_C(D,RCY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,RCY),BOOST_PP_TUPLE_ELEM(3,1,RCY))
#define BOOST_PP_DIV_F(D,RCY) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,RCY)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,RCY),BOOST_PP_TUPLE_ELEM(3,2,RCY)),BOOST_PP_TUPLE_ELEM(3,2,RCY))
#endif