diff --git a/include/boost/iterator/counting_iterator.hpp b/include/boost/iterator/counting_iterator.hpp index 9bb0419..89dbe99 100644 --- a/include/boost/iterator/counting_iterator.hpp +++ b/include/boost/iterator/counting_iterator.hpp @@ -5,6 +5,16 @@ #ifndef COUNTING_ITERATOR_DWA200348_HPP # define COUNTING_ITERATOR_DWA200348_HPP +# include +# include +# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +# include +# elif !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) +# include +# else +# include +# endif +# include # include # include # include @@ -45,7 +55,7 @@ namespace detail && boost::is_convertible::value )); # else - BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic::value); + BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic::value); # endif # endif @@ -77,8 +87,6 @@ namespace detail typedef typename boost::detail::numeric_traits::difference_type type; }; - BOOST_STATIC_ASSERT(is_numeric::value); - template struct counting_iterator_base { @@ -161,9 +169,9 @@ class counting_iterator public: typedef typename super_t::difference_type difference_type; - counting_iterator() { } + BOOST_DEFAULTED_FUNCTION(counting_iterator(), {}) - counting_iterator(counting_iterator const& rhs) : super_t(rhs.base()) {} + BOOST_DEFAULTED_FUNCTION(counting_iterator(counting_iterator const& rhs), : super_t(rhs.base()) {}) counting_iterator(Incrementable x) : super_t(x) @@ -180,6 +188,8 @@ class counting_iterator {} # endif + BOOST_DEFAULTED_FUNCTION(counting_iterator& operator=(counting_iterator const& rhs), { *static_cast< super_t* >(this) = static_cast< super_t const& >(rhs); return *this; }) + private: typename super_t::reference dereference() const @@ -206,8 +216,8 @@ template inline counting_iterator make_counting_iterator(Incrementable x) { - typedef counting_iterator result_t; - return result_t(x); + typedef counting_iterator result_t; + return result_t(x); } } // namespace iterators