Skip to content

Commit

Permalink
P2868 Remove deprecated typedef from std::allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisdairM authored and tkoeppe committed Dec 17, 2023
1 parent 04c32f2 commit bf49b53
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
21 changes: 21 additions & 0 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@
// 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<T>::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 <class T>
struct MyAlloc : allocator<T> {
int tag;
};

static_assert(!allocator_traits<MyAlloc<int>>::is_always_equal); // Error in \CppXXIII{}, OK in \CppXXVI{}
\end{codeblock}

\rSec2[diff.cpp23.containers]{\ref{containers}: containers library}

\diffref{span.overview}
Expand Down
16 changes: 0 additions & 16 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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 T> class allocator {
public:
using is_always_equal = true_type;
};
}
\end{codeblock}

\rSec1[depr.mem.poly.allocator.mem]{Deprecated \tcode{polymorphic_allocator} member function}

\pnum
Expand Down
3 changes: 3 additions & 0 deletions source/xrefdelta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit bf49b53

Please sign in to comment.