iterator_support

The contents of this module can be included with the header hpx/modules/iterator_support.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/iterator_support.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

Defines

HPX_ITERATOR_TRAVERSAL_TAG_NS
namespace hpx
namespace iterators
struct bidirectional_traversal_tag : public hpx::iterators::forward_traversal_tag

Subclassed by hpx::iterators::random_access_traversal_tag

struct forward_traversal_tag : public hpx::iterators::single_pass_traversal_tag

Subclassed by hpx::iterators::bidirectional_traversal_tag

struct incrementable_traversal_tag : public hpx::iterators::no_traversal_tag

Subclassed by hpx::iterators::single_pass_traversal_tag

struct no_traversal_tag

Subclassed by hpx::iterators::incrementable_traversal_tag

struct single_pass_traversal_tag : public hpx::iterators::incrementable_traversal_tag

Subclassed by hpx::iterators::forward_traversal_tag

namespace traits

Typedefs

template<typename Traversal>
using pure_traversal_tag = HPX_ITERATOR_TRAVERSAL_TAG_NS::iterators::pure_traversal_tag<Traversal>
template<typename Traversal>
using pure_traversal_tag_t = typename pure_traversal_tag<Traversal>::type
template<typename Iterator>
using pure_iterator_traversal = HPX_ITERATOR_TRAVERSAL_TAG_NS::iterators::pure_iterator_traversal<Iterator>
template<typename Iterator>
using pure_iterator_traversal_t = typename pure_iterator_traversal<Iterator>::type
template<typename Cat>
using iterator_category_to_traversal = HPX_ITERATOR_TRAVERSAL_TAG_NS::iterators::iterator_category_to_traversal<Cat>
template<typename Cat>
using iterator_category_to_traversal_t = typename iterator_category_to_traversal<Cat>::type
template<typename Iterator>
using iterator_traversal = HPX_ITERATOR_TRAVERSAL_TAG_NS::iterators::iterator_traversal<Iterator>
template<typename Iterator>
using iterator_traversal_t = typename iterator_traversal<Iterator>::type

Variables

template<typename Traversal>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::pure_traversal_tag_v=            pure_traversal_tag<Traversal>::value
template<typename Iterator>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::pure_iterator_traversal_v=            pure_iterator_traversal<Iterator>::value
template<typename Cat>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::iterator_category_to_traversal_v=            iterator_category_to_traversal<Cat>::value
template<typename Iterator>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::iterator_traversal_v=            iterator_traversal<Iterator>::value
template<typename Incrementable, typename CategoryOrTraversal, typename Difference>
class counting_iterator<Incrementable, CategoryOrTraversal, Difference, typename std::enable_if<std::is_integral<Incrementable>::value>::type> : public hpx::util::iterator_adaptor<counting_iterator<Incrementable, CategoryOrTraversal, Difference>, Incrementable, Incrementable, traversal, Incrementable const&, difference>

Public Functions

counting_iterator()
counting_iterator(counting_iterator const &rhs)
counting_iterator(Incrementable x)

Private Types

template<>
using base_type = typename detail::counting_iterator_base<Incrementable, CategoryOrTraversal, Difference>::type

Private Functions

template<typename Iterator>
bool equal(Iterator const &rhs) const
void increment()
void decrement()
template<typename Distance>
void advance(Distance n)
base_type::reference dereference() const
template<typename OtherIncrementable>
base_type::difference_type distance_to(counting_iterator<OtherIncrementable, CategoryOrTraversal, Difference> const &y) const

Friends

friend iterator_core_access
namespace hpx
namespace util

Functions

template<typename Incrementable>
counting_iterator<Incrementable> make_counting_iterator(Incrementable x)
template<typename Incrementable, typename CategoryOrTraversal, typename Difference, typename Enable>
class counting_iterator

Public Functions

counting_iterator()
counting_iterator(counting_iterator const &rhs)
counting_iterator(Incrementable x)

Private Types

template<>
using base_type = typename detail::counting_iterator_base<Incrementable, CategoryOrTraversal, Difference>::type

Private Functions

base_type::reference dereference() const

Friends

friend hpx::util::iterator_core_access
template<typename Incrementable, typename CategoryOrTraversal, typename Difference>
class counting_iterator<Incrementable, CategoryOrTraversal, Difference, typename std::enable_if<std::is_integral<Incrementable>::value>::type> : public hpx::util::iterator_adaptor<counting_iterator<Incrementable, CategoryOrTraversal, Difference>, Incrementable, Incrementable, traversal, Incrementable const&, difference>

