Opened 14 years ago
Closed 14 years ago
#2127 closed Bugs (fixed)
function_equal should work with nested binds
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | Boost 1.39.0 | Component: | bind |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | Cc: |
Description
http://lists.boost.org/Archives/boost/2008/07/139992.php
To fix the compiler error in the program below, add the following (e.g. to boost/bind.hpp) -
namespace boost { namespace _bi { template<class R, class F, class L> bool ref_compare( bind_t<R,F,L> const & a, bind_t<R,F,L> const & b, long ) { return a.compare(b); } } }
-- main.cpp --
#include <boost/function_equal.hpp> #include <boost/bind.hpp> void f( int ) {} int g( int i ) { return i+5; } template < typename F > bool self_equal( F f_ ) { return function_equal( f_, f_ ); } int main( int argc, char * const argv[] ) { self_equal( boost::bind( f, _1 ) ); // OK self_equal( boost::bind( g, _1 ) ); // OK self_equal( boost::bind( f, boost::bind( g, _1 ) ) ); // compiler error return 0; }
Change History (4)
comment:1 by , 14 years ago
Milestone: | Boost 1.35.1 → Boost 1.37.0 |
---|---|
Status: | new → assigned |
comment:2 by , 14 years ago
Milestone: | Boost 1.37.0 → Boost 1.39.0 |
---|
comment:3 by , 14 years ago
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
(In [51511]) Refs #2127 (fixed in trunk).