Unbind (or runtime rebind) function

P

psujkov

Hi everybody,

Is it possible in any way to unbind function, binded before with
boost::bind ?

void f(int a, int b)
{
return a + b;
}

boost::function<void (void)> packed = boost::bind(&f, 3, 4);

e.g. (pseudocode) :

a) boost::function<void (int)> unpacked = unbind<void
(int)>(packed); // e.g. parameters from right to left - b is unbinded
b) boost::function<void (void)> repacked = rebind(packed, 5, 6);

I'm using boost::function<> as a holder for a boost::bind result, but
I think it lacks functionality to do such a think, maybe anyone knows
other bind-holders ? Or any possibility to use boost::function for
this task ? Any ideas ?..

best regards, Paul Sujkov
 
M

mlimber

Hi everybody,

Is it possible in any way to unbind function, binded before with
boost::bind ?

void f(int a, int b)
{
return a + b;

}

boost::function<void (void)> packed = boost::bind(&f, 3, 4);

e.g. (pseudocode) :

a) boost::function<void (int)> unpacked = unbind<void
(int)>(packed); // e.g. parameters from right to left - b is unbinded
b) boost::function<void (void)> repacked = rebind(packed, 5, 6);

I'm using boost::function<> as a holder for a boost::bind result, but
I think it lacks functionality to do such a think, maybe anyone knows
other bind-holders ? Or any possibility to use boost::function for
this task ? Any ideas ?..

best regards, Paul Sujkov

Although this question is on-topic here, you might get a better
response on Boost's user list.

Cheers! --M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top