Skip to content

Commit 2263d93

Browse files
<xhash> should avoid including <xstring> (#2996)
1 parent 7b5a482 commit 2263d93

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: stl/inc/xhash

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
#include <yvals_core.h>
1010
#if _STL_COMPILER_PREPROCESSOR
1111
#include <cmath>
12-
#include <cstring>
13-
#include <cwchar>
1412
#include <list>
1513
#include <tuple>
1614
#include <vector>
1715
#include <xbit_ops.h>
16+
17+
#ifdef _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
18+
#include <cstring>
19+
#include <cwchar>
1820
#include <xstring>
21+
#endif // _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
1922

2023
#if _HAS_CXX17
2124
#include <xnode_handle.h>
@@ -28,6 +31,7 @@ _STL_DISABLE_CLANG_WARNINGS
2831
#pragma push_macro("new")
2932
#undef new
3033

34+
#ifdef _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
3135
namespace stdext {
3236
using _STD basic_string;
3337
using _STD less;
@@ -86,10 +90,9 @@ namespace stdext {
8690
_Pr comp{}; // the comparator object
8791
};
8892
} // namespace stdext
93+
#endif // _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
8994

9095
_STD_BEGIN
91-
using stdext::hash_compare; // TRANSITION, protobuf used this until v3.7.0, released Feb 28, 2019
92-
9396
template <class _Kty, class _Hasher, class _Keyeq, class = void>
9497
struct _Uhash_choose_transparency {
9598
// transparency selector for non-transparent hashed containers

0 commit comments

Comments
 (0)