• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  Copyright (c) 2001-2011 Hartmut Kaiser
2 //
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)
5 
6 #if !defined(BOOST_SPIRIT_KARMA_DELIMIT_FEB_20_2007_1208PM)
7 #define BOOST_SPIRIT_KARMA_DELIMIT_FEB_20_2007_1208PM
8 
9 #if defined(_MSC_VER)
10 #pragma once
11 #endif
12 
13 #include <boost/spirit/home/support/unused.hpp>
14 #include <boost/spirit/home/karma/detail/unused_delimiter.hpp>
15 
16 namespace boost { namespace spirit { namespace karma
17 {
18     ///////////////////////////////////////////////////////////////////////////
19     //  Do delimiting. This is equivalent to p << d. The function is a
20     //  no-op if spirit::unused is passed as the delimiter-generator.
21     ///////////////////////////////////////////////////////////////////////////
22     template <typename OutputIterator, typename Delimiter>
delimit_out(OutputIterator & sink,Delimiter const & d)23     inline bool delimit_out(OutputIterator& sink, Delimiter const& d)
24     {
25         return d.generate(sink, unused, unused, unused);
26     }
27 
28     template <typename OutputIterator>
delimit_out(OutputIterator &,unused_type)29     inline bool delimit_out(OutputIterator&, unused_type)
30     {
31         return true;
32     }
33 
34     ///////////////////////////////////////////////////////////////////////////
35     template <typename OutputIterator, typename Delimiter>
delimit_out(OutputIterator &,detail::unused_delimiter<Delimiter> const &)36     inline bool delimit_out(OutputIterator&
37       , detail::unused_delimiter<Delimiter> const&)
38     {
39         return true;
40     }
41 
42 }}}
43 
44 #endif
45 
46