Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various cleanups #3935

Merged
merged 23 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
112b447
Guard `_Xtime_diff_to_millis2` with `#ifdef _CRTBLD`.
StephanTLavavej Aug 5, 2023
a60eb5f
Guard `_Execute_once`, `_Execute_once_fp_t` with `#ifdef _CRTBLD`.
StephanTLavavej Aug 7, 2023
1997e41
Style: Group `__msvc_sanitizer_annotate_container.hpp` with other unc…
StephanTLavavej Aug 5, 2023
b4a1512
Formatting: Drop a spurious newline in a `basic_istream` constructor.
StephanTLavavej Aug 5, 2023
92495ce
Drop `_CONSTEVAL`, `_Cx_exp2()` can be plain `constexpr`.
StephanTLavavej Aug 5, 2023
83c8a5a
Style: Change unnecessarily `const _Auto_id_tag` unnamed parameters.
StephanTLavavej Aug 5, 2023
9189ccd
Add `explicit _Auto_id_tag() = default;` to defend against mistakes.
StephanTLavavej Aug 5, 2023
8a5b549
Fix citation to nonexistent N5687.
StephanTLavavej Aug 5, 2023
cd07f06
Update links: `docs.microsoft.com` => `learn.microsoft.com`
StephanTLavavej Aug 6, 2023
fe64644
Add space to comment.
StephanTLavavej Aug 6, 2023
1c74726
Style: `typename` => `class` in product code.
StephanTLavavej Aug 5, 2023
0e27c71
Fuse adjacent Standard modes.
StephanTLavavej Aug 5, 2023
0e4c2be
Simplify away `_THREAD_CHECK`, `_THREAD_CHECKX`.
StephanTLavavej Aug 6, 2023
6987e0e
Drop polluting using-declarations within `stdext`.
StephanTLavavej Aug 6, 2023
55eb9fc
Mark `_Big_uint128::operator<` as `_NODISCARD`.
StephanTLavavej Aug 6, 2023
dd020fe
Mark `uncaught_exception()` and `uncaught_exceptions()` as `_NODISCARD`.
StephanTLavavej Aug 6, 2023
21be87b
Simplify CMakeLists.txt: `MATCHES "\^(\w+)\$"` => `STREQUAL "$1"`
StephanTLavavej Aug 6, 2023
8940c3f
Simple test cleanup: After `STATIC_ASSERT(CanViewElements<Rng&>)`, as…
StephanTLavavej Aug 6, 2023
0cfd7fa
`<random>`: Decompose complicated conditional expression.
StephanTLavavej Aug 7, 2023
bac3520
Simplify `_Cnd_internal_imp_t` size/align constants.
StephanTLavavej Aug 7, 2023
143b2a3
Use shorter URLs to avoid wrapping.
StephanTLavavej Aug 8, 2023
020a2b5
Copy attributes to definitions, drop useless comments.
StephanTLavavej Aug 10, 2023
9591e6e
Merge branch 'main' into stl-cleanups
StephanTLavavej Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ option(STL_USE_ANALYZE "Pass the /analyze flag to MSVC" OFF)

set(VCLIBS_EXPLICIT_MACHINE "")

