]> gcc.gnu.org Git - gcc.git/blobdiff - libstdc++-v3/include/debug/multiset.h
libstdc++: Add comparison operators to associative containers
[gcc.git] / libstdc++-v3 / include / debug / multiset.h
index fcbba33947834786f2092f85e77d55a5aadd5eb9..a2d5e717b34460b0cb2169b71a209cf55c2f4def 100644 (file)
@@ -584,7 +584,7 @@ namespace __debug
     multiset(initializer_list<_Key>, _Allocator)
     -> multiset<_Key, less<_Key>, _Allocator>;
 
-#endif
+#endif // deduction guides
 
   template<typename _Key, typename _Compare, typename _Allocator>
     inline bool
@@ -592,6 +592,13 @@ namespace __debug
               const multiset<_Key, _Compare, _Allocator>& __rhs)
     { return __lhs._M_base() == __rhs._M_base(); }
 
+#if __cpp_lib_three_way_comparison
+  template<typename _Key, typename _Compare, typename _Alloc>
+    inline __detail::__synth3way_t<_Key>
+    operator<=>(const multiset<_Key, _Compare, _Alloc>& __lhs,
+               const multiset<_Key, _Compare, _Alloc>& __rhs)
+    { return __lhs._M_base() <=> __rhs._M_base(); }
+#else
   template<typename _Key, typename _Compare, typename _Allocator>
     inline bool
     operator!=(const multiset<_Key, _Compare, _Allocator>& __lhs,
@@ -621,6 +628,7 @@ namespace __debug
     operator>(const multiset<_Key, _Compare, _Allocator>& __lhs,
              const multiset<_Key, _Compare, _Allocator>& __rhs)
     { return __lhs._M_base() > __rhs._M_base(); }
+#endif // three-way comparison
 
   template<typename _Key, typename _Compare, typename _Allocator>
     void
This page took 0.113015 seconds and 5 git commands to generate.