Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-03-02 08:23:49


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net