Boost logo

Boost :

Subject: Re: [boost] determine first arg of callable
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-05-16 03:25:09


On Thu, May 16, 2013 at 11:22 AM, Nathan Ridge <zeratul976_at_[hidden]>wrote:

> >>> No, bind function object types do not have the argument types. These
> >> types
> >>> are not known until the function object is actually invoked. The only
> >> types
> >>> you will find is the bound function object type and bound argument
> values
> >>> types (and the latter may differ from the actual argument types, BTW).
> >>
> >> This is an aside, but is there a way, given the result of a bind(), to
> >> get the types of the bound argument values?
> >>
> >
> > For boost::bind you can use visit_each [1] or decompose the bind_t
> template
> > type manually. Both ways are not quite documented, but it is doable. For
> > other bind implementations the code may differ but the same types should
> be
> > present in some form in the function object type.
> >
> > [1] http://www.boost.org/doc/libs/release/libs/bind/bind_visitor.cpp
>
> Interesting, thanks!
>
> Do you know of a (standard) way to do it for std::bind?
>

No, I think this will be implementation-dependent.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk