Binding overloaded operators is ... tricky, to say the least.
Basically, you need to do an explicit cast in order to let the compiler select the correct overload. That is, you need something like
Code:
boost::bind(
static_cast< std::ostream& (*)(std::ostream&, const char*) >(&std::operator << <std::char_traits<char> >), std::cout, "Test");
The whole thing is such a mess that you don't really save any code. Just thing about how often
std::cout << msg;
fits into the horrible line above.
A better choice here would be Boost.Lambda:
(ll::ref(std::cout) << "Test")
Assuming you have
namespace ll = boost::lambda
in effect.