cptr::basic_ptr::basic_ptr

Compresses p, which must be null or point into the cage. Implicit for ptr, explicit for strict_ptr. A template on U only so that a literal 0 picks the constructor above instead of being ambiguous; it takes any U* that converts implicitly to T*.

Synopsis

Declared in <cptr/ptr.hpp>

template<class U>
requires std::is_convertible_v<U*, T*>
explicit(Strict)
basic_ptr(U* p) noexcept;

Parameters

NameDescription
pThe object to construct from