33 template <auto Callable,
typename T>
35 requires std::integral<T>;
36 { Callable } -> std::predicate<T>;
39 template <std::
integral T>
40 T make_pointer_number(
const void* pointer)
noexcept {
41 return static_cast<T
>(
reinterpret_cast<std::uintptr_t
>(pointer));
50 template <std::
integral T>
51 constexpr bool is_valid_handle_value(T value)
noexcept {
52 return value != 0 && value != -1;
61 template <handle_stroage_type T = std::uintptr_t,
typename Mapped = T,
62 auto Validator = &is_valid_handle_value<Mapped>>
63 requires handle_validator_type<Validator, Mapped>
74 requires std::is_pointer_v<U>
83 constexpr bool operator==(
const basic_native_handle&)
const noexcept =
default;
84 constexpr auto operator<=>(
const basic_native_handle&)
const noexcept =
default;
90 explicit constexpr operator bool() const noexcept {
91 return Validator(
static_cast<Mapped
>(value_));
99 requires std::is_pointer_v<U>
100 operator U() const noexcept {
101 return reinterpret_cast<U
>(value_);
107 constexpr operator Mapped() const noexcept {
108 return static_cast<Mapped
>(value_);
115 using native_handle = basic_native_handle<>;
Stores a platform-dependent handle.
Definition native_handle.hpp:64
basic_native_handle(U value) noexcept
Constructs the object from a pointer.
Definition native_handle.hpp:75
constexpr basic_native_handle(Mapped value) noexcept
Constructs the object from a mapped number.
Definition native_handle.hpp:81
Definition native_handle.hpp:31
Definition native_handle.hpp:34