13template<
typename T, T v>
14struct integral_constant {
15 constexpr static T value = v;
17 using type = integral_constant;
18 constexpr operator T() const noexcept {
return value; }
19 constexpr auto operator()() const noexcept -> T {
return value; }
27 using propagate_on_container_move_assignment = integral_constant<bool, true>;
29 constexpr allocator() noexcept = default;
32 constexpr allocator(allocator<U> const&) noexcept {}
34 constexpr ~allocator() =
default;
36 [[nodiscard]]
constexpr auto allocate(
size_t count) ->
T* {
38 return static_cast<T*
>(::operator
new(
count *
sizeof(
T)));
40 if constexpr (
alignof(
T) >
alignof(
void*)) {
41 return static_cast<T*
>(::operator
new(
count *
sizeof(
T), std::align_val_t {
alignof(
T) }));
43 return static_cast<T*
>(::operator
new(
count *
sizeof(
T)));
47 constexpr void deallocate(T* typed_pointer,
size_t count) {
50 return ::operator
delete(pointer);
52 if constexpr (
alignof(
T) >
alignof(
void*)) {
53 return ::operator
delete(pointer,
count *
sizeof(
T), std::align_val_t {
alignof(
T) });
55 return ::operator
delete(pointer,
count *
sizeof(
T));
60template<
class T,
class U>
61constexpr auto operator==(allocator<T>
const&, allocator<U>
const&)
noexcept ->
bool {
__CCPP_BEGIN_DECLARATIONS typedef __SIZE_TYPE__ size_t
Definition size_t.h:7
constexpr auto operator==(Duration< Rep1, Period1 > const &a, Duration< Rep2, Period2 > const &b) -> bool
Definition duration.h:108
constexpr auto allocate
Definition allocate.h:26
constexpr auto deallocate
Definition deallocate.h:23
std::allocator< T > StdAllocator
Definition std_allocator.h:69
constexpr auto count
Definition count.h:37
constexpr auto value
Definition value.h:34
std::ptrdiff_t ptrdiff_t
Definition ptrdiff_t.h:12
constexpr auto voidify
Definition voidify.h:13
Definition enable_generate_structed_bindings.h:46