Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-06-26 12:09:28


Sorry,

you are right. I forgot that all operators are overloaded or defined in std namespace. But still
it would be nice as hint in the documentation, that this operator should be from std namespace.

With Kind Regards,

Ovanes Markarian

On Mon, June 26, 2006 13:25, Peter Dimov wrote:
> Ovanes Markarian wrote:
>
>> namespace boost
>> {
>> template <typename T>
>> std::ostream& operator<<(std::ostream& os, const
>> std::vector<T>& v) {
>> for(typename std::vector<T>::size_type i = 0; i <
>> v.size(); ++i) os << v[i] << std::endl;
>>
>> return os;
>> }
>> }
>
> No, this is not correct (even though it works with VC) and has nothing to do
> with boost::variant.
>
> The only correct place for this operator<< is in namespace std. Of course
> you aren't supposed to put things there, but...
>
>
>


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