3.1.1. allocator.hpp

Full path: allocator/allocator.hpp

template<typename Alloc>
concept Allocator

Requires CopyConstructible<Alloc>.

Associated Types

using perm = typename Alloc::perm

The type of permutations that Alloc allocates.

Requires Permutation<perm>.

using pointer = typename Alloc::pointer
using const_pointer = typename Alloc::const_pointer

Pointer-like types returned and accepted by the allocator.

Requires NullablePointer<pointer>, NullablePointer<const_pointer>.

Notation

Alloc alloc
const Alloc cAlloc
pointer ptr
const_pointer cPtr
const UPerm cp

A Permutation.

Valid Expressions

  • *ptr, type perm&.

  • *cPtr, type const perm&.

  • cAlloc.degree(), convertible to an integer type, returning the degree of permutations allocated by the allocator.

  • alloc.make(), returning a pointer to a new permutation. Its value is unspecified, and may not be safe to read.

  • alloc.make_identity(), returning a pointer to a new permutation initialized to be the identity permutation.

  • alloc.copy(cp), returning a pointer to a new permutation initialized to be a copy of the given permutation.

  • alloc.release(cPtr), gives a permutation back to the allocator. Permutations must be released by the same allocator or a copy of the allocator they were allocated by.