cptr::nonnull_ptr::operator basic_ptr<U, Cage, S>

Converts implicitly to a nullable ptr or strict_ptr to U, where T* converts implicitly to U*. The pointer is already in the cage, so strict_ptr accepts it implicitly too.

Synopsis

Declared in <cptr/ptr.hpp>

template<
    class U,
    bool S>
requires std::is_convertible_v<T*, U*>
constexpr
operator basic_ptr<U, Cage, S>() const noexcept;

Return Value

A nullable pointer to a T inside Cage, stored in 4 bytes. Use it as ptr<T> or strict_ptr<T>, declared below.