if("${VCLIBS_TARGET_ARCHITECTURE}" MATCHES "^x86$")
if("${VCLIBS_TARGET_ARCHITECTURE}" STREQUAL "x86")
set(VCLIBS_TARGET_ARCHITECTURE "x86")
set(VCLIBS_I386_OR_AMD64 "i386")
set(VCLIBS_X86_OR_X64 "x86")
Expand All @@ -58,22 +58,22 @@ if("${VCLIBS_TARGET_ARCHITECTURE}" MATCHES "^x86$")
# runtime dynamic linking by setting our own _STL_WIN32_WINNT back to Windows XP.
add_compile_definitions(_X86_ _VCRT_WIN32_WINNT=0x0501 _STL_WIN32_WINNT=0x0501)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/arch:IA32>)
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^x64$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "x64")
set(VCLIBS_TARGET_ARCHITECTURE "x64")
set(VCLIBS_I386_OR_AMD64 "amd64")
set(VCLIBS_X86_OR_X64 "x64")
add_compile_definitions(_AMD64_ _VCRT_WIN32_WINNT=0x0501 _STL_WIN32_WINNT=0x0501)
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^armv7$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "armv7")
set(VCLIBS_TARGET_ARCHITECTURE "arm")
set(VCLIBS_I386_OR_AMD64 "arm")
set(VCLIBS_X86_OR_X64 "arm")
add_compile_definitions(_ARM_ _VCRT_WIN32_WINNT=0x0602 _STL_WIN32_WINNT=0x0602)
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^arm64$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "arm64")
set(VCLIBS_TARGET_ARCHITECTURE "arm64")
set(VCLIBS_I386_OR_AMD64 "arm64")
set(VCLIBS_X86_OR_X64 "arm64")
add_compile_definitions(_ARM64_ _VCRT_WIN32_WINNT=0x0A00 _STL_WIN32_WINNT=0x0A00)
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^arm64ec$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "arm64ec")
set(VCLIBS_TARGET_ARCHITECTURE "arm64ec")
set(VCLIBS_I386_OR_AMD64 "arm64ec")
set(VCLIBS_X86_OR_X64 "arm64") # Yes, really: `%VCToolsInstallDir%lib\arm64ec` only contains the Link Options
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,5 +549,5 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
[lit]: https://llvm.org/docs/CommandGuide/lit.html
[lit result codes]: https://llvm.org/docs/CommandGuide/lit.html#test-status-results
[[email protected]]: mailto:[email protected]
[redistributables]: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
[natvis documentation]: https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects
[redistributables]: https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist
[natvis documentation]: https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects
2 changes: 1 addition & 1 deletion azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) {
} else {
Write-Host 'AdminUser password supplied; switching to AdminUser.'

# https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
# https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
$PsToolsZipUrl = 'https://download.sysinternals.com/files/PSTools.zip'
Write-Host "Downloading: $PsToolsZipUrl"
$ExtractedPsToolsPath = DownloadAndExtractZip -Url $PsToolsZipUrl
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ if(DEFINED STL_BINARY_DIR)

string(TOLOWER "${VCLIBS_TARGET_ARCHITECTURE}" VCLIBS_TARGET_ARCHITECTURE)

if("${VCLIBS_TARGET_ARCHITECTURE}" MATCHES "^x86$")
if("${VCLIBS_TARGET_ARCHITECTURE}" STREQUAL "x86")
set(VCLIBS_I386_OR_AMD64 "i386")
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^x64$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "x64")
set(VCLIBS_I386_OR_AMD64 "amd64")
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^armv7$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "armv7")
set(VCLIBS_I386_OR_AMD64 "arm")
elseif(VCLIBS_TARGET_ARCHITECTURE MATCHES "^arm64$")
elseif(VCLIBS_TARGET_ARCHITECTURE STREQUAL "arm64")
set(VCLIBS_I386_OR_AMD64 "arm64")
else()
message(FATAL_ERROR "Could not determine target architecture: VCLIBS_TARGET_ARCHITECTURE: ${VCLIBS_TARGET_ARCHITECTURE}")
Expand Down
2 changes: 0 additions & 2 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -4148,9 +4148,7 @@ _FwdIt2 remove_copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _P
_REQUIRE_CPP17_MUTABLE_ITERATOR(_FwdIt2);
return _STD remove_copy_if(_First, _Last, _Dest, _Pass_fn(_Pred));
}
#endif // _HAS_CXX17

#if _HAS_CXX17
_EXPORT_STD template <class _ExPo, class _FwdIt, class _Ty, _Enable_if_execution_policy_t<_ExPo> = 0>
_NODISCARD_REMOVE_ALG _FwdIt remove(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, const _Ty& _Val) noexcept; // terminates

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/complex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifdef _M_CEE_PURE
// no intrinsics for /clr:pure
#elif defined(_M_ARM64) || defined(_M_ARM64EC)
// https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#base-requirements
// https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#base-requirements
// Both floating-point and NEON support are presumed to be present in hardware.
#define _FMP_USING_STD_FMA
#elif defined(__clang__) // ^^^ defined(_M_ARM64) || defined(_M_ARM64EC) ^^^
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/exception
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN

#if _HAS_DEPRECATED_UNCAUGHT_EXCEPTION
_EXPORT_STD extern "C++" _CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
_EXPORT_STD extern "C++" _CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _NODISCARD _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
uncaught_exception() noexcept;
#endif // _HAS_DEPRECATED_UNCAUGHT_EXCEPTION
_EXPORT_STD extern "C++" _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions() noexcept;
_EXPORT_STD extern "C++" _NODISCARD _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions() noexcept;

