File indexing completed on 2025-01-19 09:47:35
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_SPIRIT_KARMA_DETAIL_FAIL_FUNCTION_HPP
0008 #define BOOST_SPIRIT_KARMA_DETAIL_FAIL_FUNCTION_HPP
0009
0010 #if defined(_MSC_VER)
0011 #pragma once
0012 #endif
0013
0014 #include <boost/spirit/home/support/unused.hpp>
0015 #include <boost/config.hpp>
0016
0017 namespace boost { namespace spirit { namespace karma { namespace detail
0018 {
0019 #ifdef _MSC_VER
0020 # pragma warning(push)
0021 # pragma warning(disable: 4512)
0022 #endif
0023 template <typename OutputIterator, typename Context, typename Delimiter>
0024 struct fail_function
0025 {
0026 typedef Context context_type;
0027
0028 fail_function(OutputIterator& sink_, Context& context_
0029 , Delimiter const& delim_)
0030 : sink(sink_), ctx(context_), delim(delim_)
0031 {}
0032
0033 template <typename Component, typename Attribute>
0034 bool operator()(Component const& component, Attribute const& attr) const
0035 {
0036 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
0037 (void)component;
0038 #endif
0039
0040 return !component.generate(sink, ctx, delim, attr);
0041 }
0042
0043 template <typename Component>
0044 bool operator()(Component const& component) const
0045 {
0046 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
0047 (void)component;
0048 #endif
0049
0050 return !component.generate(sink, ctx, delim, unused);
0051 }
0052
0053 OutputIterator& sink;
0054 Context& ctx;
0055 Delimiter const& delim;
0056 };
0057 #ifdef _MSC_VER
0058 # pragma warning(pop)
0059 #endif
0060
0061 }}}}
0062
0063 #endif