20 Memory management library [mem]

20.3 Pointer tagging [ptrtag]

20.3.2 Class template pointer_tag_pair [ptrtag.pair]

20.3.2.3 Support for overaligned pointers [ptrtag.pair.overalign]

template<size_t PromisedAlignment, tagging-compatible-pointee<pointer_type, bits_requested, PromisedAlignment> U> static constexpr pointer_tag_pair from_overaligned(U* p, tag_type t);
Constant When: Preconditions are met.
Preconditions:
  • p is not a pointer past the end of an object ([basic.compound]).
  • p == nullptr || is_sufficiently_aligned<PromisedAlignment>(p) is true.
  • tag-bit-width(t) <= bits_requested is true.
Returns: An object ptp of type pointer_tag_pair such that both ptp.pointer() is equal to p and ptp.tag() is equal to t.
Throws: Nothing.