cptr::make

Allocate and construct a T inside the cage, as new T(args...) does on the heap; free it with destroy().

Synopsis

Declared in <cptr/ptr.hpp>

template<
    class T,
    class Cage = default_cage,
    class... Args>
ptr<T, Cage>
make(Args&&... args);

Description

Throws std::bad_alloc when the cage is full. If T's constructor throws, the memory is freed and the exception propagates.

Return Value

The usual compressed pointer: converts implicitly from and to T*.