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_
8#include "arene/base/constraints.hpp"
9#include "stdlib/include/stdlib_detail/addressof.hpp"
10#include "stdlib/include/stdlib_detail/conditional.hpp"
11#include "stdlib/include/stdlib_detail/cstddef.hpp"
12#include "stdlib/include/stdlib_detail/enable_if.hpp"
13#include "stdlib/include/stdlib_detail/integral_constant.hpp"
14#include "stdlib/include/stdlib_detail/is_void.hpp"
27template <
class PointerLike>
28using require_element_type =
typename PointerLike::element_type;
32constexpr extern bool has_element_type_v = arene::base::substitution_succeeds<require_element_type, PointerLike>;
52template <
template <
class,
class...>
class PointerLike,
class T,
class...
Args>
61template <
class PointerTraitsElementType>
62using require_type =
typename PointerTraitsElementType::type;
72template <
class PointerLike>
73using require_difference_type =
typename PointerLike::difference_type;
96template <
class PointerLike,
class U>
97using require_rebind =
typename PointerLike::
template rebind<U>;
101constexpr extern bool has_rebind_v = arene::base::substitution_succeeds<require_rebind, PointerLike, U>;
110template <
class T,
class U>
119template <
template <
class,
class...>
class PointerLike,
class T,
class U,
class...
Args>
195 using element_type = T;
209 static constexpr auto pointer_to(pointer_traits_detail::pointer_to_arg_t<element_type> element)
noexcept -> pointer {
210 return addressof(element);
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
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
Definition pointer_traits.hpp:24
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
constexpr bool has_element_type_v
true if PointerLike has a type member named element_type
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition result.hpp:1827
Determine the difference_type to expose in the pointer_traits.
Definition pointer_traits.hpp:79
Determine the element_type to expose in pointer_traits.
Definition pointer_traits.hpp:36
Determine the rebind to expose in the pointer_traits.
Definition pointer_traits.hpp:105