Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2958,14 +2958,16 @@
The following exposition-only concept defines
the minimal requirements on an Allocator type.
\begin{codeblock}
template<class Alloc>
concept @\defexposconcept{simple-allocator}@ =
requires(Alloc alloc, size_t n) {
{ *alloc.allocate(n) } -> @\libconcept{same_as}@<typename Alloc::value_type&>;
{ alloc.deallocate(alloc.allocate(n), n) };
} &&
@\libconcept{copy_constructible}@<Alloc> &&
@\libconcept{equality_comparable}@<Alloc>;
namespace std {
template<class Alloc>
concept @\defexposconcept{simple-allocator}@ =
requires(Alloc alloc, size_t n) {
{ *alloc.allocate(n) } -> @\libconcept{same_as}@<typename Alloc::value_type&>;
{ alloc.deallocate(alloc.allocate(n), n) };
} &&
@\libconcept{copy_constructible}@<Alloc> &&
@\libconcept{equality_comparable}@<Alloc>;
}
\end{codeblock}
A type \tcode{Alloc} models \exposconcept{simple-allocator}
if it meets the requirements of \ref{allocator.requirements.general}.
Expand Down