Skip to content

Commit 58c6c79

Browse files
authored
Merge 2023-11 LWG Motion 11
P2868 Remove deprecated typedef from std::allocator
2 parents 04c32f2 + 2ad97be commit 58c6c79

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

source/compatibility.tex

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,28 @@
107107
// changed according to the global C locale
108108
\end{codeblock}
109109

110+
\rSec2[diff.cpp23.depr]{\ref{depr}: compatibility features}
111+
112+
\nodiffref
113+
\change
114+
Remove the type alias \tcode{allocator<T>::is_always_equal}.
115+
\rationale
116+
Non-empty allocator classes derived from \tcode{allocator} needed to explicitly
117+
define an \tcode{is_always_equal} member type so that \tcode{allocator_traits}
118+
would not use the one from the allocator base class.
119+
\effect
120+
It is simpler to correctly define an allocator class with an allocator base
121+
class. For example:
122+
\begin{codeblock}
123+
template <class T>
124+
struct MyAlloc : allocator<T> {
125+
int tag;
126+
};
127+
128+
static_assert(!allocator_traits<MyAlloc<int>>::is_always_equal); // Error in \CppXXIII{},
129+
// OK in \CppXXVI{}
130+
\end{codeblock}
131+
110132
\rSec2[diff.cpp23.containers]{\ref{containers}: containers library}
111133

112134
\diffref{span.overview}

source/future.tex

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,22 +1383,6 @@
13831383
is the same as the value of the \libheader{cerrno} macro
13841384
shown in the above synopsis.
13851385

1386-
\rSec1[depr.default.allocator]{The default allocator}
1387-
1388-
\pnum
1389-
The following member is defined in addition to those
1390-
specified in \ref{default.allocator}:
1391-
1392-
\indexlibrarymember{is_always_equal}{allocator}%
1393-
\begin{codeblock}
1394-
namespace std {
1395-
template<class T> class allocator {
1396-
public:
1397-
using is_always_equal = true_type;
1398-
};
1399-
}
1400-
\end{codeblock}
1401-
14021386
\rSec1[depr.mem.poly.allocator.mem]{Deprecated \tcode{polymorphic_allocator} member function}
14031387

14041388
\pnum

source/xrefdelta.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
% P2864R2 Remove deprecated arithmetic conversions
2323
\removedxref{depr.arith.conv.enum}
2424

25+
% P2870R3 Remove deprecated typedef from `std::allocator`
26+
\removedxref{depr.default.allocator}
27+
2528
% P2874R2 Mandating Annex D
2629
\removedxref{depr.res.on.required}
2730

0 commit comments

Comments
 (0)