Boost logo

Boost Users :

Subject: [Boost-users] [preprocessor] add pointer to T..
From: Manfred Doudar (manfred.doudar_at_[hidden])
Date: 2010-05-30 10:22:15


Hello,

Thinking maybe little to late in the night at my end, but can see how
to generate the following:

  T0*
  T0*, T1*
  T0*, T1*, T2*

 ..and so on

Some variant on the below maybe..? Of course, below, you'd get

 T*0, T*1, etc if tried BOOST_PP_ENUM_PARAMS(n, T*)

which doesn't produce a valid token.

#include <boost/preprocessor/iteration/local/hpp>
#include <boost/preprocessor/repetition.hpp>

#define OPERATOR(z, n, _) \
                                   \
  BOOST_PP_ENUM_PARAMS(n, T)
/**/

#define BOOST_PP_LOCAL_MACRO(n) OPERATOR(_, n, _)
#define BOOST_PP_LOCAL_LIMITS(1, 3)
#include BOOST_PP_LOCAL_ITERATE()
#undef BOOST_PP_LOCAL_MACRO
#undef BOOST_PP_LOCAL_LIMITS
#undef OPERATOR

All help appreciated.

Cheers,

-- 
Manfred

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net