]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Test specific feature test macros instead of __cplusplus
authorJonathan Wakely <jwakely@redhat.com>
Wed, 8 Oct 2025 14:24:51 +0000 (15:24 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 14 Oct 2025 14:47:20 +0000 (15:47 +0100)
This changes the associative and unordered containers to check
__glibcxx_node_extract, __glibcxx_generic_associative_lookup, and
__glibcxx_generic_unordered_lookup instead of just checking the value of
__cplusplus.

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h: Check specific feature test macros
instead of checking thevalue of __cplusplus.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_tree.h: Likewise.
* include/bits/unordered_map.h: Likewise.
* include/bits/unordered_set.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/debug/multiset.h: Likewise.
* include/debug/set.h: Likewise.
* include/debug/unordered_map: Likewise.
* include/debug/unordered_set: Likewise.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
14 files changed:
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/unordered_map.h
libstdc++-v3/include/bits/unordered_set.h
libstdc++-v3/include/debug/map.h
libstdc++-v3/include/debug/multimap.h
libstdc++-v3/include/debug/multiset.h
libstdc++-v3/include/debug/set.h
libstdc++-v3/include/debug/unordered_map
libstdc++-v3/include/debug/unordered_set

index b5a71f516f88100139d6948d3497f613106aca09..06cc51ac4a0f4c00158bbce95defafb128f85ac4 100644 (file)
@@ -38,7 +38,7 @@
 #include <bits/enable_special_members.h>
 #include <bits/stl_algobase.h> // fill_n, is_permutation
 #include <bits/stl_function.h> // __has_is_transparent_t
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
 # include <bits/node_handle.h>
 #endif
 
@@ -349,7 +349,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       using size_type = typename __hashtable_base::size_type;
       using difference_type = typename __hashtable_base::difference_type;
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = _Node_handle<_Key, _Value, __node_alloc_type>;
       using insert_return_type = _Node_insert_return<iterator, node_type>;
 #endif
@@ -1931,7 +1931,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     -> const_iterator
     { return const_iterator(_M_locate(__k)); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
   template<typename _Key, typename _Value, typename _Alloc,
           typename _ExtractKey, typename _Equal,
           typename _Hash, typename _RangeHash, typename _Unused,
@@ -1979,7 +1979,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        std::size_t __bkt = _M_bucket_index(__code);
        return const_iterator(_M_find_node_tr(__bkt, __k, __code));
       }
-#endif
+#endif // C++20 __glibcxx_generic_unordered_lookup
 
   template<typename _Key, typename _Value, typename _Alloc,
           typename _ExtractKey, typename _Equal,
@@ -2007,7 +2007,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __result;
     }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
   template<typename _Key, typename _Value, typename _Alloc,
           typename _ExtractKey, typename _Equal,
           typename _Hash, typename _RangeHash, typename _Unused,
@@ -2052,7 +2052,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
        return __result;
       }
-#endif
+#endif // C++20 __glibcxx_generic_unordered_lookup
 
   template<typename _Key, typename _Value, typename _Alloc,
           typename _ExtractKey, typename _Equal,
@@ -2102,7 +2102,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return { __beg, __ite };
     }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
   template<typename _Key, typename _Value, typename _Alloc,
           typename _ExtractKey, typename _Equal,
           typename _Hash, typename _RangeHash, typename _Unused,
@@ -2190,7 +2190,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
        return { __beg, __ite };
       }
-#endif
+#endif // C++20 __glibcxx_generic_unordered_lookup
 
   // Find the node before the one whose key compares equal to k in the bucket
   // bkt. Return nullptr if no node is found.
@@ -2966,7 +2966,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 #pragma GCC diagnostic pop
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
   template<typename, typename, typename> class _Hash_merge_helper { };
 #endif // C++17
 
index 68c23b8e3e71a4e3ae669fa736f65382f0878563..62d66cef6b2e27cecfc338cec672b952c60e4c36 100644 (file)
@@ -1259,7 +1259,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x)
       { return _M_t.find(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x))
