/*============================================================================= Copyright (c) 2009 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef BOOST_FUSION_ITERATOR_BASIC_ITERATOR_HPP #define BOOST_FUSION_ITERATOR_BASIC_ITERATOR_HPP #include #include #include #include #include #include #include namespace boost { namespace fusion { namespace extension { template struct value_of_impl; template struct deref_impl; template struct value_of_data_impl; template struct key_of_impl; template struct deref_data_impl; } template struct basic_iterator : iterator_facade, Category> { typedef mpl::int_ index; typedef Seq seq_type; template struct value_of : extension::value_of_impl::template apply {}; template struct deref : extension::deref_impl::template apply {}; template struct value_of_data : extension::value_of_data_impl::template apply {}; template struct key_of : extension::key_of_impl::template apply {}; template struct deref_data : extension::deref_data_impl::template apply {}; template struct advance { typedef basic_iterator type; static type call(It const& it) { return type(*it.seq,0); } }; template struct next : advance > {}; template struct prior : advance > {}; template struct distance { typedef mpl::minus type; static type call(It1 const&, It2 const&) { return type(); } }; template struct equal_to : mpl::and_< is_same< typename remove_const::type , typename remove_const::type > , mpl::equal_to > {}; template basic_iterator(basic_iterator const& it) : seq(it.seq) {} basic_iterator(Seq& in_seq, int) : seq(&in_seq) {} template basic_iterator& operator=(basic_iterator const& it) { seq=it.seq; return *this; } Seq* seq; }; }} #endif