Boost logo

Boost Users :

From: Fernando Cacciola (yg-boost-users_at_[hidden])
Date: 2003-08-07 09:26:42

Short question:

As the Subject says,
given a boost::function{1..N}<>,
how can I extract a tuple of all its arguments?

Long question:

Anyway, what I'm really trying to do is this:

Given some classes with different methods:

struct X { void f(int n ) ; } ;
struct Y { void g(char c, double d ) ; } ;

I want to easly create _polymorphic_ closures binding member functions of X /Y with instances of
X/Y and function arguments.
The goal is the have a deferred 'action' list for easy backtracing of an algorithm.
That is, instead of directly calling:

X x ;
Y y ;

I want to do something that would look like:

X x;
Y y;
ActionList actions;
actions.push_back( make_closure(&X::f, x,1) );
actions.push_back( make_closure(&Y::g, y,'a',1.2) );


Fernando Cacciola

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at