1 // Copyright (c) 2001-2011 Hartmut Kaiser
2 // Copyright (c) 2001-2011 Joel de Guzman
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #if !defined(SPIRIT_KARMA_SEQUENCE_FEB_28_2007_0249PM)
8 #define SPIRIT_KARMA_SEQUENCE_FEB_28_2007_0249PM
14 #include <boost/spirit/home/support/unused.hpp>
15 #include <boost/config.hpp>
17 namespace boost { namespace spirit { namespace karma { namespace detail
19 template <typename OutputIterator, typename Context, typename Delimiter>
22 typedef Context context_type;
24 fail_function(OutputIterator& sink_, Context& context_
25 , Delimiter const& delim_)
26 : sink(sink_), ctx(context_), delim(delim_)
29 template <typename Component, typename Attribute>
30 bool operator()(Component const& component, Attribute const& attr) const
32 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
33 component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
35 // return true if any of the generators fail
36 return !component.generate(sink, ctx, delim, attr);
39 template <typename Component>
40 bool operator()(Component const& component) const
42 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
43 component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
45 // return true if any of the generators fail
46 return !component.generate(sink, ctx, delim, unused);
51 Delimiter const& delim;
54 // silence MSVC warning C4512: assignment operator could not be generated
55 fail_function& operator= (fail_function const&);