Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //  Copyright (c) 2001-2011 Hartmut Kaiser
0002 // 
0003 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #if !defined(BOOST_SPIRIT_ISTREAM_ITERATOR_JAN_03_2010_0522PM)
0007 #define BOOST_SPIRIT_ISTREAM_ITERATOR_JAN_03_2010_0522PM
0008 
0009 #include <boost/spirit/home/support/iterators/detail/ref_counted_policy.hpp>
0010 #if defined(BOOST_SPIRIT_DEBUG)
0011 #include <boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp>
0012 #else
0013 #include <boost/spirit/home/support/iterators/detail/no_check_policy.hpp>
0014 #endif
0015 #include <boost/spirit/home/support/iterators/detail/istream_policy.hpp>
0016 #include <boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp>
0017 #include <boost/spirit/home/support/iterators/detail/combine_policies.hpp>
0018 #include <boost/spirit/home/support/iterators/multi_pass.hpp>
0019 
0020 namespace boost { namespace spirit 
0021 {
0022     ///////////////////////////////////////////////////////////////////////////
0023     template <typename Elem, typename Traits = std::char_traits<Elem> >
0024     class basic_istream_iterator :
0025         public multi_pass<
0026             std::basic_istream<Elem, Traits>
0027           , iterator_policies::default_policy<
0028                 iterator_policies::ref_counted
0029 #if defined(BOOST_SPIRIT_DEBUG)
0030               , iterator_policies::buf_id_check
0031 #else
0032               , iterator_policies::no_check
0033 #endif
0034               , iterator_policies::istream
0035               , iterator_policies::split_std_deque> 
0036         >
0037     {
0038     private:
0039         typedef multi_pass<
0040             std::basic_istream<Elem, Traits>
0041           , iterator_policies::default_policy<
0042                 iterator_policies::ref_counted
0043 #if defined(BOOST_SPIRIT_DEBUG)
0044               , iterator_policies::buf_id_check
0045 #else
0046               , iterator_policies::no_check
0047 #endif
0048               , iterator_policies::istream
0049               , iterator_policies::split_std_deque> 
0050         > base_type;
0051 
0052     public:
0053         basic_istream_iterator()
0054           : base_type() {}
0055 
0056         explicit basic_istream_iterator(std::basic_istream<Elem, Traits>& x)
0057           : base_type(x) {}
0058 
0059 #if BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
0060         basic_istream_iterator(int)   // workaround for a bug in the library
0061           : base_type() {}            // shipped with gcc 3.1
0062 #endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
0063 
0064         basic_istream_iterator operator= (base_type const& rhs)
0065         {
0066             this->base_type::operator=(rhs);
0067             return *this;
0068         }
0069 
0070     // default generated operators, destructor and assignment operator are ok.
0071     };
0072 
0073     typedef basic_istream_iterator<char> istream_iterator;
0074 
0075 }}
0076 
0077 #endif