diff options
Diffstat (limited to 'boost/spirit/home/classic/iterator')
-rw-r--r-- | boost/spirit/home/classic/iterator/impl/file_iterator.ipp | 6 | ||||
-rw-r--r-- | boost/spirit/home/classic/iterator/multi_pass.hpp | 22 |
2 files changed, 11 insertions, 17 deletions
diff --git a/boost/spirit/home/classic/iterator/impl/file_iterator.ipp b/boost/spirit/home/classic/iterator/impl/file_iterator.ipp index 0fb92c72a3..4953e86a64 100644 --- a/boost/spirit/home/classic/iterator/impl/file_iterator.ipp +++ b/boost/spirit/home/classic/iterator/impl/file_iterator.ipp @@ -130,7 +130,7 @@ public: void advance(std::ptrdiff_t n) { - m_pos += n * sizeof(CharT); + m_pos += static_cast<long>(n) * sizeof(CharT); update_char(); } @@ -141,14 +141,14 @@ public: private: boost::shared_ptr<std::FILE> m_file; - std::size_t m_pos; + long m_pos; CharT m_curChar; bool m_eof; void update_char(void) { using namespace std; - if ((std::size_t)ftell(m_file.get()) != m_pos) + if (ftell(m_file.get()) != m_pos) fseek(m_file.get(), m_pos, SEEK_SET); m_eof = (fread(&m_curChar, sizeof(CharT), 1, m_file.get()) < 1); diff --git a/boost/spirit/home/classic/iterator/multi_pass.hpp b/boost/spirit/home/classic/iterator/multi_pass.hpp index fd9482ef31..260d2933e5 100644 --- a/boost/spirit/home/classic/iterator/multi_pass.hpp +++ b/boost/spirit/home/classic/iterator/multi_pass.hpp @@ -16,7 +16,6 @@ #include <algorithm> // for std::swap #include <exception> // for std::exception #include <boost/limits.hpp> -#include <boost/iterator.hpp> #include <boost/spirit/home/classic/namespace.hpp> #include <boost/spirit/home/classic/core/assert.hpp> // for BOOST_SPIRIT_ASSERT @@ -760,24 +759,19 @@ class inner namespace iterator_ { namespace impl { -// Meta-function to generate a std::iterator<> base class for multi_pass. This -// is used mainly to improve conformance of compilers not supporting PTS -// and thus relying on inheritance to recognize an iterator. -// We are using boost::iterator<> because it offers an automatic workaround -// for broken std::iterator<> implementations. +// Meta-function to generate a std::iterator<>-like base class for multi_pass. template <typename InputPolicyT, typename InputT> struct iterator_base_creator { typedef typename InputPolicyT::BOOST_NESTED_TEMPLATE inner<InputT> input_t; - typedef boost::iterator - < - std::forward_iterator_tag, - typename input_t::value_type, - typename input_t::difference_type, - typename input_t::pointer, - typename input_t::reference - > type; + struct type { + typedef std::forward_iterator_tag iterator_category; + typedef typename input_t::value_type value_type; + typedef typename input_t::difference_type difference_type; + typedef typename input_t::pointer pointer; + typedef typename input_t::reference reference; + }; }; }} |