
2 Mar
2005
2 Mar
'05
1:23 p.m.
Patrick M?zard wrote:
However, it does not work with typedefed types. Here is a new example :
//********************* #include <boost/test/unit_test.hpp> using boost::unit_test::test_suite;
namespace testns {
typedef std::pair<int, std::string> Test;
std::ostream& operator<<(std::ostream& o, Test const& t) { return o<<t.first<<t.second; }
Try writing: namespace std { std::ostream& operator<<(std::ostream& o, std::pair<int, std::string> const& t) { return o<<t.first<<t.second; } } I think namespace std is the only place that will be searched for operator<< (except for boost:: and for boost::test_tools and boost::test_tools::tt_detail). - Volodya