[libcxx-commits] [PATCH] D151248: [libc++][spaceship][NFC] Improved consistency - removed `inline` specifier for `operator<=>`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 24 07:08:20 PDT 2023


H-G-Hristov created this revision.
Herald added a subscriber: yaxunl.
Herald added a project: All.
H-G-Hristov published this revision for review.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Removed `inline` specifier for consistency as discussed in D148416 <https://reviews.llvm.org/D148416> previously.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151248

Files:
  libcxx/include/deque
  libcxx/include/forward_list
  libcxx/include/list
  libcxx/include/map


Index: libcxx/include/map
===================================================================
--- libcxx/include/map
+++ libcxx/include/map
@@ -1737,12 +1737,9 @@
 
 #else // #if _LIBCPP_STD_VER <= 17
 
-template<class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI
-__synth_three_way_result<pair<const _Key, _Tp>>
-operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x,
-            const map<_Key, _Tp, _Compare, _Allocator>& __y)
-{
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
+operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
     return std::lexicographical_compare_three_way(
         __x.begin(),
         __x.end(),
@@ -2351,12 +2348,10 @@
 
 #else // #if _LIBCPP_STD_VER <= 17
 
-template<class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI
-__synth_three_way_result<pair<const _Key, _Tp>>
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
 operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
-            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
-{
+            const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
     return std::lexicographical_compare_three_way(
         __x.begin(),
         __x.end(),
Index: libcxx/include/list
===================================================================
--- libcxx/include/list
+++ libcxx/include/list
@@ -2345,11 +2345,9 @@
 
 #else // _LIBCPP_STD_VER <= 17
 
-template<class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI
-__synth_three_way_result<_Tp>
-operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y)
-{
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y) {
     return std::lexicographical_compare_three_way(
         __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
 }
Index: libcxx/include/forward_list
===================================================================
--- libcxx/include/forward_list
+++ libcxx/include/forward_list
@@ -1774,12 +1774,9 @@
 
 #else // #if _LIBCPP_STD_VER <= 17
 
-template<class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI
-__synth_three_way_result<_Tp>
-operator<=>(const forward_list<_Tp, _Allocator>& __x,
-            const forward_list<_Tp, _Allocator>& __y)
-{
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+operator<=>(const forward_list<_Tp, _Allocator>& __x, const forward_list<_Tp, _Allocator>& __y) {
     return std::lexicographical_compare_three_way(
         __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
 }
Index: libcxx/include/deque
===================================================================
--- libcxx/include/deque
+++ libcxx/include/deque
@@ -2602,11 +2602,9 @@
 
 #else // _LIBCPP_STD_VER <= 17
 
-template<class _Tp, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI
-__synth_three_way_result<_Tp>
-operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
-{
+template <class _Tp, class _Allocator>
+_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
+operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
     return std::lexicographical_compare_three_way(
         __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151248.524854.patch
Type: text/x-patch
Size: 3678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230524/07d2ca83/attachment.bin>


More information about the libcxx-commits mailing list