1 // Copyright (c) 2001, Daniel C. Nuffer
2 // Copyright (c) 2001-2011 Hartmut Kaiser
3 // http://spirit.sourceforge.net/
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #if !defined(BOOST_SPIRIT_ITERATOR_LOOK_AHEAD_MAR_16_2007_1253PM)
9 #define BOOST_SPIRIT_ITERATOR_LOOK_AHEAD_MAR_16_2007_1253PM
11 #include <boost/spirit/home/support/iterators/detail/first_owner_policy.hpp>
12 #include <boost/spirit/home/support/iterators/detail/no_check_policy.hpp>
13 #include <boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp>
14 #include <boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp>
15 #include <boost/spirit/home/support/iterators/detail/combine_policies.hpp>
16 #include <boost/spirit/home/support/iterators/multi_pass.hpp>
18 namespace boost { namespace spirit
20 ///////////////////////////////////////////////////////////////////////////
21 // this could be a template typedef, since such a thing doesn't
22 // exist in C++, we'll use inheritance to accomplish the same thing.
23 ///////////////////////////////////////////////////////////////////////////
24 template <typename T, std::size_t N>
27 , iterator_policies::default_policy<
28 iterator_policies::first_owner
29 , iterator_policies::no_check
30 , iterator_policies::input_iterator
31 , iterator_policies::fixed_size_queue<N> >
36 , iterator_policies::default_policy<
37 iterator_policies::first_owner
38 , iterator_policies::no_check
39 , iterator_policies::input_iterator
40 , iterator_policies::fixed_size_queue<N> >
47 explicit look_ahead(T x)
50 look_ahead(look_ahead const& x)
53 #if BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
54 look_ahead(int) // workaround for a bug in the library
55 : base_type() {} // shipped with gcc 3.1
56 #endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
58 look_ahead operator= (base_type const& rhs)
60 this->base_type::operator=(rhs);
64 // default generated operators destructor and assignment operator are ok.