
26 Jun
2006
26 Jun
'06
11:25 a.m.
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...