Opened 11 years ago

Last modified 6 years ago

#5558 assigned Bugs

Phoenix bind doesn't support bind<type> construct

Reported by: Michael Caisse Owned by: Thomas Heller
Milestone: To Be Determined Component: phoenix
Version: Boost 1.46.1 Severity: Showstopper
Keywords: Cc:

Description

boost::bind uses bind<type> in situations where it cannot determine the return type. This is useful for situations where you are binding to a method with a variable argument list such as printf.

I'm not so much concerned with the bind<type> construct as I'm unsure how to bind to functions such as printf. Is there a syntax for this when utilizing Phoenix bind that I have missed?

Using boost::bind --

boost::bind<int>( &printf, "%d ", _1 )(42);

Using phoenix::bind --

phx::bind( &printf, "%d ", arg1 )(42);

results in compilation error.

Change History (4)

comment:1 by Thomas Heller, 11 years ago

Milestone: To Be DeterminedBoost 1.48.0
Severity: ProblemShowstopper
Status: newassigned

comment:2 by Thomas Heller, 11 years ago

Milestone: Boost 1.48.0To Be Determined

comment:3 by viboes, 9 years ago

Has this been fixed?

comment:4 by Kohei Takahashi, 6 years ago

It seems that depends on the behaviour of boost::result_of. i.e. C++11 (decltype based) works fine http://melpon.org/wandbox/permlink/z0l0df65Ivlgq2kp, but C++03 (TR1 based) doesn't http://melpon.org/wandbox/permlink/UUbaHC2mEeykrIBE.

Note: See TracTickets for help on using tickets.