1 // Copyright (c) 2001-2011 Hartmut Kaiser
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #if !defined(BOOST_SPIRIT_KARMA_FORMAT_MANIP_AUTO_DEC_02_2009_1246PM)
7 #define BOOST_SPIRIT_KARMA_FORMAT_MANIP_AUTO_DEC_02_2009_1246PM
13 #include <boost/spirit/home/karma/stream/detail/format_manip.hpp>
14 #include <boost/spirit/home/karma/auto/create_generator.hpp>
15 #include <boost/utility/enable_if.hpp>
17 ///////////////////////////////////////////////////////////////////////////////
18 namespace boost { namespace spirit { namespace karma { namespace detail
20 ///////////////////////////////////////////////////////////////////////////
21 template <typename Expr>
23 , typename enable_if<traits::meta_create_exists<karma::domain, Expr> >::type>
25 typedef typename result_of::create_generator<Expr>::type expr_type;
27 expr_type, mpl::true_, mpl::false_, unused_type, Expr
30 static type call(Expr const& expr)
32 return type(create_generator<Expr>(), unused, expr);
36 ///////////////////////////////////////////////////////////////////////////
37 template <typename Expr, typename Delimiter>
38 struct format_delimited<Expr, Delimiter
39 , typename enable_if<traits::meta_create_exists<karma::domain, Expr> >::type>
41 typedef typename result_of::create_generator<Expr>::type expr_type;
43 expr_type, mpl::true_, mpl::false_, Delimiter, Expr
46 static type call(Expr const& expr
47 , Delimiter const& delimiter
48 , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit)
50 return type(create_generator<Expr>(), delimiter, pre_delimit, expr);