
Hello, Below I implement a function "Chain" that takes two functions and executes them both. The first approach succeeds: direct function call. The second approach succeeds: call via bind with explicit template arguments The third and fourth approaches fail: call via bind without explicit template arguments (with/without boost::protect) Question: Why do I have to use explicit template arguments when using bind with Chain? Thank you, Chris === #include <boost/bind.hpp> #include <boost/function.hpp> template <typename TAFunc1, typename TAFunc2> void Chain(const TAFunc1& Func1, TAFunc2& Func2) { Func1(); Func2(); } void f() { } void foo() { boost::function<void()> x = boost::bind(f); boost::function<void()> y = boost::bind(f); Chain(x, y); boost::bind(Chain<boost::function<void()>, boost::function<void()> >, x, y)(); boost::bind(Chain, x, y)(); boost::bind(Chain, boost::protect(x), boost::protect(y))(); }