5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ITERATOR_INCREMENTABLE_TRAITS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ITERATOR_INCREMENTABLE_TRAITS_HPP_
14#include "arene/base/stdlib_choice/cstddef.hpp"
15#include "arene/base/stdlib_choice/declval.hpp"
16#include "arene/base/stdlib_choice/enable_if.hpp"
17#include "arene/base/stdlib_choice/is_integral.hpp"
18#include "arene/base/stdlib_choice/is_object.hpp"
19#include "arene/base/stdlib_choice/make_signed.hpp"
25namespace incrementable_traits_detail {
30template <
typename Itr,
typename = constra
ints<>>
31class incrementable_traits_impl {};
35template <
typename Itr>
36using use_difference_type =
typename Itr::difference_type;
40template <
typename Itr>
45template <
typename Itr>
49 using difference_type =
typename Itr::difference_type;
54template <
typename Itr>
59template <
typename Itr>
64template <
typename Itr,
bool = has_subtraction_result_v<Itr>>
65constexpr bool has_integral_subtraction_result_v =
false;
69template <
typename Itr>
70constexpr bool has_integral_subtraction_result_v<Itr, true> = std::is_integral<subtraction_result_t<Itr>>::value;
74template <
typename Itr>
75class incrementable_traits_impl<
88template <typename T, bool = std::is_object<T>::value>
89class incrementable_traits_pointer_specialization {
97class incrementable_traits_pointer_specialization<T, false> {};
113template <
typename Itr>
122class incrementable_traits<T*> :
public incrementable_traits_detail::incrementable_traits_pointer_specialization<T> {};
127template <
typename Itr>
Computes the difference type of an incrementable iterator type.
Definition incrementable_traits.hpp:114
Definition accumulate.hpp:37
constexpr bool substitution_succeeds
Determines if a template can be instantiated successfully, similar to C++20's requires clause.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
typename make_signed< Type >::type make_signed_t
A type alias for the equivalent signed type for integral and enumeration types other than bool.
Definition make_signed.hpp:252
::ptrdiff_t ptrdiff_t
A type suitable for holding the difference between two pointers.
Definition cstddef.hpp:31
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...