Home | Libraries | People | FAQ | More |
boost::segmented_tree::iterator_t
// In header: <boost/segmented_tree/seq.hpp> template<typename StaticTraits, typename Pointer, typename Reference> class iterator_t { public: // types typedef std::random_access_iterator_tag iterator_category; // The iterator category type. typedef typename static_traits::value_type value_type; // The value type. typedef typename static_traits::size_type size_type; // The size type. typedef typename static_traits::difference_type difference_type; // The difference type. typedef Pointer pointer; // The pointer type. typedef Reference reference; // The iterator reference type. // construct/copy/destruct iterator_t(iterator_data); iterator_t() = default; iterator_t(iterator_t const &) = default; template<typename P, typename R, typename = typename std::enable_if< std::is_convertible<P, pointer>::value>::type> iterator_t(iterator_t< static_traits, P, R > const &); iterator_t & operator=(iterator_t const &) = default; // friend functions friend iterator_t operator+(difference_type, iterator_t); // public member functions pointer current() const; pointer begin() const; pointer end() const; pointer operator->() const; reference operator*() const; reference operator[](difference_type) const; iterator_t & operator++(); iterator_t & operator--(); iterator_t operator++(int); iterator_t operator--(int); iterator_t & operator+=(difference_type); iterator_t & operator-=(difference_type); iterator_t operator+(difference_type) const; iterator_t operator-(difference_type) const; difference_type operator-(iterator_t const &) const; iterator_t & move_before_segment(); iterator_t & move_before_segment(size_type); iterator_t & move_after_segment(); iterator_t & move_after_segment(size_type); iterator_t before_segment() const; iterator_t after_segment() const; iterator_t before_segment(size_type) const; iterator_t after_segment(size_type) const; bool operator!=(iterator_t const &) const; bool operator==(iterator_t const &) const; bool operator<(iterator_t const &) const; bool operator>(iterator_t const &) const; bool operator<=(iterator_t const &) const; bool operator>=(iterator_t const &) const; };
A template class used for const and non-const iterators for seq.
typename StaticTraits
typename Pointer
A const or non-const pointer.
typename Reference
A const or non-const reference.
iterator_t
public
construct/copy/destructiterator_t(iterator_data it);
iterator_t() = default;
Effects. Default constructs an iterator from another.
Complexity. Constant.
iterator_t(iterator_t const & other) = default;
Effects. Copy constructs an iterator from other.
Complexity. Constant.
template<typename P, typename R, typename = typename std::enable_if< std::is_convertible<P, pointer>::value>::type> iterator_t(iterator_t< static_traits, P, R > const & other);
Effects. Copy constructs a const iterator from non-const iterator other.
Complexity. Constant.
iterator_t & operator=(iterator_t const & other) = default;
Effects. Copy assigns from other.
Complexity. Constant.
iterator_t
friend functionsfriend iterator_t operator+(difference_type diff, iterator_t it);
Returns. A copy of the iterator it moved forward diff elements.
Complexity. Logarithmic amortized in the absolute value of diff.
iterator_t
public member functionspointer current() const;
Returns. A pointer to the current element of the current segment of the iterator.
Complexity. Constant.
Note. Non-standard extension.
pointer begin() const;
Returns. A pointer to the first element of the current segment of the iterator.
Complexity. Constant.
Note. Non-standard extension.
pointer end() const;
Returns. A pointer 1 past the last element of the current segment of the iterator.
Complexity. Constant.
Note. Non-standard extension.
pointer operator->() const;
Returns. A pointer to the current element.
Complexity. Constant.
reference operator*() const;
Returns. A reference to the current element.
Complexity. Constant.
reference operator[](difference_type diff) const;
Returns. A reference to the element diff positions away from the current position.
Complexity. Logarithmic amortized in the absolute value of diff.
iterator_t & operator++();
Effects. Move the iterator forward 1 element.
Returns. A reference to *this.
Complexity. Constant amortized.
iterator_t & operator--();
Effects. Move the iterator backward 1 element.
Returns. A reference to *this.
Complexity. Constant amortized.
iterator_t operator++(int);
Returns. A copy of the iterator moved forward 1 element.
Complexity. Constant amortized.
iterator_t operator--(int);
Returns. A copy of the iterator moved backward 1 element.
Complexity. Constant amortized.
iterator_t & operator+=(difference_type diff);
Effects. Move the iterator forward diff elements.
Returns. A reference to *this.
Complexity. Logarithmic amortized in the absolute value of diff.
iterator_t & operator-=(difference_type diff);
Effects. Move the iterator backward diff elements.
Returns. A reference to *this.
Complexity. Logarithmic amortized in the absolute value of diff.
iterator_t operator+(difference_type diff) const;
Returns. A copy of the iterator moved forward diff elements.
Complexity. Logarithmic amortized in the absolute value of diff.
iterator_t operator-(difference_type diff) const;
Returns. A copy of the iterator moved backward diff elements.
Complexity. Logarithmic amortized in the absolute value of diff.
difference_type operator-(iterator_t const & other) const;
Returns. A distance between the specified iterator.
Complexity. Constant.
iterator_t & move_before_segment();
Effects. Move the iterator to the last element of the previous segment.
Returns. A reference to *this.
Complexity. Constant amortized.
Note. Non-standard extension.
iterator_t & move_before_segment(size_type count);
Effects. Move the iterator to the last element of the previous segment and then move backward count elements.
Returns. A reference to *this.
Complexity. Logarithmic amortized in count.
Note. Non-standard extension.
iterator_t & move_after_segment();
Effects. Move the iterator to the first element of the next segment.
Returns. A reference to *this.
Complexity. Constant amortized.
Note. Non-standard extension.
iterator_t & move_after_segment(size_type count);
Effects. Move the iterator to the first element of the next segment and then move forward count elements.
Complexity. Logarithmic amortized in count.
Note. Non-standard extension.
iterator_t before_segment() const;
Returns. A copy of the iterator moved to the last element of the previous segment.
Complexity. Constant amortized.
Note. Non-standard extension.
iterator_t after_segment() const;
Returns. A copy of the iterator moved to the last element of the previous segment and then move backward count elements.
Complexity. Logarithmic amortized in count.
Note. Non-standard extension.
iterator_t before_segment(size_type count) const;
Returns. A copy of the iterator moved to the last element of the previous segment.
Complexity. Constant amortized.
Note. Non-standard extension.
iterator_t after_segment(size_type count) const;
Returns. A copy of the iterator to the first element of the next segment and then move forward count elements.
Complexity. Logarithmic amortized in count.
Note. Non-standard extension.
bool operator!=(iterator_t const & other) const;
Returns. False if both iterators point to the same element. True otherwise.
Complexity. Constant.
bool operator==(iterator_t const & other) const;
Returns. True if both iterators point to the same element. False otherwise.
Complexity. Constant.
bool operator<(iterator_t const & other) const;
Returns. True if *this points to an element before other. False otherwise.
Complexity. Constant.
bool operator>(iterator_t const & other) const;
Returns. True if *this points to an element after other. False otherwise.
Complexity. Constant.
bool operator<=(iterator_t const & other) const;
Returns. True if *this points to the same element or before other. False otherwise.
Complexity. Constant.
bool operator>=(iterator_t const & other) const;
Returns. True if *this points to the same element or after other. False otherwise.
Complexity. Constant.