$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: James Sutherland (James.Sutherland_at_[hidden])
Date: 2008-07-07 16:43:16
The following code does not compile:
struct X {
int foo(int i) { return ++i; }
template<class T> void foo( T& t );
};
int main()
{
boost::function<int(int)> f;
X x;
f = boost::bind( &X::foo, &x );
std::cout << f(5) << std::endl;
}
I get the error message "no matching function for call to
bind(<unknown type>, X*)"
If I remove the "template<class T> void foo" method then it compiles
fine.
Is there a way to tell boost::bind to choose the int foo(int i) method
rather than the "template<class T> void foo" method?
James