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_DETAIL_GENERATE_AUTO_DEC_01_2009_0743PM)
7 #define BOOST_SPIRIT_KARMA_DETAIL_GENERATE_AUTO_DEC_01_2009_0743PM
13 #include <boost/spirit/home/karma/generate.hpp>
14 #include <boost/spirit/home/karma/auto/create_generator.hpp>
15 #include <boost/utility/enable_if.hpp>
16 #include <boost/mpl/not.hpp>
17 #include <boost/mpl/and.hpp>
19 namespace boost { namespace spirit { namespace karma { namespace detail
21 ///////////////////////////////////////////////////////////////////////////
22 template <typename Expr>
23 struct generate_impl<Expr
26 traits::meta_create_exists<karma::domain, Expr>
27 , mpl::not_<traits::matches<karma::domain, Expr> > >
30 template <typename OutputIterator>
35 return karma::generate(sink, create_generator<Expr>(), expr);
39 ///////////////////////////////////////////////////////////////////////////
40 template <typename Expr>
41 struct generate_delimited_impl<Expr
44 traits::meta_create_exists<karma::domain, Expr>
45 , mpl::not_<traits::matches<karma::domain, Expr> > >
48 template <typename OutputIterator, typename Delimiter>
52 , Delimiter const& delimiter
53 , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit)
55 return karma::generate_delimited(
56 sink, create_generator<Expr>(), delimiter, pre_delimit, expr);