[libc++][spaceship] P1614R2: Removed ops from memory_resource, polymorphic_allocator

Implements parts of P1614R2
- Removed ops from `memory_resource`
- Removed ops from `polymorphic_allocator`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D152629
This commit is contained in:
Hristo Hristov
2023-06-10 23:31:17 +03:00
parent c8c28ac5ca
commit 6c34aab3ff
4 changed files with 15 additions and 5 deletions

View File

@@ -55,9 +55,11 @@ Section,Description,Dependencies,Assignee,Complete
| `[allocator.globals] <https://wg21.link/allocator.globals>`_,| remove ops `allocator <https://reviews.llvm.org/D152612>`_,None,Hristo Hristov,|In Progress|
| `[unique.ptr.special] <https://wg21.link/unique.ptr.special>`_,| `unique_ptr <https://reviews.llvm.org/D130838>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
| `[util.smartptr.shared.cmp] <https://wg21.link/util.smartptr.shared.cmp>`_,| `shared_ptr <https://reviews.llvm.org/D130852>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
| `[mem.res.syn] <https://wg21.link/mem.res.syn>`_,|,None,Unassigned,|Not Started|
| `[mem.res.eq] <https://wg21.link/mem.res.eq>`_,| remove ops `memory_resource`,None,Unassigned,|Not Started|
| `[mem.poly.allocator.eq] <https://wg21.link/mem.poly.allocator.eq>`_,| remove ops `polymorphic_allocator`,None,Unassigned,|Not Started|
"| `[mem.res.syn] <https://wg21.link/mem.res.syn>`_
| `[mem.res.eq] <https://wg21.link/mem.res.eq>`_
| `[mem.poly.allocator.eq] <https://wg21.link/mem.poly.allocator.eq>`_","|
| remove ops `memory_resource <https://reviews.llvm.org/D152629>`_
| remove ops `polymorphic_allocator <https://reviews.llvm.org/D152629>`_",None,Hristo Hristov,|Complete|
"| `[allocator.adaptor.syn] <https://wg21.link/allocator.adaptor.syn>`_
| `[scoped.adaptor.operators] <https://wg21.link/scoped.adaptor.operators>`_",| remove ops `scoped_allocator_adaptor`,None,Unassigned,|Not Started|
"| `[functional.syn] <https://wg21.link/functional.syn>`_
1 Section Description Dependencies Assignee Complete
55 | `[queue.syn] <https://wg21.link/queue.syn>`_ | `[queue.ops] <https://wg21.link/queue.ops>`_ | `queue <https://reviews.llvm.org/D146066>`_ None Hristo Hristov |Complete|
56 | `[stack.syn] <https://wg21.link/stack.syn>`_ | `[stack.ops] <https://wg21.link/stack.ops>`_ | `stack <https://reviews.llvm.org/D146094>`_ None Hristo Hristov |Complete|
57 | `[queue.ops] <https://wg21.link/queue.ops>`_ - `5.8 Clause 23: Iterators library <https://wg21.link/p1614r2#clause-23-iterators-library>`_ | `queue <https://reviews.llvm.org/D146066>`_ None Hristo Hristov |Complete|
58 | `[stack.ops] <https://wg21.link/stack.ops>`_ | `[iterator.synopsis] <https://wg21.link/iterator.synopsis>`_ | `stack <https://reviews.llvm.org/D146094>`_ | None Hristo Hristov Unassigned |Complete| |Not Started|
59 - `5.8 Clause 23: Iterators library <https://wg21.link/p1614r2#clause-23-iterators-library>`_ | `[reverse.iter.cmp] <https://wg21.link/reverse.iter.cmp>`_ | `reverse_iterator <https://reviews.llvm.org/D113695>`_ None Mikhail Maltsev |Complete|
60 | `[iterator.synopsis] <https://wg21.link/iterator.synopsis>`_ | `[move.iterator] <https://wg21.link/move.iterator>`_ | `[move.iter.op.comp] <https://wg21.link/move.iter.op.comp>`_ | | `move_iterator <https://reviews.llvm.org/D117656>`_ None Unassigned Arthur O'Dwyer |Not Started| |Complete|
61 | `[common.iterator] <https://wg21.link/common.iterator>`_ | `[common.iter.cmp] <https://wg21.link/common.iter.cmp>`_ | remove ops `common_iterator` None Unassigned |Not Started|
62 | `[counted.iterator] <https://wg21.link/counted.iterator>`_ | `[counted.iter.cmp] <https://wg21.link/counted.iter.cmp>`_ | `counted_iterator <https://reviews.llvm.org/D106205>`_ None Zoe Carver |Complete|
63 | `[reverse.iter.cmp] <https://wg21.link/reverse.iter.cmp>`_ | `[unreachable.sentinel] <https://wg21.link/unreachable.sentinel>`_ | `[unreachable.sentinel.cmp] <https://wg21.link/common.iter.cmp>`_ | `reverse_iterator <https://reviews.llvm.org/D113695>`_ | `unreachable_sentinel_t` None Mikhail Maltsev Unassigned |Complete| |Not Started|
64 | `[move.iterator] <https://wg21.link/move.iterator>`_ | `[move.iter.op.comp] <https://wg21.link/move.iter.op.comp>`_ | `[istream.iterator] <https://wg21.link/istream.iterator>`_ | `[istream.iterator.ops] <https://wg21.link/istream.iterator.ops>`_ | `move_iterator <https://reviews.llvm.org/D117656>`_ | remove ops `istream_iterator` None Arthur O'Dwyer Unassigned |Complete| |Not Started|
65 | `[common.iterator] <https://wg21.link/common.iterator>`_ | `[common.iter.cmp] <https://wg21.link/common.iter.cmp>`_ | `[istreambuf.iterator] <https://wg21.link/istreambuf.iterator>`_ | `[istreambuf.iterator.ops] <https://wg21.link/istreambuf.iterator.ops>`_ | remove ops `common_iterator` | remove ops `istreambuf_iterator` None Unassigned |Not Started|

View File

@@ -55,10 +55,14 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const memory_resource& __lhs, const
return &__lhs == &__rhs || __lhs.is_equal(__rhs);
}
# if _LIBCPP_STD_VER <= 17
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
return !(__lhs == __rhs);
}
# endif
// [mem.res.global]
[[__gnu__::__returns_nonnull__]] _LIBCPP_FUNC_VIS memory_resource* get_default_resource() noexcept;

View File

@@ -207,12 +207,16 @@ operator==(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<
return *__lhs.resource() == *__rhs.resource();
}
# if _LIBCPP_STD_VER <= 17
template <class _Tp, class _Up>
inline _LIBCPP_HIDE_FROM_ABI bool
operator!=(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<_Up>& __rhs) noexcept {
return !(__lhs == __rhs);
}
# endif
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD

View File

@@ -22,7 +22,7 @@ namespace std::pmr {
bool operator==(const memory_resource& a,
const memory_resource& b) noexcept;
bool operator!=(const memory_resource& a,
const memory_resource& b) noexcept;
const memory_resource& b) noexcept; // removed in C++20
template <class Tp> class polymorphic_allocator;
@@ -31,7 +31,7 @@ namespace std::pmr {
const polymorphic_allocator<T2>& b) noexcept;
template <class T1, class T2>
bool operator!=(const polymorphic_allocator<T1>& a,
const polymorphic_allocator<T2>& b) noexcept;
const polymorphic_allocator<T2>& b) noexcept; // removed in C++20
// Global memory resources
memory_resource* set_default_resource(memory_resource* r) noexcept;