cptr::ptr_pair

Two compressed pointers in 8 bytes, e.g. a tree node's children or a list node's links.

Synopsis

Declared in <cptr/pack.hpp>

template<
    class A,
    class B = A,
    class Cage = default_cage>
class ptr_pair;

Member Functions

NameDescription
ptr_pair [constructor]Constructors
first The first pointer, or nullptr. Constant-evaluable when null.
second The second pointer, or nullptr. Constant-evaluable when null.
set_first Replaces the first pointer (null or in the cage), keeping the second.
set_second Replaces the second pointer (null or in the cage), keeping the first.

Friends

NameDescription
cptr::operator==Both pointers equal.