@@ -1284,7 +1284,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_t.find(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x))
@@ -1305,7 +1305,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
@@ -1348,7 +1348,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       lower_bound(const key_type& __x)
       { return _M_t.lower_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        lower_bound(const _Kt& __x)
@@ -1373,7 +1373,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       lower_bound(const key_type& __x) const
       { return _M_t.lower_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        lower_bound(const _Kt& __x) const
@@ -1393,7 +1393,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       upper_bound(const key_type& __x)
       { return _M_t.upper_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        upper_bound(const _Kt& __x)
@@ -1413,7 +1413,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       upper_bound(const key_type& __x) const
       { return _M_t.upper_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        upper_bound(const _Kt& __x) const
@@ -1442,7 +1442,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x)
       { return _M_t.equal_range(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -1471,7 +1471,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x) const
@@ -1649,7 +1649,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
 _GLIBCXX_END_NAMESPACE_CONTAINER
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
   // Allow std::map access to internals of compatible maps.
   template<typename _Key, typename _Val, typename _Cmp1, typename _Alloc,
           typename _Cmp2>
index 4ee4a842b314217cbab6887759bdbd5ba697ba3d..b2ae2bae745c1b13369408ff0ac75b88a5b6c04d 100644 (file)
@@ -891,7 +891,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x)
       { return _M_t.find(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x))
@@ -915,7 +915,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_t.find(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x))
@@ -933,7 +933,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_t.count(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
@@ -976,7 +976,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       lower_bound(const key_type& __x)
       { return _M_t.lower_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        lower_bound(const _Kt& __x)
@@ -1001,7 +1001,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       lower_bound(const key_type& __x) const
       { return _M_t.lower_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        lower_bound(const _Kt& __x) const
@@ -1021,7 +1021,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       upper_bound(const key_type& __x)
       { return _M_t.upper_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        upper_bound(const _Kt& __x)
@@ -1041,7 +1041,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       upper_bound(const key_type& __x) const
       { return _M_t.upper_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        upper_bound(const _Kt& __x) const
@@ -1068,7 +1068,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x)
       { return _M_t.equal_range(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -1095,7 +1095,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x) const
@@ -1272,7 +1272,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
 _GLIBCXX_END_NAMESPACE_CONTAINER
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
   // Allow std::multimap access to internals of compatible maps.
   template<typename _Key, typename _Val, typename _Cmp1, typename _Alloc,
           typename _Cmp2>
index 31451abe58e723a615515e3472f1c5ed6c1b2c2a..b6e1bfc424680d0d4f2c56ca1b90af0d58bc06d0 100644 (file)
@@ -773,7 +773,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_t.count(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
@@ -822,7 +822,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_t.find(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        find(const _Kt& __x)
@@ -857,7 +857,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       lower_bound(const key_type& __x) const
       { return _M_t.lower_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        lower_bound(const _Kt& __x)
@@ -887,7 +887,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       upper_bound(const key_type& __x) const
       { return _M_t.upper_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        upper_bound(const _Kt& __x)
@@ -926,7 +926,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -1103,7 +1103,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
 _GLIBCXX_END_NAMESPACE_CONTAINER
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
   // Allow std::multiset access to internals of compatible sets.
   template<typename _Val, typename _Cmp1, typename _Alloc, typename _Cmp2>
     struct
index b65d63195aa23aaaace59d245929b6029ebc038f..f03d9e54d33cf85157ec65227d460a40c06f3eef 100644 (file)
@@ -794,7 +794,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        count(const _Kt& __x) const
@@ -844,7 +844,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_t.find(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        find(const _Kt& __x)
@@ -879,7 +879,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       lower_bound(const key_type& __x) const
       { return _M_t.lower_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        lower_bound(const _Kt& __x)
@@ -909,7 +909,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       upper_bound(const key_type& __x) const
       { return _M_t.upper_bound(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        upper_bound(const _Kt& __x)
@@ -948,7 +948,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -1119,7 +1119,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
 _GLIBCXX_END_NAMESPACE_CONTAINER
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
   // Allow std::set access to internals of compatible sets.
   template<typename _Val, typename _Cmp1, typename _Alloc, typename _Cmp2>
     struct
index 4b7f482e794c804ed6b02dd61d81d17d45a2f835..e78fa1dbfb39a58fa0c8a37a30e414270fc45e09 100644 (file)
@@ -1918,7 +1918,7 @@ namespace __rb_tree
       pair<const_iterator, const_iterator>
       equal_range(const key_type& __k) const;
 
-#if __cplusplus >= 201402L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req = __has_is_transparent_t<_Compare, _Kt>>
        iterator
@@ -2007,7 +2007,7 @@ namespace __rb_tree
            ++__high;
          return { __low, __high };
        }
-#endif
+#endif // __glibcxx_generic_associative_lookup
 
       // Debugging.
       bool
index cc9e2c4d5015cceb37032791fd3b66fc3a9db2a5..b9b2772aaa9e7bba07c0a429f6594f0136fa79d0 100644 (file)
@@ -961,7 +961,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x)
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __x) -> decltype(_M_h._M_find_tr(__x))
@@ -972,7 +972,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __x) const -> decltype(_M_h._M_find_tr(__x))
@@ -994,7 +994,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_h.count(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        count(const _Kt& __x) const -> decltype(_M_h._M_count_tr(__x))
@@ -1034,7 +1034,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x)
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -1046,7 +1046,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x) const
@@ -2039,7 +2039,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x)
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __x) -> decltype(_M_h._M_find_tr(__x))
@@ -2050,7 +2050,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __x) const -> decltype(_M_h._M_find_tr(__x))
@@ -2068,7 +2068,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_h.count(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        count(const _Kt& __x) const -> decltype(_M_h._M_count_tr(__x))
@@ -2106,7 +2106,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x)
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -2118,7 +2118,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x) const
index 5649dd76e1fbb3f1590a9d1644e5bc02007faeb4..29bc49a590af78c68c03f2bca6c65a28ea7571e7 100644 (file)
@@ -744,7 +744,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x)
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __k)
@@ -756,7 +756,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __k) const
@@ -779,7 +779,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_h.count(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        count(const _Kt& __k) const
@@ -820,7 +820,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x)
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __k)
@@ -832,7 +832,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __k) const
@@ -1745,7 +1745,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x)
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __x)
@@ -1757,7 +1757,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       find(const key_type& __x) const
       { return _M_h.find(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        find(const _Kt& __x) const
@@ -1776,7 +1776,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       count(const key_type& __x) const
       { return _M_h.count(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        count(const _Kt& __x) const -> decltype(_M_h._M_count_tr(__x))
@@ -1814,7 +1814,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x)
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x)
@@ -1826,7 +1826,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       equal_range(const key_type& __x) const
       { return _M_h.equal_range(__x); }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt>
        auto
        equal_range(const _Kt& __x) const
index 985a7ac86d3c59565d54029a9a8dd583cce89da5..30469b0587fd0efb8b481a6c8c9af6af250da70d 100644 (file)
@@ -455,7 +455,7 @@ namespace __debug
        }
 #endif // C++17
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
       using insert_return_type = _Node_insert_return<iterator, node_type>;
 
@@ -601,7 +601,7 @@ namespace __debug
       find(const key_type& __x)
       { return iterator(_Base::find(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -614,7 +614,7 @@ namespace __debug
       find(const key_type& __x) const
       { return const_iterator(_Base::find(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -629,7 +629,7 @@ namespace __debug
       lower_bound(const key_type& __x)
       { return iterator(_Base::lower_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -642,7 +642,7 @@ namespace __debug
       lower_bound(const key_type& __x) const
       { return const_iterator(_Base::lower_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -655,7 +655,7 @@ namespace __debug
       upper_bound(const key_type& __x)
       { return iterator(_Base::upper_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -668,7 +668,7 @@ namespace __debug
       upper_bound(const key_type& __x) const
       { return const_iterator(_Base::upper_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -686,7 +686,7 @@ namespace __debug
                              iterator(__res.second, this));
       }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -707,7 +707,7 @@ namespace __debug
                              const_iterator(__res.second, this));
       }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
index c187e5191b1bfdc6dcafb4ebe8387b6f4e4a9b54..db9e24602e7abd7ec4bd5dcc891fd47d5cd631e0 100644 (file)
@@ -340,7 +340,7 @@ namespace __debug
            _Base::insert(__first, __last);
        }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
 
       node_type
@@ -483,7 +483,7 @@ namespace __debug
       find(const key_type& __x)
       { return iterator(_Base::find(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -496,7 +496,7 @@ namespace __debug
       find(const key_type& __x) const
       { return const_iterator(_Base::find(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -511,7 +511,7 @@ namespace __debug
       lower_bound(const key_type& __x)
       { return iterator(_Base::lower_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -524,7 +524,7 @@ namespace __debug
       lower_bound(const key_type& __x) const
       { return const_iterator(_Base::lower_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -537,7 +537,7 @@ namespace __debug
       upper_bound(const key_type& __x)
       { return iterator(_Base::upper_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -550,7 +550,7 @@ namespace __debug
       upper_bound(const key_type& __x) const
       { return const_iterator(_Base::upper_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -568,7 +568,7 @@ namespace __debug
                              iterator(__res.second, this));
       }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -589,7 +589,7 @@ namespace __debug
                              const_iterator(__res.second, this));
       }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
index 41bf78d04b2acdae515ce47d7e2e2d454b89d49e..156378ac1bc1ab0699cdede25e3a6c0ad1254eed 100644 (file)
@@ -311,7 +311,7 @@ namespace __debug
       { _Base::insert(__l); }
 #endif
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
 
       node_type
@@ -457,7 +457,7 @@ namespace __debug
       find(const key_type& __x) const
       { return const_iterator(_Base::find(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -485,7 +485,7 @@ namespace __debug
       lower_bound(const key_type& __x) const
       { return const_iterator(_Base::lower_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -511,7 +511,7 @@ namespace __debug
       upper_bound(const key_type& __x) const
       { return const_iterator(_Base::upper_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -547,7 +547,7 @@ namespace __debug
                              const_iterator(__res.second, this));
       }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
index 6ec833821678d34453e55b923644d0ef9bdc618f..9b428625e08a2326eb5b282d40ee9b2424a538fd 100644 (file)
@@ -319,7 +319,7 @@ namespace __debug
       { _Base::insert(__l); }
 #endif
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
       using insert_return_type = _Node_insert_return<iterator, node_type>;
 
@@ -468,7 +468,7 @@ namespace __debug
       find(const key_type& __x) const
       { return const_iterator(_Base::find(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -496,7 +496,7 @@ namespace __debug
       lower_bound(const key_type& __x) const
       { return const_iterator(_Base::lower_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -522,7 +522,7 @@ namespace __debug
       upper_bound(const key_type& __x) const
       { return const_iterator(_Base::upper_bound(__x), this); }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
@@ -558,7 +558,7 @@ namespace __debug
                              const_iterator(__res.second, this));
       }
 
-#if __cplusplus > 201103L
+#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
       template<typename _Kt,
               typename _Req =
                 typename __has_is_transparent<_Compare, _Kt>::type>
index 7673db10b095b02a7a7d4b9e56d4d87d699c1497..c90e44aee45c23299af7839d5b000b5fcacebb75 100644 (file)
@@ -561,7 +561,7 @@ namespace __debug
        }
 #endif // C++17
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
       using insert_return_type = _Node_insert_return<iterator, node_type>;
 
@@ -632,7 +632,7 @@ namespace __debug
       find(const key_type& __key)
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -645,7 +645,7 @@ namespace __debug
       find(const key_type& __key) const
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -666,7 +666,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -685,7 +685,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -790,7 +790,7 @@ namespace __debug
        return __next;
       }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       node_type
       _M_extract(_Base_const_iterator __victim)
       {
@@ -1362,7 +1362,7 @@ namespace __debug
          _M_check_rehashed(__bucket_count);
        }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
 
       node_type
@@ -1428,7 +1428,7 @@ namespace __debug
       find(const key_type& __key)
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1441,7 +1441,7 @@ namespace __debug
       find(const key_type& __key) const
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1462,7 +1462,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1481,7 +1481,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1587,7 +1587,7 @@ namespace __debug
        return __next;
       }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       node_type
       _M_extract(_Base_const_iterator __victim)
       {
index 932600d55e30dcc377ed3a28c5260f081cdb11a1..7fc4146aeca7c7471c482c43ebac418f0abd8bc8 100644 (file)
@@ -448,7 +448,7 @@ namespace __debug
          _M_check_rehashed(__bucket_count);
        }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
       using insert_return_type = _Node_insert_return<iterator, node_type>;
 
@@ -519,7 +519,7 @@ namespace __debug
       find(const key_type& __key)
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -532,7 +532,7 @@ namespace __debug
       find(const key_type& __key) const
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -554,7 +554,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -573,7 +573,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -672,7 +672,7 @@ namespace __debug
        return __next;
       }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       node_type
       _M_extract(_Base_const_iterator __victim)
       {
@@ -1183,7 +1183,7 @@ namespace __debug
          _M_check_rehashed(__bucket_count);
        }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       using node_type = typename _Base::node_type;
 
       node_type
@@ -1249,7 +1249,7 @@ namespace __debug
       find(const key_type& __key)
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1262,7 +1262,7 @@ namespace __debug
       find(const key_type& __key) const
       { return { _Base::find(__key), this }; }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1284,7 +1284,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1303,7 +1303,7 @@ namespace __debug
        return { { __res.first, this }, { __res.second, this } };
       }
 
-#if __cplusplus > 201703L
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
               typename = std::__has_is_transparent_t<_Hash, _Kt>,
               typename = std::__has_is_transparent_t<_Pred, _Kt>>
@@ -1400,7 +1400,7 @@ namespace __debug
        return __next;
       }
 
-#if __cplusplus > 201402L
+#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
       node_type
       _M_extract(_Base_const_iterator __victim)
       {