Public Functions

counting_iterator()
counting_iterator(counting_iterator const &rhs)
counting_iterator(Incrementable x)

Private Types

template<>
using base_type = typename detail::counting_iterator_base<Incrementable, CategoryOrTraversal, Difference>::type

Private Functions

template<typename Iterator>
bool equal(Iterator const &rhs) const
void increment()
void decrement()
template<typename Distance>
void advance(Distance n)
base_type::reference dereference() const
template<typename OtherIncrementable>
base_type::difference_type distance_to(counting_iterator<OtherIncrementable, CategoryOrTraversal, Difference> const &y) const

Friends

friend hpx::util::iterator_core_access
namespace hpx
namespace util

Functions

template<typename Generator>
generator_iterator<Generator> make_generator_iterator(Generator &gen)
template<typename Generator>
class generator_iterator : public hpx::util::iterator_facade<generator_iterator<Generator>, Generator::result_type, std::forward_iterator_tag, Generator::result_type const&>

Public Functions

generator_iterator()
generator_iterator(Generator *g)
void increment()
Generator::result_type const &dereference() const
bool equal(generator_iterator const &y) const

Private Types

template<>
using base_type = iterator_facade<generator_iterator<Generator>, typename Generator::result_type, std::forward_iterator_tag, typename Generator::result_type const&>

Private Members

Generator *m_g
Generator::result_type m_value
namespace hpx
namespace util
template<typename Derived, typename Base, typename Value = void, typename Category = void, typename Reference = void, typename Difference = void, typename Pointer = void>
class iterator_adaptor : public hpx::util::iterator_facade<Derived, value_type, iterator_category, reference_type, difference_type, void>

Subclassed by hpx::util::counting_iterator< Incrementable, CategoryOrTraversal, Difference, typename std::enable_if< std::is_integral< Incrementable >::value >::type >

Public Types

typedef Base base_type

Public Functions

iterator_adaptor()
iterator_adaptor(Base const &iter)
Base const &base() const

Protected Types

typedef hpx::util::detail::iterator_adaptor_base<Derived, Base, Value, Category, Reference, Difference, Pointer>::type base_adaptor_type
typedef iterator_adaptor<Derived, Base, Value, Category, Reference, Difference, Pointer> iterator_adaptor_

Protected Functions

Base const &base_reference() const
Base &base_reference()

Private Functions

base_adaptor_type::reference dereference() const
template<typename OtherDerived, typename OtherIterator, typename V, typename C, typename R, typename D, typename P>
bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D, P> const &x) const
template<typename DifferenceType>
void advance(DifferenceType n)
void increment()
template<typename Iterator = Base, typename Enable = typename std::enable_if<traits::is_bidirectional_iterator<Iterator>::value>::type>
void decrement()
template<typename OtherDerived, typename OtherIterator, typename V, typename C, typename R, typename D, typename P>
base_adaptor_type::difference_type distance_to(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D, P> const &y) const

Private Members

Base iterator_

Friends

friend hpx::util::hpx::util::iterator_core_access

Defines

HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type)
namespace hpx
namespace util

Functions

template<typename Derived, typename T, typename Category, typename Reference, typename Distance, typename Pointer>
util::detail::postfix_increment_result<Derived, typename Derived::value_type, typename Derived::reference>::type operator++(iterator_facade<Derived, T, Category, Reference, Distance, Pointer> &i, int)
hpx::util::HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(inline, bool)
hpx::util::HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(inline, !, bool)
hpx::util::HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(inline)
hpx::util::HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(inline, <=, bool)
hpx::util::HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(inline, >=, bool)
hpx::util::HPX_UTIL_ITERATOR_FACADE_INTEROP_HEAD(inline, -, typename std::iterator_traits< Derived2 >::difference_type)
template<typename Derived, typename T, typename Category, typename Reference, typename Distance, typename Pointer>
Derived operator+(iterator_facade<Derived, T, Category, Reference, Distance, Pointer> const &it, typename Derived::difference_type n)
template<typename Derived, typename T, typename Category, typename Reference, typename Distance, typename Pointer>
Derived operator+(typename Derived::difference_type n, iterator_facade<Derived, T, Category, Reference, Distance, Pointer> const &it)
class iterator_core_access

Public Static Functions

template<typename Iterator1, typename Iterator2>
static bool equal(Iterator1 const &lhs, Iterator2 const &rhs)
template<typename Iterator>
static void increment(Iterator &it)
template<typename Iterator>
static void decrement(Iterator &it)
template<typename Reference, typename Iterator>
static Reference dereference(Iterator const &it)
template<typename Iterator, typename Distance>
static void advance(Iterator &it, Distance n)
template<typename Iterator1, typename Iterator2>
static std::iterator_traits<Iterator1>::difference_type distance_to(Iterator1 const &lhs, Iterator2 const &rhs)
template<typename Derived, typename T, typename Category, typename Reference = T&, typename Distance = std::ptrdiff_t, typename Pointer = void>
struct iterator_facade : public hpx::util::detail::iterator_facade_base<Derived, T, Category, T&, std::ptrdiff_t, void>

Subclassed by hpx::util::iterator_adaptor< Derived, Base, Value, Category, Reference, Difference, Pointer >

Public Functions

iterator_facade()

Protected Types

typedef iterator_facade<Derived, T, Category, Reference, Distance, Pointer> iterator_adaptor_

Private Types

typedef detail::iterator_facade_base<Derived, T, Category, Reference, Distance, Pointer> base_type
namespace hpx
namespace util

Functions

template<typename Range, typename Iterator = typename traits::range_iterator<Range>::type, typename Sentinel = typename traits::range_iterator<Range>::type>
std::enable_if<traits::is_range<Range>::value, iterator_range<Iterator, Sentinel>>::type make_iterator_range(Range &r)
template<typename Range, typename Iterator = typename traits::range_iterator<Range const>::type, typename Sentinel = typename traits::range_iterator<Range const>::type>
std::enable_if<traits::is_range<Range>::value, iterator_range<Iterator, Sentinel>>::type make_iterator_range(Range const &r)
template<typename Iterator, typename Sentinel = Iterator>
std::enable_if<traits::is_iterator<Iterator>::value, iterator_range<Iterator, Sentinel>>::type make_iterator_range(Iterator iterator, Sentinel sentinel)
template<typename Iterator, typename Sentinel = Iterator>
class iterator_range

Public Functions

iterator_range()
iterator_range(Iterator iterator, Sentinel sentinel)
Iterator begin() const
Iterator end() const
std::ptrdiff_t size() const
bool empty() const

Private Members

Iterator _iterator
Sentinel _sentinel
namespace hpx
namespace util
namespace range_adl

Functions

template<typename C, typename Iterator = typename detail::iterator<C>::type>
constexpr Iterator begin(C &c)
template<typename C, typename Iterator = typename detail::iterator<C const>::type>
constexpr Iterator begin(C const &c)
template<typename C, typename Sentinel = typename detail::sentinel<C>::type>
constexpr Sentinel end(C &c)
template<typename C, typename Sentinel = typename detail::sentinel<C const>::type>
constexpr Sentinel end(C const &c)
template<typename C, typename Iterator = typename detail::iterator<C const>::type, typename Sentinel = typename detail::sentinel<C const>::type>
constexpr std::size_t size(C const &c)
template<typename C, typename Iterator = typename detail::iterator<C const>::type, typename Sentinel = typename detail::sentinel<C const>::type>
constexpr bool empty(C const &c)
namespace hpx
namespace util

Functions

template<typename Transformer, typename Iterator>
transform_iterator<Iterator, Transformer> make_transform_iterator(Iterator const &it, Transformer const &f)
template<typename Transformer, typename Iterator>
transform_iterator<Iterator, Transformer> make_transform_iterator(Iterator const &it)
template<typename Iterator, typename Transformer, typename Reference, typename Value, typename Category, typename Difference>
class transform_iterator

Public Functions

transform_iterator()
transform_iterator(Iterator const &it)
transform_iterator(Iterator const &it, Transformer const &f)
template<typename OtherIterator, typename OtherTransformer, typename OtherReference, typename OtherValue, typename OtherCategory, typename OtherDifference>
transform_iterator(transform_iterator<OtherIterator, OtherTransformer, OtherReference, OtherValue, OtherCategory, OtherDifference> const &t, typename std::enable_if<std::is_convertible<OtherIterator, Iterator>::value && std::is_convertible<OtherTransformer, Transformer>::value && std::is_convertible<OtherCategory, Category>::value && std::is_convertible<OtherDifference, Difference>::value>::type* = nullptr)
Transformer const &transformer() const

Private Types

typedef detail::transform_iterator_base<Iterator, Transformer, Reference, Value, Category, Difference>::type base_type

Private Functions

base_type::reference dereference() const

Private Members

Transformer transformer_

Friends

friend hpx::util::hpx::util::iterator_core_access
template<typename ...Ts>
class zip_iterator<hpx::tuple<Ts...>> : public hpx::util::detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<hpx::tuple<Ts...>>>

Public Functions

zip_iterator()
zip_iterator(Ts const&... vs)
zip_iterator(hpx::tuple<Ts...> &&t)
zip_iterator(zip_iterator const &other)
zip_iterator(zip_iterator &&other)
zip_iterator &operator=(zip_iterator const &other)
zip_iterator &operator=(zip_iterator &&other)
template<typename ...Ts_>
std::enable_if<std::is_assignable<typename zip_iterator::iterator_tuple_type&, typename zip_iterator<Ts_...>::iterator_tuple_type&&>::value, zip_iterator&>::type operator=(zip_iterator<Ts_...> const &other)
template<typename ...Ts_>
std::enable_if<std::is_assignable<typename zip_iterator::iterator_tuple_type&, typename zip_iterator<Ts_...>::iterator_tuple_type&&>::value, zip_iterator&>::type operator=(zip_iterator<Ts_...> &&other)

Private Types

template<>
using base_type = detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<hpx::tuple<Ts...>>>
template<typename F, typename ...Ts>
struct lift_zipped_iterators<F, util::zip_iterator<Ts...>>

Public Types

typedef util::zip_iterator<Ts...>::iterator_tuple_type tuple_type
typedef hpx::tuple<typename element_result_of<typename F::template apply<Ts>, Ts>::type...> result_type

Public Static Functions

template<std::size_t... Is, typename ...Ts_>
static result_type call(util::index_pack<Is...>, hpx::tuple<Ts_...> const &t)
template<typename ...Ts_>
static result_type call(util::zip_iterator<Ts_...> const &iter)
namespace hpx
namespace traits
namespace functional
template<typename F, typename ...Ts>
struct lift_zipped_iterators<F, util::zip_iterator<Ts...>>

Public Types

typedef util::zip_iterator<Ts...>::iterator_tuple_type tuple_type
typedef hpx::tuple<typename element_result_of<typename F::template apply<Ts>, Ts>::type...> result_type

Public Static Functions

template<std::size_t... Is, typename ...Ts_>
static result_type call(util::index_pack<Is...>, hpx::tuple<Ts_...> const &t)
template<typename ...Ts_>
static result_type call(util::zip_iterator<Ts_...> const &iter)
namespace util

Functions

template<typename ...Ts>
zip_iterator<typename std::decay<Ts>::type...> make_zip_iterator(Ts&&... vs)
template<typename ...Ts>
class zip_iterator : public hpx::util::detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<Ts...>>

Public Functions

zip_iterator()
zip_iterator(Ts const&... vs)
zip_iterator(hpx::tuple<Ts...> &&t)
zip_iterator(zip_iterator const &other)
zip_iterator(zip_iterator &&other)
zip_iterator &operator=(zip_iterator const &other)
zip_iterator &operator=(zip_iterator &&other)
template<typename ...Ts_>
std::enable_if<std::is_assignable<typename zip_iterator::iterator_tuple_type&, typename zip_iterator<Ts_...>::iterator_tuple_type&&>::value, zip_iterator&>::type operator=(zip_iterator<Ts_...> const &other)
template<typename ...Ts_>
std::enable_if<std::is_assignable<typename zip_iterator::iterator_tuple_type&, typename zip_iterator<Ts_...>::iterator_tuple_type&&>::value, zip_iterator&>::type operator=(zip_iterator<Ts_...> &&other)

Private Types

typedef detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<Ts...>> base_type
template<typename ...Ts>
class zip_iterator<hpx::tuple<Ts...>> : public hpx::util::detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<hpx::tuple<Ts...>>>

Public Functions

zip_iterator()
zip_iterator(Ts const&... vs)
zip_iterator(hpx::tuple<Ts...> &&t)
zip_iterator(zip_iterator const &other)
zip_iterator(zip_iterator &&other)
zip_iterator &operator=(zip_iterator const &other)
zip_iterator &operator=(zip_iterator &&other)
template<typename ...Ts_>
std::enable_if<std::is_assignable<typename zip_iterator::iterator_tuple_type&, typename zip_iterator<Ts_...>::iterator_tuple_type&&>::value, zip_iterator&>::type operator=(zip_iterator<Ts_...> const &other)
template<typename ...Ts_>
std::enable_if<std::is_assignable<typename zip_iterator::iterator_tuple_type&, typename zip_iterator<Ts_...>::iterator_tuple_type&&>::value, zip_iterator&>::type operator=(zip_iterator<Ts_...> &&other)

Private Types

template<>
using base_type = detail::zip_iterator_base<hpx::tuple<Ts...>, zip_iterator<hpx::tuple<Ts...>>>
namespace hpx
namespace traits

Typedefs

template<typename Iter>
using is_iterator_t = typename is_iterator<Iter>::type
template<typename Iter>
using is_output_iterator_t = typename is_output_iterator<Iter>::type
template<typename Iter>
using is_input_iterator_t = typename is_input_iterator<Iter>::type
template<typename Iter>
using is_forward_iterator_t = typename is_forward_iterator<Iter>::type
template<typename Iter>
using is_bidirectional_iterator_t = typename is_bidirectional_iterator<Iter>::type
template<typename Iter>
using is_random_access_iterator_t = typename is_random_access_iterator<Iter>::type
template<typename Iter>
using is_segmented_iterator_t = typename is_segmented_iterator<Iter>::type
template<typename Iter>
using is_segmented_local_iterator_t = typename is_segmented_local_iterator<Iter>::type
template<typename Iter>
using is_zip_iterator_t = typename is_zip_iterator<Iter>::type
template<typename Iter>
using is_contiguous_iterator_t = typename is_contiguous_iterator<Iter>::type
template<typename Iter>
using iter_value_t = typename std::iterator_traits<Iter>::value_type
template<typename Iter>
using iter_ref_t = typename std::iterator_traits<Iter>::reference

Variables

template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_iterator_v = is_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_output_iterator_v=is_output_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_input_iterator_v=is_input_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_forward_iterator_v=is_forward_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_bidirectional_iterator_v=is_bidirectional_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_random_access_iterator_v=is_random_access_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_segmented_iterator_v=is_segmented_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_segmented_local_iterator_v=is_segmented_local_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_zip_iterator_v=is_zip_iterator<Iter>::value
template<typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_contiguous_iterator_v=is_contiguous_iterator<Iter>::value
namespace hpx
namespace traits
template<typename R>
struct range_traits<R, true> : public std::iterator_traits<util::detail::iterator<R>::type>

Public Types

typedef util::detail::iterator<R>::type iterator_type
typedef util::detail::sentinel<R>::type sentinel_type
namespace hpx
namespace traits

Variables

template<typename Sent, typename Iter>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::disable_sized_sentinel_for = false

Functions

template<typename Iter, typename ValueType, typename Enable = std::enable_if_t<hpx::traits::is_forward_iterator<Iter>::value>>
bool operator==(Iter it, sentinel<ValueType> s)
template<typename Iter, typename ValueType, typename Enable = std::enable_if_t<hpx::traits::is_forward_iterator<Iter>::value>>
bool operator==(sentinel<ValueType> s, Iter it)
template<typename Iter, typename ValueType, typename Enable = std::enable_if_t<hpx::traits::is_forward_iterator<Iter>::value>>
bool operator!=(Iter it, sentinel<ValueType> s)
template<typename Iter, typename ValueType, typename Enable = std::enable_if_t<hpx::traits::is_forward_iterator<Iter>::value>>
bool operator!=(sentinel<ValueType> s, Iter it)
template<typename ValueType>
struct sentinel

Public Functions

sentinel(ValueType stop_value)
ValueType get_stop() const

Private Members

ValueType stop
template<typename Value>
struct iterator

Public Types

template<>
using difference_type = std::ptrdiff_t
template<>
using value_type = Value
template<>
using iterator_category = std::forward_iterator_tag
template<>
using pointer = Value const*
template<>
using reference = Value const&

Public Functions

iterator(Value initialState)
virtual Value operator*() const
virtual Value operator->() const
iterator &operator++()
iterator operator++(int)
iterator &operator--()
iterator operator--(int)
virtual Value operator[](difference_type n) const
iterator &operator+=(difference_type n)
iterator operator+(difference_type n) const
iterator &operator-=(difference_type n)
iterator operator-(difference_type n) const
bool operator==(const iterator &that) const
bool operator!=(const iterator &that) const
bool operator<(const iterator &that) const
bool operator<=(const iterator &that) const
bool operator>(const iterator &that) const
bool operator>=(const iterator &that) const

Protected Attributes

Value state