mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-21 08:22:04 +02:00
New O(N*N) space and O(1) time BOOST_PP_TUPLE_ELEM()
[SVN r14150]
This commit is contained in:
@ -14,6 +14,7 @@
|
|||||||
#include <boost/preprocessor/dec.hpp>
|
#include <boost/preprocessor/dec.hpp>
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/preprocessor/empty.hpp>
|
#include <boost/preprocessor/empty.hpp>
|
||||||
|
#include <boost/preprocessor/tuple/elem.hpp>
|
||||||
|
|
||||||
/* The time complexity of DELAY(N) is O(pow(2,N)).
|
/* The time complexity of DELAY(N) is O(pow(2,N)).
|
||||||
*
|
*
|
||||||
@ -31,7 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DELAY_MAX
|
#ifndef DELAY_MAX
|
||||||
#define DELAY_MAX 16
|
#define DELAY_MAX 15
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DELAY(N) BOOST_PP_TUPLE_ELEM(2,0,(BOOST_PP_EMPTY,BOOST_PP_WHILE(DELAY_C,BOOST_PP_CAT(DELAY_F,N),BOOST_PP_DEC(N))))()
|
#define DELAY(N) BOOST_PP_TUPLE_ELEM(2,0,(BOOST_PP_EMPTY,BOOST_PP_WHILE(DELAY_C,BOOST_PP_CAT(DELAY_F,N),BOOST_PP_DEC(N))))()
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <boost/preprocessor/expr_if.hpp>
|
#include <boost/preprocessor/expr_if.hpp>
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/preprocessor/stringize.hpp>
|
#include <boost/preprocessor/stringize.hpp>
|
||||||
|
#include <boost/preprocessor/tuple/elem.hpp>
|
||||||
|
|
||||||
#include <libs/preprocessor/test/test.hpp>
|
#include <libs/preprocessor/test/test.hpp>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user