47 #if __cpp_impl_three_way_comparison
48 auto operator<=>(
const Handle&)
const =
default;
78 explicit operator bool() const noexcept {
79 return _impl !=
nullptr;
86 operator uintptr_t() const noexcept {
87 return reinterpret_cast<uintptr_t
>(
_impl);
94 operator void*()
const noexcept {
A generic handle class that manages a pointer to an object of type T.
Handle(T &impl) noexcept
Constructs a Handle object from an instance of type T.
Handle() noexcept
Default constructor. Initializes the handle with a null pointer.
Handle(const Handle &)=default
Copy constructor. Creates a new Handle object from another Handle object.
Handle & operator=(const Handle &) &&=delete
Copy assignment operator for rvalue references is deleted.
Handle & operator=(Handle &&) &&=delete
Move assignment operator for rvalue references is deleted.
T * _impl
A pointer to the referenced implementation of type T.
Handle(Handle &&)=default
Move constructor. Transfers ownership from another Handle object.
Handle & operator=(Handle &&) &=default
Move assignment operator. Transfers ownership from another Handle object.
Handle & operator=(const Handle &) &=default
Comparison operator (<=>) for comparing two Handle objects.