
Krzysztof, According to the C++ standard, the ostream output (cout and wcout) will only handle built-in types (e.g., int, char, double, etc). It's up to the developer implement how all other types will print to the output. See full rationale and details in Stroustrup, Bjarne TCPPPL 3rd Edition - 21.2.2 Output of Built In Types. In short, you'll have to define a global operator<< for type std::pair<T, U>: template<typename CharType, typename T, typename U> std::basic_ostream<CharType>& operator<< (std::basic_ostream<CharType>& o, std::pair<T, U> mypair) { return o << "This is my way of printing a pair: first: " << mypair.first << " and second: " << mypair.second; } Be advised that types T and U must be either built-in types or types with defined operator<<. Cheers, Matheus -----Mensagem original----- De: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] Em nome de Krzysztof Zelechowski Enviada em: quarta-feira, 21 de setembro de 2011 11:59 Para: boost-users@lists.boost.org Assunto: [Boost-users] How do I print a standard pair? The expression (cout << make_pair (0, 1)) gives me an error. Does Boost offer me a way to print a (rvalue) pair, as within an expression? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users