Tp* allocate(size_t n);
void deallocate(Tp* p, size_t n);
Requires: p был выделен из ресурса памяти x, равного *memory_rsrc, с использованием x.allocate(n * sizeof(Tp), alignof(Tp)).
template <class T, class... Args>
void construct(T* p, Args&&... args);
Requires: Конструкция Uses-allocator T с распределителем resource() (см. [allocator.uses.construction]) И аргументами конструктора std::forward<Args>(args)... сформирована правильно. [ Note: Конструкция Uses-allocator всегда хорошо сформирована для типов, которые не используют распределители. ] — end note
Effects: Создайте T объект в хранилище, адрес которого представлен конструкцией p uses-allocator с resource() аргументами распределителя и конструктора std::forward<Args>(args)....
template <class T1, class T2, class... Args1, class... Args2>
void construct(pair<T1,T2>* p, piecewise_construct_t,
tuple<Args1...> x, tuple<Args2...> y);
[ Note: Этот метод и construct последующие методы являются перегрузками для кусочного построения пар ([pairs.pair]). ] — end note
Effects: Позвольте xprime быть tuple построенным из x согласно соответствующему правилу из следующего списка. [ Note: Следующее описание можно резюмировать как создание pair<T1, T2> объекта в хранилище, адрес которого представлен p, как если бы с помощью отдельной конструкции uses-allocator с allocator resource() ([allocator.uses.construction]), p->first использующей элементы x и p->second элементы y. ] — end note
Если uses_allocator_v<T1,memory_resource*> есть
и
есть ,
значит, есть .
false
is_constructible_v<T1,Args1...> true
xprime x
В противном случае, если uses_allocator_v<T1,memory_resource*> есть
и
есть ,
то есть .
true
is_constructible_v<T1,allocator_arg_t,memory_resource*,Args1...> true
xprime tuple_cat(make_tuple(allocator_arg, resource()), std::move(x))
В противном случае, если uses_allocator_v<T1,memory_resource*> есть
и
есть ,
то есть .
true
is_constructible_v<T1,Args1...,memory_resource*> true
xprime tuple_cat(std::move(x), make_tuple(resource()))
В противном случае программа плохо сформирована.
Позвольте yprime быть кортежем, построенным y согласно соответствующему правилу из следующего списка:
Если uses_allocator_v<T2,memory_resource*> есть
и
есть ,
значит, есть .
false
is_constructible_v<T2,Args2...> true
yprime y
В противном случае, если uses_allocator_v<T2,memory_resource*> есть
и
есть ,
то есть .
true
is_constructible_v<T2,allocator_arg_t,memory_resource*,Args2...> true
yprime tuple_cat(make_tuple(allocator_arg, resource()), std::move(y))
В противном случае, если uses_allocator_v<T2,memory_resource*> есть
и
есть ,
то
есть .
true
is_constructible_v<T2,Args2...,memory_resource*> true
yprime tuple_cat(std::move(y), make_tuple(resource()))
В противном случае программа плохо сформирована.
Затем, используя piecewise_construct, xprimeи yprime в качестве аргументов конструктора, эта функция создает pair<T1, T2> объект в хранилище, адрес которого представлен как p.
template <class T1, class T2>
void construct(pair<T1,T2>* p);
template <class T1, class T2, class U, class V>
void construct(pair<T1,T2>* p, U&& x, V&& y);
Effects: Эквивалентен:
construct(p, piecewise_construct, forward_as_tuple(std::forward<U>(x)), forward_as_tuple(std::forward<V>(y)));
template <class T1, class T2, class U, class V>
void construct(pair<T1,T2>* p, const pair<U, V>& pr);
Effects: Эквивалентен:
construct(p, piecewise_construct, forward_as_tuple(pr.first), forward_as_tuple(pr.second));
template <class T1, class T2, class U, class V>
void construct(pair<T1,T2>* p, pair<U, V>&& pr);
Effects: Эквивалентен:
construct(p, piecewise_construct, forward_as_tuple(std::forward<U>(pr.first)), forward_as_tuple(std::forward<V>(pr.second)));
template <class T>
void destroy(T* p);
polymorphic_allocator select_on_container_copy_construction() const;
memory_resource* resource() const;