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_ITERATOR_MULTI_PASS_WRAPPER_JUL_12_2009_0914PM) 7 #define BOOST_SPIRIT_ITERATOR_MULTI_PASS_WRAPPER_JUL_12_2009_0914PM 8 9 #if defined(_MSC_VER) 10 #pragma once 11 #endif 12 13 #include <boost/mpl/bool.hpp> 14 #include <boost/spirit/home/support/detail/scoped_enum_emulation.hpp> 15 16 namespace boost { namespace spirit { namespace traits 17 { 18 // declare special functions allowing to integrate any multi_pass iterator 19 // with expectation points 20 21 // normal iterators require no special handling BOOST_SCOPED_ENUM_START(clear_mode)22 BOOST_SCOPED_ENUM_START(clear_mode) 23 { 24 clear_if_enabled, 25 clear_always 26 }; 27 BOOST_SCOPED_ENUM_END 28 29 template <typename Iterator> clear_queue(Iterator &,BOOST_SCOPED_ENUM (clear_mode)=clear_mode::clear_if_enabled)30 void clear_queue(Iterator& 31 , BOOST_SCOPED_ENUM(clear_mode) /*mode*/ = clear_mode::clear_if_enabled) 32 {} 33 34 template <typename Iterator> inhibit_clear_queue(Iterator &,bool)35 void inhibit_clear_queue(Iterator&, bool) 36 {} 37 38 template <typename Iterator> inhibit_clear_queue(Iterator &)39 bool inhibit_clear_queue(Iterator&) 40 { 41 return false; 42 } 43 44 // Helper template to recognize a multi_pass iterator. This specialization 45 // will be instantiated for any non-multi_pass iterator. 46 template <typename Iterator> 47 struct is_multi_pass : mpl::false_ {}; 48 49 }}} 50 51 #endif 52 53