Search code examples
c++boost-bind

Comparing objects returned by Boost.Bind?


Is it possible? The instruction bool b = (boost::bind(func, 1) == boost::bind(func, 1)) does not compile because it "cannot convert from 'boost::_bi::bind_t' to 'bool'". (The signature of func is void func(int).)


Solution

  • Don't know if this is "oficially supported functionality" but bind_t does seem to provide a function_equal method: http://www.boost.org/doc/libs/1_47_0/boost/bind/bind.hpp