Arguments types for object created with boost::bind()

Hello! I need to get the types list for operator() for result type of boost::bind() Example: void func(int, long) {} auto o = boost::bind(&func, _1, _2); o( ??? ); // what types of arguments? Thanks. -- Regards, niXman ___________________________________________________ Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows: http://sourceforge.net/projects/mingwbuilds/

AMDG On 06/21/2012 05:42 AM, niXman wrote:
Hello!
I need to get the types list for operator() for result type of boost::bind()
You can't. Boost.Bind creates polymorphic function objects.
Example:
void func(int, long) {} auto o = boost::bind(&func, _1, _2); o( ??? ); // what types of arguments?
// this is legal void f(); auto o = boost::bind(&f, _1, _2, _3); // what are the argument types of o? // this is also legal: void g(int, long); auto o = boost::bind(&g, _1, _1); // Is the argument type int or long? In Christ, Steven Watanabe

2012/6/21 Steven Watanabe:
AMDG
On 06/21/2012 05:42 AM, niXman wrote:
Hello!
I need to get the types list for operator() for result type of boost::bind()
You can't. Boost.Bind creates polymorphic function objects.
Example:
void func(int, long) {} auto o = boost::bind(&func, _1, _2); o( ??? ); // what types of arguments?
// this is legal void f(); auto o = boost::bind(&f, _1, _2, _3); // what are the argument types of o?
// this is also legal: void g(int, long); auto o = boost::bind(&g, _1, _1); // Is the argument type int or long?
I understand. Thank you! -- Regards, niXman ___________________________________________________ Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows: http://sourceforge.net/projects/mingwbuilds/

On Thu, Jun 21, 2012 at 04:42:59PM +0400, niXman wrote:
Hello!
I need to get the types list for operator() for result type of boost::bind()
Example:
void func(int, long) {} auto o = boost::bind(&func, _1, _2); o( ??? ); // what types of arguments?
If you use Phoenix's bind, there might be some limited introspection possible, due to the fact that the result is a Proto tree, with all the traversal and queries you can perform against such a beast. I have no idea how to achieve such a thing, however. -- Lars Viklund | zao@acc.umu.se
participants (3)
-
Lars Viklund
-
niXman
-
Steven Watanabe