// Copyright 2015-2018 Hans Dembinski // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) //[ guide_histogram_streaming #include #include #include #include #include #include int main() { using namespace boost::histogram; namespace tr = axis::transform; auto h = make_histogram(axis::regular<>(2, -1.0, 1.0, "axis 1"), axis::category({"red", "blue"}, "axis 2")); std::ostringstream os; os << h; std::cout << os.str() << std::endl; assert(os.str() == "histogram(\n" " regular(2, -1, 1, metadata=\"axis 1\", options=underflow | overflow),\n" " category(\"red\", \"blue\", metadata=\"axis 2\", options=overflow),\n" " 0: 0\n" " 1: 0\n" " 2: 0\n" " 3: 0\n" " 4: 0\n" " 5: 0\n" " 6: 0\n" " 7: 0\n" " 8: 0\n" " 9: 0\n" " 10: 0\n" " 11: 0\n" ")"); } //]