Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //  Copyright (c) 2001, Daniel C. Nuffer
0002 //  Copyright (c) 2001-2011 Hartmut Kaiser
0003 //  http://spirit.sourceforge.net/
0004 // 
0005 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 
0008 #if !defined(BOOST_SPIRIT_ITERATOR_LOOK_AHEAD_MAR_16_2007_1253PM)
0009 #define BOOST_SPIRIT_ITERATOR_LOOK_AHEAD_MAR_16_2007_1253PM
0010 
0011 #include <boost/spirit/home/support/iterators/detail/first_owner_policy.hpp>
0012 #include <boost/spirit/home/support/iterators/detail/no_check_policy.hpp>
0013 #include <boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp>
0014 #include <boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp>
0015 #include <boost/spirit/home/support/iterators/detail/combine_policies.hpp>
0016 #include <boost/spirit/home/support/iterators/multi_pass.hpp>
0017 
0018 namespace boost { namespace spirit 
0019 {
0020     ///////////////////////////////////////////////////////////////////////////
0021     //  this could be a template typedef, since such a thing doesn't
0022     //  exist in C++, we'll use inheritance to accomplish the same thing.
0023     ///////////////////////////////////////////////////////////////////////////
0024     template <typename T, std::size_t N>
0025     class look_ahead :
0026         public multi_pass<T
0027           , iterator_policies::default_policy<
0028                 iterator_policies::first_owner
0029               , iterator_policies::no_check
0030               , iterator_policies::input_iterator
0031               , iterator_policies::fixed_size_queue<N> > 
0032         >
0033     {
0034     private:
0035         typedef multi_pass<T
0036           , iterator_policies::default_policy<
0037                 iterator_policies::first_owner
0038               , iterator_policies::no_check
0039               , iterator_policies::input_iterator
0040               , iterator_policies::fixed_size_queue<N> > 
0041         > base_type;
0042 
0043     public:
0044         look_ahead()
0045           : base_type() {}
0046 
0047         explicit look_ahead(T x)
0048           : base_type(x) {}
0049 
0050         look_ahead(look_ahead const& x)
0051           : base_type(x) {}
0052 
0053 #if BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
0054         look_ahead(int)         // workaround for a bug in the library
0055           : base_type() {}      // shipped with gcc 3.1
0056 #endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
0057 
0058         look_ahead operator= (base_type const& rhs)
0059         {
0060             this->base_type::operator=(rhs);
0061             return *this;
0062         }
0063 
0064     // default generated operators destructor and assignment operator are ok.
0065     };
0066 
0067 }}
0068 
0069 #endif