cptr::nonnull_ptr::nonnull_ptr

Constructors

Synopses

Declared in <cptr/ptr.hpp>

Derived to base, or to a cv-qualified or void pointee. Copies the offset (and is constexpr) unless the base sits at a non-zero offset.

template<class U>
requires (std::is_convertible_v<U*, T*> && !std::is_same_v<U, T>)
constexpr
nonnull_ptr(nonnull_ptr<U, Cage> const& other) noexcept;
» more...

Null is not a valid value.

nonnull_ptr(std::nullptr_t value) = delete;
» more...

Compress p, which must be in the cage and must not be null (checked like the cage check: in debug builds, or always with CPTR_CHECKED).

nonnull_ptr(T* p) noexcept;
» more...