cptr::destroy_array

Destroy and free n elements created by make_array(n). n must be the count passed to make_array(), and p the pointer it returned (not a pointer to a base class: as for delete[], that is undefined). Null is a no-op.

Synopsis

Declared in <cptr/ptr.hpp>

template<
    class T,
    class Cage,
    bool Strict>
void
destroy_array(
    basic_ptr<T, Cage, Strict> p,
    std::size_t n) noexcept;

Parameters

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