5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_POINTER_TRAITS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_POINTER_TRAITS_HPP_
27template <
class Po
interLike>
31template <
class Po
interLike>
35template <
class Po
interLike,
class = arene::base::constra
ints<>>
41template <
class Po
interLike>
44 arene::base::constraints<enable_if_t<has_element_type_v<PointerLike>>>> {
46 using type =
typename PointerLike::element_type;
52template <
template <
class,
class...>
class PointerLike,
class T,
class... Args>
54 PointerLike<T, Args...>,
55 arene::base::constraints<enable_if_t<!has_element_type_v<PointerLike<T, Args...>>>>> {
61template <
class Po
interTraitsElementType>
67template <
class Po
interLike>
72template <
class Po
interLike>
78template <
class Po
interLike,
class = arene::base::constra
ints<>>
87template <
class Po
interLike>
90 arene::base::constraints<enable_if_t<arene::base::substitution_succeeds<require_difference_type, PointerLike>>>> {
92 using type =
typename PointerLike::difference_type;
96template <
class Po
interLike,
class U>
100template <
class Po
interLike,
class U>
104template <
class T,
class U,
class = arene::base::constra
ints<>>
110template <
class T,
class U>
113 using type =
typename T::template rebind<U>;
119template <
template <
class,
class...>
class PointerLike,
class T,
class U,
class... Args>
121 PointerLike<T, Args...>,
123 arene::base::constraints<enable_if_t<!has_rebind_v<PointerLike<T, Args...>, U>>>> {
125 using type = PointerLike<U, Args...>;
139template <
class ElementType>
143template <
class Po
interLike,
class = arene::base::constra
ints<>>
147template <
class Po
interLike>
168 )
noexcept(
noexcept(PointerLike::pointer_to(element))) ->
pointer {
169 return PointerLike::pointer_to(element);
T * pointer
The type of the pointer.
Definition pointer_traits.hpp:192
U * rebind
A pointer to U.
Definition pointer_traits.hpp:203
T element_type
The type of the element that is pointed to.
Definition pointer_traits.hpp:195
static constexpr auto pointer_to(pointer_traits_detail::pointer_to_arg_t< element_type > element) noexcept -> pointer
Return a pointer to the given element.
Definition pointer_traits.hpp:209
ptrdiff_t difference_type
The type used to represent the difference between two pointers.
Definition pointer_traits.hpp:198
PointerLike pointer
The type of the PointerLike.
Definition pointer_traits.hpp:151
static constexpr auto pointer_to(pointer_to_arg_t< element_type > element) noexcept(noexcept(PointerLike::pointer_to(element))) -> pointer
Return a pointer to the given element.
Definition pointer_traits.hpp:167
typename pointer_traits_rebind< PointerLike, U >::type rebind
The pointer type rebound to hold an element of type U.
Definition pointer_traits.hpp:162
typename pointer_traits_element_type< PointerLike >::type element_type
The type of the element that is pointed to.
Definition pointer_traits.hpp:154
typename pointer_traits_difference_type< PointerLike >::type difference_type
The type used to represent the difference between two PointerLike instances.
Definition pointer_traits.hpp:157
Define pointer_traits as empty when is_element_type_defined_v<PointerLike> is false.
Definition pointer_traits.hpp:144
An unspecified type to use as the input type for pointer_to.
Definition pointer_traits.hpp:129
unspecified()=delete
Deleted constructor to prevent any accidental use.
provides a uniform interface to pointer-like types
Definition pointer_traits.hpp:185
Public export header for the constraints subpackage.
constexpr bool substitution_succeeds
Determines if a template can be instantiated successfully, similar to C++20's requires clause.
Definition accumulate.hpp:36
Definition pointer_traits.hpp:24
conditional_t< is_void_v< ElementType >, unspecified, ElementType > & pointer_to_arg_t
Determine the input argument type of pointer_traits<PointerLike>::pointer_to.
Definition pointer_traits.hpp:140
typename PointerLike::difference_type require_difference_type
Require that PointerLike has a type member named difference_type.
Definition pointer_traits.hpp:73
typename PointerLike::element_type require_element_type
Require that PointerLike has a type member named element_type.
Definition pointer_traits.hpp:28
constexpr bool is_element_type_defined_v
true if an element_type was determined for PointerLike
constexpr bool has_rebind_v
true if PointerLike has an alias template member named rebind
typename PointerLike::template rebind< U > require_rebind
Require that PointerLike has an alias template member named rebind.
Definition pointer_traits.hpp:97
constexpr bool has_element_type_v
true if PointerLike has a type member named element_type
typename PointerTraitsElementType::type require_type
Require that PointerTraitsElementType has a type member named type.
Definition pointer_traits.hpp:62
::ptrdiff_t ptrdiff_t
A type suitable for holding the difference between two pointers.
Definition cstddef.hpp:31
typename conditional< Condition, TrueType, FalseType >::type conditional_t
Helper template alias for selecting types based on a condition. If the supplied Condition is true the...
Definition conditional.hpp:57
constexpr auto addressof(T &value) noexcept -> T *
Obtains the actual address of the object or function arg, even in presence of overloaded operator&.
Definition addressof.hpp:24
typename PointerLike::difference_type type
The resulting type.
Definition pointer_traits.hpp:92
Determine the difference_type to expose in the pointer_traits.
Definition pointer_traits.hpp:79
ptrdiff_t type
The resulting type.
Definition pointer_traits.hpp:81
typename PointerLike::element_type type
The resulting type.
Definition pointer_traits.hpp:46
T type
The resulting type.
Definition pointer_traits.hpp:57
Determine the element_type to expose in pointer_traits.
Definition pointer_traits.hpp:36
PointerLike< U, Args... > type
The resulting type.
Definition pointer_traits.hpp:125
typename T::template rebind< U > type
The resulting type.
Definition pointer_traits.hpp:113
Determine the rebind to expose in the pointer_traits.
Definition pointer_traits.hpp:105