20 Memory management library [mem]

20.3 Pointer tagging [ptrtag]

20.3.1 Pointer tagging limits [ptrtag.bits]

inline constexpr unsigned max_pointer_bits_available = see below;
The implementation-defined limit of usable bits for pointer tagging.
Remarks: A non-zero value of max_pointer_bits_available indicates that non-arithmetic operations on invalid pointers with implementation-defined behavior ([basic.compound]) preserve sufficient information to guarantee that for an object tp of a type TP that is a specialization of tagged_pointer_pair and a pointer value q, that is a result of applying a sequence of such operations to the result of tp.tagged(), tp is equal to TP​::​from_tagged(q).
constexpr unsigned pointer_bits_available(size_t alignment);
Constant When: Precondition is met.
Preconditions: alignment is a power of two.
Returns: The implementation-defined number of unused bits in a pointer pointing to a hypothetical object with alignment alignment.
Recommended practice: The result is non-zero for alignment values larger than 1.
[Note 1: 
On most platforms, the value is the minimum of countr_zero(alignment) and max_pointer_bits_available.
— end note]