1 // Copyright 2018-2019 Hans Dembinski
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_HISTOGRAM_TEST_STD_OSTREAM_HPP
8 #define BOOST_HISTOGRAM_TEST_STD_OSTREAM_HPP
10 #include <boost/mp11/tuple.hpp>
16 // never add to std, we only do it here to get ADL working :(
18 ostream& operator<<(ostream& os, const vector<T>& v) {
20 for (const auto& x : v) os << x << " ";
25 template <class... Ts>
26 ostream& operator<<(ostream& os, const std::tuple<Ts...>& t) {
28 ::boost::mp11::tuple_for_each(t, [&os](const auto& x) { os << x << " "; });
33 template <class T, class U>
34 ostream& operator<<(ostream& os, const std::pair<T, U>& t) {
35 os << "[ " << t.first << " " << t.second << " ]";