Boost logo

Boost :

Subject: [boost] Help with Boost Preprocessor
From: Emil Dotchevski (emil_at_[hidden])
Date: 2009-08-29 21:02:40

Let's say I have a class template functor like this:

    typedef void result_type;

    template <class A1,class A2,class A3>
    operator()( A1, A2, A3, int x )

Given a list of types, I want the function instantiated and called for
all permutations of the types in the list; the additional argument(s),
x, just need to be forwarded the same for all instances.

Actually I got it working, see

I don't think that my solution is very good though. First, it has some
run-time overhead due to the use of boost::bind in fwd1 and fwd2 (see
link above.) Second, I'd like the macro that defines the type list not
to be hard-coded in fwd1 and fwd2.

Is this possible?

Emil Dotchevski
Reverge Studios, Inc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at