cptr::ptr_with_payload

A compressed pointer and a 32-bit payload in 8 bytes, e.g. a node pointer and a count, hash or flags.

Synopsis

Declared in <cptr/pack.hpp>

template<
    class T,
    class Cage = default_cage>
class ptr_with_payload;

Member Functions

NameDescription
ptr_with_payload [constructor]Constructors
get The pointer, or nullptr. Constant-evaluable when null.
payload The payload.
set Replaces the pointer (null or in the cage), keeping the payload.
set_payload Replaces the payload, keeping the pointer.

Friends

NameDescription
cptr::operator==Same pointer and same payload.