Re: [boost] argument ignore facility

Gennadiy Rozental wrote:
Hi,
Maybe somebody could point me into right direction. boost::bind allows to present function of arity N as function of arity M with M<N, by binding some particular arguments. I need reverse: I need to present function of arity N as function of arity M with M > N, by ignoring some arguments.
What is recommended to be used?
boost::bind can be invoked with any arity and will ignore arguments that are not used. void f(int); bind(&f, _1)(x,y,z,u); // invokes f(x) -- Daniel Wallin

Maybe somebody could point me into right direction. boost::bind allows to present function of arity N as function of arity M with M<N, by binding some particular arguments. I need reverse: I need to present function of arity N as function of arity M with M > N, by ignoring some arguments.
What is recommended to be used?
boost::bind can be invoked with any arity and will ignore arguments that are not used.
void f(int); bind(&f, _1)(x,y,z,u); // invokes f(x)
Ups. My fault. Name bind is kinda misleading here. But that's ok. Gennadiy
participants (2)
-
Daniel Wallin
-
Gennadiy Rozental