|
Boost : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-03-28 00:01:56
>> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk