/*============================================================================= Copyright (c) 1999-2003 Jaakko Järvi Copyright (c) 1999-2003 Jeremiah Willcock Copyright (c) 2001-2006 Joel de Guzman 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) ==============================================================================*/ #if !defined(FUSION_OUT_05052005_0121) #define FUSION_OUT_05052005_0121 #include #include #include #include #include #include #include #include namespace boost { namespace fusion { namespace detail { template struct delimiter_out { // print a delimiter template static void print(OS& os, char const* delim, mpl::false_ = mpl::false_()) { detail::string_ios_manip manip(os); manip.print(delim); } template static void print(OS& os, char const* delim, mpl::true_) { } }; struct print_sequence_loop { template static void call(OS& os, First const&, Last const&, mpl::true_) { } template static void call(OS& os, First const& first, Last const& last, mpl::false_) { result_of::equal_to< typename result_of::next::type , Last > is_last; os << *first; delimiter_out::print(os, " ", is_last); call(os, fusion::next(first), last, is_last); } template static void call(OS& os, First const& first, Last const& last) { result_of::equal_to eq; call(os, first, last, eq); } }; template inline void print_sequence(OS& os, Sequence const& seq) { delimiter_out::print(os, "("); print_sequence_loop::call(os, fusion::begin(seq), fusion::end(seq)); delimiter_out::print(os, ")"); } }}} #endif