|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-04-10 12:36:43
> 1. I need to pre-generate a large number of repetitions for most EDG
> compilers, which it seems basically can't handle any PP lib constructs,
> making me wonder how much the PP lib is really buying me.
David, it helps significantly every time you get rid of one 'level' of
recursion.
// make.h
#ifndef UPPER_BOUND
#error UPPER_BOUND is not set
#endif
#ifndef LOWER_BOUND
#define LOWER_BOUND 1
#endif
#define IS_RANGE(N) LOWER_BOUND <= N && UPPER_BOUND >= N
#if RANGE(0)
MACRO(0)
#endif
#if RANGE(1)
MACRO(1)
#endif
#if RANGE(2)
MACRO(2)
#endif
// etc.
// sample.h
#define LOWER_BOUND 0
#define UPPER_BOUND 15
#define AUX_MY_CONSTRUCT_GET(i) \
template< BOOST_MY_LIBRARY_PP_PARAMS(i, typename T) > \
struct my_construct { /* more stuff */ }; \
/**/
#define MACRO AUX_MY_CONSTRUCT_GET
#include "make.h"
#undef LOWER_BOUND
#undef UPPER_BOUND
#undef AUX_MY_CONSTRUCT_GET
#undef MACRO
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk