Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:35

0001 //  Copyright (c) 2001-2011 Hartmut Kaiser
0002 //  Copyright (c) 2001-2011 Joel de Guzman
0003 // 
0004 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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) // assignment operator could not be generated.
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; // suppresses warning: C4100: 'component' : unreferenced formal parameter
0038 #endif
0039             // return true if any of the generators fail
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; // suppresses warning: C4100: 'component' : unreferenced formal parameter
0048 #endif
0049             // return true if any of the generators fail
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