_STD_END

Expand Down
8 changes: 4 additions & 4 deletions stl/inc/experimental/coroutine
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ namespace experimental {
using promise_type = typename _Ret::promise_type;
};

template <typename _Ret, typename... _Ts>
template <class _Ret, class... _Ts>
struct coroutine_traits : _Coroutine_traits_sfinae<_Ret> {};

template <typename _PromiseT = void>
template <class _PromiseT = void>
struct coroutine_handle;

template <>
Expand Down Expand Up @@ -126,7 +126,7 @@ namespace experimental {
_Resumable_frame_prefix* _Ptr = nullptr;
};

template <typename _PromiseT>
template <class _PromiseT>
struct coroutine_handle : coroutine_handle<> { // general form
using coroutine_handle<>::coroutine_handle;

Expand Down Expand Up @@ -226,7 +226,7 @@ namespace experimental {
// _Resumable_helper_traits class isolates front-end from public surface
// naming changes

template <typename _Ret, typename... _Ts>
template <class _Ret, class... _Ts>
struct _Resumable_helper_traits {
using _Traits = coroutine_traits<_Ret, _Ts...>;
using _PromiseT = typename _Traits::promise_type;
Expand Down
12 changes: 7 additions & 5 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ _NODISCARD constexpr bool _Is_arithmetic_fmt_type(_Basic_format_arg_type _Ty) {
return _Ty > _Basic_format_arg_type::_None && _Ty <= _Basic_format_arg_type::_Long_double_type;
}

struct _Auto_id_tag {};
struct _Auto_id_tag {
explicit _Auto_id_tag() = default;
};

// clang-format off
template <class _Ty, class _CharT>
Expand Down Expand Up @@ -956,7 +958,7 @@ _NODISCARD constexpr bool _Is_execution_charset_self_synchronizing() {
// We care about this because if a charset is self-synchronizing then we can search through it
// for formatting control characters _without_ generally decoding the format string.
switch (_MSVC_EXECUTION_CHARACTER_SET) {
// See: https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
// See: https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
case 874: // Thai (Windows)
case 1250: // ANSI Central European; Central European (Windows)
case 1251: // ANSI Cyrillic; Cyrillic (Windows)
Expand Down Expand Up @@ -1680,7 +1682,7 @@ public:
_Dynamic_specs._Dynamic_width_index = _Verify_dynamic_arg_index_in_range(_Arg_id);
}

constexpr void _On_dynamic_width(const _Auto_id_tag) {
constexpr void _On_dynamic_width(_Auto_id_tag) {
_Dynamic_specs._Dynamic_width_index = _Verify_dynamic_arg_index_in_range(_Parse_ctx.next_arg_id());
}

Expand All @@ -1689,7 +1691,7 @@ public:
_Dynamic_specs._Dynamic_precision_index = _Verify_dynamic_arg_index_in_range(_Arg_id);
}

constexpr void _On_dynamic_precision(const _Auto_id_tag) {
constexpr void _On_dynamic_precision(_Auto_id_tag) {
_Dynamic_specs._Dynamic_precision_index = _Verify_dynamic_arg_index_in_range(_Parse_ctx.next_arg_id());
}

Expand Down Expand Up @@ -3975,7 +3977,7 @@ public:
_Specs._Dynamic_width_index = _Verify_dynamic_arg_index_in_range(_Arg_id);
}

constexpr void _On_dynamic_width(const _Auto_id_tag) {
constexpr void _On_dynamic_width(_Auto_id_tag) {
_Specs._Dynamic_width_index = _Verify_dynamic_arg_index_in_range(_Parse_ctx.next_arg_id());
}

Expand Down
4 changes: 2 additions & 2 deletions stl/inc/hash_map
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace stdext {
float _Max_buckets = 0.0F; // current maximum bucket size
};

template <class _Kty, class _Ty, class _Tr = hash_compare<_Kty, less<_Kty>>,
template <class _Kty, class _Ty, class _Tr = hash_compare<_Kty, _STD less<_Kty>>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class hash_map : public _Hash<_Hmap_traits<_Kty, _Ty, _Tr, _Alloc, false>> {
// hash table of {key, mapped} values, unique keys
Expand Down Expand Up @@ -297,7 +297,7 @@ namespace stdext {
return !(_Left == _Right);
}

template <class _Kty, class _Ty, class _Tr = hash_compare<_Kty, less<_Kty>>,
template <class _Kty, class _Ty, class _Tr = hash_compare<_Kty, _STD less<_Kty>>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class hash_multimap : public _Hash<_Hmap_traits<_Kty, _Ty, _Tr, _Alloc, true>> {
// hash table of {key, mapped} values, non-unique keys
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/hash_set
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace stdext {
float _Max_buckets = 0.0F; // current maximum bucket size
};

template <class _Kty, class _Tr = hash_compare<_Kty, less<_Kty>>, class _Alloc = allocator<_Kty>>
template <class _Kty, class _Tr = hash_compare<_Kty, _STD less<_Kty>>, class _Alloc = allocator<_Kty>>
class hash_set : public _Hash<_Hset_traits<_Kty, _Tr, _Alloc, false>> { // hash table of key values, unique keys
public:
using _Mybase = _Hash<_Hset_traits<_Kty, _Tr, _Alloc, false>>;
Expand Down Expand Up @@ -230,7 +230,7 @@ namespace stdext {
return !(_Left == _Right);
}

template <class _Kty, class _Tr = hash_compare<_Kty, less<_Kty>>, class _Alloc = allocator<_Kty>>
template <class _Kty, class _Tr = hash_compare<_Kty, _STD less<_Kty>>, class _Alloc = allocator<_Kty>>
class hash_multiset
: public _Hash<_Hset_traits<_Kty, _Tr, _Alloc, true>> { // hash table of key values, non-unique keys
public:
Expand Down
4 changes: 1 addition & 3 deletions stl/inc/istream
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public:
}
#endif // defined(__FORCE_INSTANCE)

explicit __CLR_OR_THIS_CALL basic_istream(_Mysb* _Strbuf, bool _Isstd = false)

: _Chcount(0) {
explicit __CLR_OR_THIS_CALL basic_istream(_Mysb* _Strbuf, bool _Isstd = false) : _Chcount(0) {
_Myios::init(_Strbuf, _Isstd);
}

Expand Down
2 changes: 0 additions & 2 deletions stl/inc/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -1466,8 +1466,6 @@ struct iterator_traits<counted_iterator<_Iter>> : iterator_traits<_Iter> {
_STD_END

_STDEXT_BEGIN
using _STD size_t;

template <class _Ptr>
class _DEPRECATE_STDEXT_ARR_ITERS checked_array_iterator { // wrap a pointer with checking
private:
Expand Down
10 changes: 8 additions & 2 deletions stl/inc/random
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,13 @@ struct _Circ_buf { // holds historical values for generators
}

size_t _Base(size_t _Ix = 0) const noexcept {
return (_Ix += _Idx) < _Nw ? (_Ix + _Nw) : (_Ix - _Nw);
_Ix += _Idx;

if (_Ix < _Nw) {
return _Ix + _Nw;
} else {
return _Ix - _Nw;
}
}

unsigned int _Idx;
Expand Down Expand Up @@ -999,7 +1005,7 @@ public:
};

#if _HAS_TR1_NAMESPACE
_CONSTEVAL double _Cx_exp2(const int _Exp) noexcept {
constexpr double _Cx_exp2(const int _Exp) noexcept {
double _Ret = 1.0;
for (int _Count = _Exp; _Count > 0; --_Count) {
_Ret *= 2.0;
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/ratio
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct _Big_uint128 {
uint64_t _Upper;
uint64_t _Lower;

constexpr bool operator<(const _Big_uint128 _Rhs) const noexcept {
_NODISCARD constexpr bool operator<(const _Big_uint128 _Rhs) const noexcept {
if (_Upper != _Rhs._Upper) {
return _Upper < _Rhs._Upper;
}
Expand Down
2 changes: 0 additions & 2 deletions stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -1543,9 +1543,7 @@ struct _Fold_common_reference<void_t<common_reference_t<_Ty1, _Ty2>>, _Ty1, _Ty2

template <class _Ty1, class _Ty2, class _Ty3, class... _Rest>
struct common_reference<_Ty1, _Ty2, _Ty3, _Rest...> : _Fold_common_reference<void, _Ty1, _Ty2, _Ty3, _Rest...> {};
#endif // _HAS_CXX20

#if _HAS_CXX20
_EXPORT_STD template <class _Ty>
struct type_identity {
using type = _Ty;
Expand Down
3 changes: 1 addition & 2 deletions stl/inc/vector
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <__msvc_bit_utils.hpp>
#include <__msvc_sanitizer_annotate_container.hpp>
#include <xmemory>

#if _HAS_CXX17
#include <xpolymorphic_allocator.h>
#endif // _HAS_CXX17

#include <__msvc_sanitizer_annotate_container.hpp>

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
Expand Down
2 changes: 2 additions & 0 deletions stl/inc/xcall_once.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ _EXPORT_STD struct once_flag { // opaque data structure for call_once()
void* _Opaque;
};

#ifdef _CRTBLD
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
// Returns BOOL, nonzero to indicate success, zero for failure
using _Execute_once_fp_t = int(__stdcall*)(void*, void*, void**);

// Returns BOOL, nonzero to indicate success, zero for failure
extern "C++" _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Execute_once(
once_flag& _Flag, _Execute_once_fp_t _Callback, void* _Pv) noexcept;
#endif // _CRTBLD

template <class _Ty>
union _Immortalizer_impl { // constructs _Ty, never destroys
Expand Down
8 changes: 2 additions & 6 deletions stl/inc/xhash
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ _STL_DISABLE_CLANG_WARNINGS

#ifdef _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
namespace stdext {
using _STD basic_string;
using _STD less;
using _STD size_t;

template <class _Kty>
_NODISCARD size_t hash_value(const _Kty& _Keyval) noexcept {
if constexpr (_STD is_pointer_v<_Kty> || _STD is_null_pointer_v<_Kty>) {
Expand All @@ -46,7 +42,7 @@ namespace stdext {
}

template <class _Elem, class _Traits, class _Alloc>
_NODISCARD size_t hash_value(const basic_string<_Elem, _Traits, _Alloc>& _Str) noexcept {
_NODISCARD size_t hash_value(const _STD basic_string<_Elem, _Traits, _Alloc>& _Str) noexcept {
return _STD _Hash_array_representation(_Str.c_str(), _Str.size());
}

Expand All @@ -58,7 +54,7 @@ namespace stdext {
return _STD _Hash_array_representation(_Str, _CSTD wcslen(_Str));
}

template <class _Kty, class _Pr = less<_Kty>>
template <class _Kty, class _Pr = _STD less<_Kty>>
class hash_compare { // traits class for hash containers
public:
enum { // parameters for hash table
Expand Down
5 changes: 2 additions & 3 deletions stl/inc/xstring
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
#define _XSTRING_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <__msvc_sanitizer_annotate_container.hpp>
#include <iosfwd>
#include <xmemory>

#if _HAS_CXX17
#include <xpolymorphic_allocator.h>
#endif // _HAS_CXX17

#include <__msvc_sanitizer_annotate_container.hpp>

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
Expand Down Expand Up @@ -684,7 +683,7 @@ template <class _Elem>
class _String_bitmap<_Elem, false> { // _String_bitmap for wchar_t/unsigned short/char16_t/char32_t/etc. types
public:
static_assert(is_unsigned_v<_Elem>,
"Standard char_traits is only provided for char, wchar_t, char16_t, and char32_t. See N5687 [char.traits]. "
"Standard char_traits is only provided for char, wchar_t, char16_t, and char32_t. See N4950 [char.traits]. "
"Visual C++ accepts other unsigned integral types as an extension.");

constexpr bool _Mark(const _Elem* _First, const _Elem* const _Last) noexcept {
Expand Down
26 changes: 9 additions & 17 deletions stl/inc/xthreads.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,15 @@ struct _Mtx_internal_imp_t {
};

// Size and alignment for _Cnd_internal_imp_t
#ifdef _CRT_WINDOWS
#ifdef _WIN64
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 16;
_INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 8;
#else // _WIN64
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 8;
_INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 4;
#endif // _WIN64
#else // _CRT_WINDOWS
#ifdef _WIN64
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 72;
_INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 8;
#else // _WIN64
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 40;
_INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 4;
#endif // _WIN64
#endif // _CRT_WINDOWS
#if defined(_CRT_WINDOWS) // for Windows-internal code
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 2 * sizeof(void*);
#elif defined(_WIN64) // ordinary 64-bit code
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 72;
#else // vvv ordinary 32-bit code vvv
_INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 40;
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
#endif // ^^^ ordinary 32-bit code ^^^

_INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = alignof(void*);

using _Mtx_t = _Mtx_internal_imp_t*;

Expand Down
Loading