Remove std::iterator inheritance from multi_span (#591)

In C++17 std::iterator is marked duplicated. Added handwritten usigs for traits.
This commit is contained in:
paweldac 2017-11-28 16:15:34 +01:00 committed by Neil MacIntosh
parent 0d33bf6794
commit 436dbad8c6

View File

@ -806,17 +806,15 @@ struct is_bounds<strided_bounds<Rank>> : std::integral_constant<bool, true>
}; };
template <typename IndexType> template <typename IndexType>
class bounds_iterator : public std::iterator<std::random_access_iterator_tag, IndexType> class bounds_iterator
{ {
private:
using Base = std::iterator<std::random_access_iterator_tag, IndexType>;
public: public:
static const std::size_t rank = IndexType::rank; static const std::size_t rank = IndexType::rank;
using typename Base::reference; using iterator_category = std::random_access_iterator_tag;
using typename Base::pointer; using value_type = IndexType;
using typename Base::difference_type; using difference_type = std::ptrdiff_t;
using typename Base::value_type; using pointer = value_type*;
using reference = value_type&;
using index_type = value_type; using index_type = value_type;
using index_size_type = typename IndexType::value_type; using index_size_type = typename IndexType::value_type;
template <typename Bounds> template <typename Bounds>
@ -1997,14 +1995,13 @@ private:
template <class Span> template <class Span>
class contiguous_span_iterator class contiguous_span_iterator
: public std::iterator<std::random_access_iterator_tag, typename Span::value_type>
{ {
using Base = std::iterator<std::random_access_iterator_tag, typename Span::value_type>;
public: public:
using typename Base::reference; using iterator_category = std::random_access_iterator_tag;
using typename Base::pointer; using value_type = typename Span::value_type;
using typename Base::difference_type; using difference_type = std::ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
private: private:
template <typename ValueType, std::ptrdiff_t FirstDimension, std::ptrdiff_t... RestDimensions> template <typename ValueType, std::ptrdiff_t FirstDimension, std::ptrdiff_t... RestDimensions>
@ -2117,15 +2114,13 @@ contiguous_span_iterator<Span> operator+(typename contiguous_span_iterator<Span>
template <typename Span> template <typename Span>
class general_span_iterator class general_span_iterator
: public std::iterator<std::random_access_iterator_tag, typename Span::value_type>
{ {
using Base = std::iterator<std::random_access_iterator_tag, typename Span::value_type>;
public: public:
using typename Base::reference; using iterator_category = std::random_access_iterator_tag;
using typename Base::pointer; using value_type = typename Span::value_type;
using typename Base::difference_type; using difference_type = std::ptrdiff_t;
using typename Base::value_type; using pointer = value_type*;
using reference = value_type&;
private: private:
template <typename ValueType, std::size_t Rank> template <typename ValueType, std::size_t Rank>