
Hi, I am trying to get this source code to work, no luck so far. It works ok if I use the non-lambda approach, but with lambda it fails to compile. Apparently, boost.lambda thinks I want the bitwise action when in fact I want the overloaded operator... Any ideas? Code is attached.

Carlos Rafael Giani: ...
template < typename ValueType, unsigned int Size > std::ostream& operator << (std::ostream &out, std::tr1::array < ValueType, Size > const &array)
In general, when defining an overloaded operator<< for a type X, this definition needs to go in the namespace of X in order to be found by argument-dependent lookup. So depending on whether std::tr1::array is real or an alias for boost::array, you need to put the above operator<< in namespace std::tr1 or namespace boost, respectively.
participants (2)
-
Carlos Rafael Giani
-
Peter Dimov