Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-08 11:13:26


----- Original Message -----
From: "Vesa Karvonen" <vesa_karvonen_at_[hidden]>

> David Abrahams:
> >Is there a way to put an empty token in a tuple or a list? I am
trying
> >to generate families of overloaded functions which accept member
> >function pointers as arguments. To do this I am using a list of
> >cv-qualifications:
>
> There is an example that generates a family of template
specializations. See
> the macro CV_QUALIFIERS in
"libs/preprocessor/example/is_integral.cpp". The
> basic idea is to make all of the elements in the list invokeable.

I understand how that could work. However, I've settled on something
else for now, which seems to be working:

# define BOOST_PYTHON_CV(N) \
      BOOST_PP_EXPR_IF(BOOST_PP_MOD(N,2), const) \
      BOOST_PP_EXPR_IF(BOOST_PP_GREATER(N,1), volatile)

# define BOOST_PYTHON_PMF(Count, Cv) \
    R (A0::*)( BOOST_MPL_TEMPLATE_PARAMETERS( 1 , Count , A ) )
BOOST_PYTHON_CV(Cv)

I'm sure the other approach is more efficient, but I don't want to upset
the applecart at this stage.


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