Skip to content

Commit 6c34aab

Browse files
committed
[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
1 parent c8c28ac commit 6c34aab

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

libcxx/docs/Status/SpaceshipProjects.csv

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ Section,Description,Dependencies,Assignee,Complete
5555
| `[allocator.globals] <https://wg21.link/allocator.globals>`_,| remove ops `allocator <https://reviews.llvm.org/D152612>`_,None,Hristo Hristov,|In Progress|
5656
| `[unique.ptr.special] <https://wg21.link/unique.ptr.special>`_,| `unique_ptr <https://reviews.llvm.org/D130838>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
5757
| `[util.smartptr.shared.cmp] <https://wg21.link/util.smartptr.shared.cmp>`_,| `shared_ptr <https://reviews.llvm.org/D130852>`_,[comparisons.three.way],Adrian Vogelsgesang,|Complete|
58-
| `[mem.res.syn] <https://wg21.link/mem.res.syn>`_,|,None,Unassigned,|Not Started|
59-
| `[mem.res.eq] <https://wg21.link/mem.res.eq>`_,| remove ops `memory_resource`,None,Unassigned,|Not Started|
60-
| `[mem.poly.allocator.eq] <https://wg21.link/mem.poly.allocator.eq>`_,| remove ops `polymorphic_allocator`,None,Unassigned,|Not Started|
58+
"| `[mem.res.syn] <https://wg21.link/mem.res.syn>`_
59+
| `[mem.res.eq] <https://wg21.link/mem.res.eq>`_
60+
| `[mem.poly.allocator.eq] <https://wg21.link/mem.poly.allocator.eq>`_","|
61+
| remove ops `memory_resource <https://reviews.llvm.org/D152629>`_
62+
| remove ops `polymorphic_allocator <https://reviews.llvm.org/D152629>`_",None,Hristo Hristov,|Complete|
6163
"| `[allocator.adaptor.syn] <https://wg21.link/allocator.adaptor.syn>`_
6264
| `[scoped.adaptor.operators] <https://wg21.link/scoped.adaptor.operators>`_",| remove ops `scoped_allocator_adaptor`,None,Unassigned,|Not Started|
6365
"| `[functional.syn] <https://wg21.link/functional.syn>`_

libcxx/include/__memory_resource/memory_resource.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,14 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator==(const memory_resource& __lhs, const
5555
return &__lhs == &__rhs || __lhs.is_equal(__rhs);
5656
}
5757

58+
# if _LIBCPP_STD_VER <= 17
59+
5860
inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
5961
return !(__lhs == __rhs);
6062
}
6163

64+
# endif
65+
6266
// [mem.res.global]
6367

6468
[[__gnu__::__returns_nonnull__]] _LIBCPP_FUNC_VIS memory_resource* get_default_resource() noexcept;

libcxx/include/__memory_resource/polymorphic_allocator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,16 @@ operator==(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<
207207
return *__lhs.resource() == *__rhs.resource();
208208
}
209209

210+
# if _LIBCPP_STD_VER <= 17
211+
210212
template <class _Tp, class _Up>
211213
inline _LIBCPP_HIDE_FROM_ABI bool
212214
operator!=(const polymorphic_allocator<_Tp>& __lhs, const polymorphic_allocator<_Up>& __rhs) noexcept {
213215
return !(__lhs == __rhs);
214216
}
215217

218+
# endif
219+
216220
} // namespace pmr
217221

218222
_LIBCPP_END_NAMESPACE_STD

libcxx/include/memory_resource

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace std::pmr {
2222
bool operator==(const memory_resource& a,
2323
const memory_resource& b) noexcept;
2424
bool operator!=(const memory_resource& a,
25-
const memory_resource& b) noexcept;
25+
const memory_resource& b) noexcept; // removed in C++20
2626
2727
template <class Tp> class polymorphic_allocator;
2828
@@ -31,7 +31,7 @@ namespace std::pmr {
3131
const polymorphic_allocator<T2>& b) noexcept;
3232
template <class T1, class T2>
3333
bool operator!=(const polymorphic_allocator<T1>& a,
34-
const polymorphic_allocator<T2>& b) noexcept;
34+
const polymorphic_allocator<T2>& b) noexcept; // removed in C++20
3535
3636
// Global memory resources
3737
memory_resource* set_default_resource(memory_resource* r) noexcept;

0 commit comments

Comments
 (0)