20
Memory management library
[mem]
20.2
Memory
[memory]
20.2.10
The default allocator
[default.allocator]
20.2.10.1
General
[default.allocator.general]
1
#
All specializations of the default allocator meet the allocator completeness requirements (
[allocator.
requirements.
completeness]
)
.
🔗
namespace
std
{
template
<
class
T
>
class
allocator
{
public
:
using
value_type
=
T;
using
size_type
=
size_t;
using
difference_type
=
ptrdiff_t;
using
propagate_on_container_move_assignment
=
true_type;
constexpr
allocator
(
)
noexcept
;
constexpr
allocator
(
const
allocator
&
)
noexcept
;
template
<
class
U
>
constexpr
allocator
(
const
allocator
<
U
>
&
)
noexcept
;
constexpr
~
allocator
(
)
;
constexpr
allocator
&
operator
=
(
const
allocator
&
)
=
default
;
constexpr
T
*
allocate
(
size_t n
)
;
constexpr
allocation_result
<
T
*
>
allocate_at_least
(
size_t n
)
;
constexpr
void
deallocate
(
T
*
p, size_t n
)
;
}
;
}
2
#
allocator_
traits
<
allocator
<
T
>
>
::
is_
always_
equal
::
value
is
true
for any
T
.