|
Boost : |
Subject: Re: [boost] [Proposal] A little reasonable modification of boost::bind_t
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2013-05-11 07:12:23
On 11/05/13 08:52, Arthur Athrun wrote:
> Hi, everyone,
>
> I'd like to propose a little modification of boost:: bind to expose more
> information in boost:: _bi:: bind_t.
>
> Here is my motivation problem. Suppose this is a function which takes boost:
> :_bi::bind_t as a parameter. But at the same time, I'd like to enumerate
> all binded parameters and do something for specific types, like the
> following pseudo code shows.
>
> template< class F>
> void foo(F & f)
> {
> foreach(T& arg, f.arguments())
> {
> if(boost::is_same<T, ID_t>::value) //here ID_t is a user specific
> type
> //do something for arg.
> }
> }
A polymorphic function object does not have a single type for the
arguments nor even a single arity.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk