VCCC  2024.05
VisualCamp Common C++ library
iterator

Iterators. More...

Detailed Description

Modules

 ranges::advance
 advances an iterator by given distance or to a given bound
 
 ranges::iter_move
 casts the result of dereferencing an object to its associated rvalue reference type
 
 LegacyBidirectionalIterator
 
 LegacyForwardIterator
 
 LegacyInputIterator
 
 LegacyIterator
 
 LegacyRandomAccessIterator
 
 ranges::next
 increment an iterator by a given distance or to a bound
 
 ranges::prev
 decrement an iterator by a given distance or to a bound
 
 projected
 helper template for specifying the constraints on algorithms that accept projections
 

Classes

class  basic_const_iterator< Iter >
 
struct  common_type< basic_const_iterator< T >, U >
 
struct  common_type< T, basic_const_iterator< U > >
 
struct  common_type< basic_const_iterator< T >, basic_const_iterator< U > >
 
struct  bidirectional_iterator< I >
 specifies that a forward_iterator is a bidirectional iterator, supporting movement backwards More...
 
class  common_iterator< I, S >
 
struct  incrementable_traits< common_iterator< I, S > >
 
struct  cxx20_iterator_traits< common_iterator< I, S > >
 
struct  contiguous_iterator< I >
 specifies that a random_access_iterator is a contiguous iterator, referring to elements that are contiguous in memory More...
 
class  counted_iterator< I >
 
struct  cxx20_iterator_traits< counted_iterator< I > >
 
struct  default_sentinel_t
 
struct  forward_iterator< I >
 specifies that an input_iterator is a forward iterator, supporting equality comparison and multi-pass More...
 
struct  incrementable< T >
 
struct  incrementable_traits< I >
 computes the difference type of a weakly_incrementable type More...
 
struct  indirect_binary_predicate< F, I1, I2 >
 specifies that a callable type, when invoked with the result of dereferencing two indirectly_readable types, satisfies predicate More...
 
struct  indirect_equivalence_relation< F, I1, I2 >
 
struct  indirect_result< F, Is >
 
struct  indirect_strict_weak_order< F, I1, I2 >
 specifies that a callable type, when invoked with the result of dereferencing two indirectly_readable types, satisfies strict_weak_order More...
 
struct  indirect_unary_predicate< F, I >
 specifies that a callable type, when invoked with the result of dereferencing an indirectly_readable type, satisfies predicate More...
 
struct  indirectly_comparable< I1, I2, Comp, Proj1, Proj2 >
 specifies that the values referenced by two indirectly_readable types can be compared More...
 
struct  indirectly_copyable< In, Out >
 specifies that values may be copied from an indirectly_readable type to an indirectly_writable type More...
 
struct  indirectly_copyable_storable< In, Out >
 specifies that values may be copied from an indirectly_readable type to an indirectly_writable type and that the copy may be performed via an intermediate object More...
 
struct  indirectly_movable< In, Out >
 specifies that values may be moved from an indirectly_readable type to an indirectly_writable type More...
 
struct  indirectly_movable_storable< In, Out >
 specifies that values may be moved from an indirectly_readable type to an indirectly_writable type and that the move may be performed via an intermediate object More...
 
struct  indirectly_readable< In >
 
struct  indirectly_readable_traits< I >
 
struct  indirectly_regular_unary_invocable< F, I >
 specifies that a callable type can be invoked with the result of dereferencing an indirectly_readable type More...
 
struct  indirectly_swappable< I1, I2 >
 
struct  indirectly_unary_invocable< F, I >
 specifies that a callable type can be invoked with the result of dereferencing an indirectly_readable type More...
 
struct  indirectly_writable< Out, T >
 specifies that a value can be written to an iterator's referenced object More...
 
struct  input_iterator< I >
 specifies that a type is an input iterator, that is, its referenced values can be read and it can be both pre- and post-incremented More...
 
struct  input_or_output_iterator< I >
 specifies that objects of a type can be incremented and dereferenced More...
 
struct  iter_common_reference< T >
 
struct  iter_const_reference< T >
 
struct  iter_difference< T >
 
struct  iter_key< T >
 
struct  iter_mapped< T >
 
struct  iter_reference< T >
 
struct  iter_rvalue_reference< T >
 
struct  iter_val< T >
 
struct  iter_value< T >
 
struct  contiguous_iterator_tag
 
struct  iterator_ignore
 
struct  mergeable< I1, I2, Out, Comp, Proj1, Proj2 >
 
struct  disable_sized_sentinel_for< std::move_iterator< Iterator1 >, std::move_iterator< Iterator2 > >
 
struct  cxx20_iterator_traits< std::move_iterator< Iter > >
 
class  move_sentinel< S >
 
struct  output_iterator< I, T >
 specifies that a type is an output iterator for a given value type, that is, values of that type can be written to it and it can be both pre- and post-incremented More...
 
struct  permutable< I >
 
struct  random_access_iterator< I >
 specifies that a bidirectional_iterator is a random-access iterator, supporting advancement in constant time and subscripting More...
 
struct  disable_sized_sentinel_for< std::reverse_iterator< I1 >, std::reverse_iterator< I2 > >
 
struct  cxx20_iterator_traits< std::reverse_iterator< Iter > >
 
struct  sentinel_for< S, I >
 
struct  sized_sentinel_for< S, I >
 specifies that the - operator can be applied to an iterator and a sentinel to calculate their difference in constant time More...
 
struct  sortable< I, Comp, Proj >
 
struct  unreachable_sentinel_t
 sentinel that always compares unequal to any weakly_incrementable type More...
 
struct  weakly_incrementable< I >
 

Typedefs

template<typename I >
using const_iterator = std::enable_if_t< input_iterator< I >::value, std::conditional_t< detail::constant_iterator< I >::value, I, basic_const_iterator< I > > >
 
template<typename S >
using const_sentinel = std::enable_if_t< semiregular< S >::value, std::conditional_t< input_iterator< S >::value, const_iterator< S >, S > >
 
template<typename F , typename... Is>
using indirect_result_t = typename indirect_result< F, Is... >::type
 
template<typename T >
using iter_common_reference_t = typename iter_common_reference< T >::type
 Computes the common reference type of T. This is the common reference type between its reference type and an lvalue reference to its value type. More...
 
template<typename T >
using iter_const_reference_t = typename iter_const_reference< T >::type
 
template<typename T >
using iter_difference_t = typename iter_difference< T >::type
 Computes the difference type of T More...
 
template<typename T >
using iter_key_t = typename iter_key< T >::type
 
template<typename T >
using iter_mapped_t = typename iter_mapped< T >::type
 
template<typename T >
using iter_reference_t = typename iter_reference< T >::type
 
template<typename T >
using iter_rvalue_reference_t = typename iter_rvalue_reference< T >::type
 
template<typename T >
using iter_val_t = typename iter_val< T >::type
 
template<typename T >
using iter_value_t = typename iter_value< T >::type
 
using input_iterator_tag = std::input_iterator_tag
 
using output_iterator_tag = std::output_iterator_tag
 
using forward_iterator_tag = std::forward_iterator_tag
 
using bidirectional_iterator_tag = std::bidirectional_iterator_tag
 
using random_access_iterator_tag = std::random_access_iterator_tag
 

Functions

template<typename I , std::enable_if_t< input_iterator< I >::value, int > = 0>
constexpr const_iterator< I > make_const_iterator (I it)
 
template<typename S , std::enable_if_t< semiregular< S >::value, int > = 0>
constexpr const_sentinel< S > make_const_sentinel (S s)
 
template<typename ForwardIt >
VCCC_CONSTEXPR_AFTER_CXX20 void destroy (ForwardIt first, ForwardIt last)
 
template<class T >
constexpr T * to_address (T *p) noexcept
 
template<class T >
constexpr auto to_address (const T &p) noexcept
 
template<typename To , typename From , std::enable_if_t< conjunction< std::is_integral< To >, std::is_integral< From >>::value, int > = 0>
constexpr To saturate_cast (From x) noexcept
 

Variables

constexpr VCCC_INLINE_OR_STATIC default_sentinel_t default_sentinel {}
 
constexpr VCCC_INLINE_OR_STATIC detail_iter_swap::iter_swap_niebloid iter_swap {}
 
constexpr VCCC_INLINE_OR_STATIC unreachable_sentinel_t unreachable_sentinel {}
 

Typedef Documentation

◆ bidirectional_iterator_tag

using bidirectional_iterator_tag = std::bidirectional_iterator_tag

◆ const_iterator

using const_iterator = std::enable_if_t< input_iterator<I>::value, std::conditional_t< detail::constant_iterator<I>::value, I, basic_const_iterator<I> > >

◆ const_sentinel

using const_sentinel = std::enable_if_t< semiregular<S>::value, std::conditional_t< input_iterator<S>::value, const_iterator<S>, S > >

◆ forward_iterator_tag

using forward_iterator_tag = std::forward_iterator_tag

◆ indirect_result_t

using indirect_result_t = typename indirect_result<F, Is...>::type

◆ input_iterator_tag

using input_iterator_tag = std::input_iterator_tag

◆ iter_common_reference_t

◆ iter_const_reference_t

using iter_const_reference_t = typename iter_const_reference<T>::type

◆ iter_difference_t

using iter_difference_t = typename iter_difference<T>::type

Computes the difference type of T. If cxx20_iterator_traits<remove_cvref_t<T>> is not specialized, then iter_difference_t<T> is incrementable_traits<remove_cvref_t<T>>::difference_type. Otherwise, it is cxx20_iterator_traits<remove_cvref_t<T>>::difference_type

◆ iter_key_t

using iter_key_t = typename iter_key<T>::type
See also
std::iter_key_t

◆ iter_mapped_t

using iter_mapped_t = typename iter_mapped<T>::type

◆ iter_reference_t

using iter_reference_t = typename iter_reference<T>::type

◆ iter_rvalue_reference_t

◆ iter_val_t

using iter_val_t = typename iter_val<T>::type
See also
std::iter_val_t

◆ iter_value_t

using iter_value_t = typename iter_value<T>::type

◆ output_iterator_tag

using output_iterator_tag = std::output_iterator_tag

◆ random_access_iterator_tag

using random_access_iterator_tag = std::random_access_iterator_tag

Function Documentation

◆ destroy()

VCCC_CONSTEXPR_AFTER_CXX20 void vccc::destroy ( ForwardIt  first,
ForwardIt  last 
)

◆ make_const_iterator()

constexpr const_iterator<I> vccc::make_const_iterator ( it)
constexpr

◆ make_const_sentinel()

constexpr const_sentinel<S> vccc::make_const_sentinel ( s)
constexpr

◆ saturate_cast()

constexpr To vccc::saturate_cast ( From  x)
inlineconstexprnoexcept

◆ to_address() [1/2]

constexpr auto vccc::to_address ( const T &  p)
constexprnoexcept

◆ to_address() [2/2]

constexpr T* vccc::to_address ( T *  p)
constexprnoexcept

Variable Documentation

◆ default_sentinel

constexpr VCCC_INLINE_OR_STATIC default_sentinel_t default_sentinel {}
constexpr

◆ iter_swap

◆ unreachable_sentinel

constexpr VCCC_INLINE_OR_STATIC unreachable_sentinel_t unreachable_sentinel {}
constexpr