Boost logo

Boost :

Subject: Re: [boost] [preprocessor] [variadic] VMD_SIZE using ADD -- why?
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2011-06-06 13:27:40


lcaminiti wrote:
>
> BTW, why is PP_ADD(size, 0) used on MSVC? If this is just for forcing
> proper macro expansion, I think other techniques (like the ones used by
> PP_EXPAND) should be used so no PP_WHILE reentrancy dependency is
> introduced.
>

For example, something like this should work instead of using PP_ADD(size,
0):

#if defined(BOOST_MSVC)
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() &&
~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
# define BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND(x)
BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND_I(x)
# else
# define BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND(x)
BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND_OO((x))
# define BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND_OO(par)
BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND_I ## par
# endif
# define BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND_I(x) x
#define BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE(...) \
 
BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE_EXPAND(BOOST_DETAIL_PP_VMD_DETAIL_APPLY(BOOST_DETAIL_PP_VMD_DETAIL_ARG_N,
(__VA_ARGS__, BOOST_DETAIL_PP_VMD_DETAIL_RSEQ_N()))) \
/**/
#else
#define BOOST_DETAIL_PP_VMD_DETAIL_DATA_SIZE(...) \
  BOOST_DETAIL_PP_VMD_DETAIL_APPLY(BOOST_DETAIL_PP_VMD_DETAIL_ARG_N,
(__VA_ARGS__, BOOST_DETAIL_PP_VMD_DETAIL_RSEQ_N())) \
/**/
#endif

--Lorenzo

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-preprocessor-variadic-VMD-SIZE-using-ADD-why-tp3577430p3577504.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk