76 explicit operator bool() const noexcept {
77 return _impl !=
nullptr;
84 operator uintptr_t() const noexcept {
85 return reinterpret_cast<uintptr_t
>(
_impl);
92 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.
auto operator<=>(const Handle &) const =default
Comparison operator (<=>) for comparing two Handle objects.
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
Copy assignment operator. Copies the handle from another Handle object.