From 2ad97bea1bd37af3aca2402ad753fa347a4c2f03 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Sun, 12 Nov 2023 10:44:26 -0800 Subject: [PATCH] P2868 Remove deprecated typedef from std::allocator --- source/compatibility.tex | 22 ++++++++++++++++++++++ source/future.tex | 16 ---------------- source/xrefdelta.tex | 3 +++ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index ee11079b85..9d07605a73 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -107,6 +107,28 @@ // changed according to the global C locale \end{codeblock} +\rSec2[diff.cpp23.depr]{\ref{depr}: compatibility features} + +\nodiffref +\change +Remove the type alias \tcode{allocator::is_always_equal}. +\rationale +Non-empty allocator classes derived from \tcode{allocator} needed to explicitly +define an \tcode{is_always_equal} member type so that \tcode{allocator_traits} +would not use the one from the allocator base class. +\effect +It is simpler to correctly define an allocator class with an allocator base +class. For example: +\begin{codeblock} +template +struct MyAlloc : allocator { + int tag; +}; + +static_assert(!allocator_traits>::is_always_equal); // Error in \CppXXIII{}, + // OK in \CppXXVI{} +\end{codeblock} + \rSec2[diff.cpp23.containers]{\ref{containers}: containers library} \diffref{span.overview} diff --git a/source/future.tex b/source/future.tex index 60133e942f..ec4614ca59 100644 --- a/source/future.tex +++ b/source/future.tex @@ -1383,22 +1383,6 @@ is the same as the value of the \libheader{cerrno} macro shown in the above synopsis. -\rSec1[depr.default.allocator]{The default allocator} - -\pnum -The following member is defined in addition to those -specified in \ref{default.allocator}: - -\indexlibrarymember{is_always_equal}{allocator}% -\begin{codeblock} -namespace std { - template class allocator { - public: - using is_always_equal = true_type; - }; -} -\end{codeblock} - \rSec1[depr.mem.poly.allocator.mem]{Deprecated \tcode{polymorphic_allocator} member function} \pnum diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index 69f63d4a4f..b18caf9bea 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -22,6 +22,9 @@ % P2864R2 Remove deprecated arithmetic conversions \removedxref{depr.arith.conv.enum} +% P2870R3 Remove deprecated typedef from `std::allocator` +\removedxref{depr.default.allocator} + % P2874R2 Mandating Annex D \removedxref{depr.res.on.required}