Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-17 19:44:42


AMDG

John C. Femiani wrote:
> What aspect wouldn't work as I expected? Do you mean that overloads
> of repr that aren't in namespace boost could occlude ::boost::repr? In
> that case its a lot like ::boost::begin I think.

You do realize that boost::begin is implemented using
range_begin which should be defined in the user's namespace, right?
http://www.boost.org/doc/libs/1_35_0/libs/range/doc/boost_range.html#method2

> The point of repr was to avoid putting an overload operator<< into
> namespace std.

The problem:

namespace boost {

    template<class T>
    void print(const T& t) {
        std::cout << boost::repr(t);
    }

}

namespace boost {
    void repr(const std::vector<int>&); // Not found by print.
}

It fails for exactly the same reason that overloading operator<< does.

In Christ,
Steven Watanabe


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