Markus Werle wrote:
Markus Werle wrote:
OK, that's a solution.
No it is not :-( still having problems with template functions:
[...]
template <class T> inline std::string Foo(const T& t) {}
[...]
// THIS HERE FAILS TO COMPILE! for_each_pair(M.begin(), M.end(), l::bind(&Foostd::string, l::_2));
This is a language problem. A function template is treated as if it names an overload set, even when the supplied template arguments limit that set to a single instance. Many compilers accept the code above as an extension. There is an open issue about this problem: http://std.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#115 Workaround: std::string (*pf)(std::string const &) = &Foo; for_each_pair(M.begin(), M.end(), l::bind(pf, l::_2));