/*============================================================================= Copyright (c) 2011-2013 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout 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) =============================================================================*/ #ifndef TESTSPR_PRINT_HPP #define TESTSPR_PRINT_HPP #include #include #include #include #include #include namespace testspr { // // print // template void print(InputIterator first, InputIterator last) { std::for_each(first, last, [](typename std::iterator_traits::value_type const& e){ std::cout << e << ' '; }); std::cout << std::endl; } template void print(InputRange const& range) { testspr::print(sprout::begin(range), sprout::end(range)); } // // print_ln // void print_ln() { std::cout << std::endl; } template void print_ln(T const& t) { std::cout << t << std::endl; } template void print_ln(Head const& head, Tail const&... tail) { std::cout << head; testspr::print_ln(tail...); } // // print_bits // template void print_bits(T const& t) { testspr::print_ln(std::bitset(t).template to_string()); } // // print_typename // template void print_typename() { testspr::print_ln(testspr::typename_of()); } // // print_type // template void print_type() { testspr::print_typename >(); } // // print_hl // void print_hl() { testspr::print_ln("--------------------------------------------------------------------------------"); } } // namespace testspr #endif // #ifndef TESTSPR_PRINT_HPP