Skip to content

Commit

Permalink
Merge pull request #4205 from StephanTLavavej/merge-flat_set
Browse files Browse the repository at this point in the history
Merge `main` to `feature/flat_set`
  • Loading branch information
StephanTLavavej committed Nov 17, 2023
2 parents ff90852 + 40ca8b4 commit 35dc14f
Show file tree
Hide file tree
Showing 220 changed files with 3,513 additions and 2,649 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ SpaceBeforeParensOptions:
# NOTE: _STD_BEGIN, _STD_END, etc. aren't macros for complete statements, but telling
# clang-format that they are produces the behavior that we want (with no block indentation).
StatementMacros:
- _EXTERN_CXX_WORKAROUND
- _END_EXTERN_CXX_WORKAROUND
- _STD_BEGIN
- _STD_END
- _STDEXT_BEGIN
- _STDEXT_END
- _FMT_P2286_BEGIN
- _FMT_P2286_END
- _EXTERN_C
- _END_EXTERN_C
- _EXTERN_C_UNLESS_PURE
- _END_EXTERN_C_UNLESS_PURE
# TabWidth: 8
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With The Visual Studio IDE

1. Install Visual Studio 2022 17.8 Preview 3 or later.
1. Install Visual Studio 2022 17.9 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22000.0)" in the VS Installer.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
Expand All @@ -156,15 +156,15 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2022 17.8 Preview 3 or later.
1. Install Visual Studio 2022 17.9 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22000.0)" in the VS Installer.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.27.0 or later, and [Ninja][] 1.11.0 or later.
* Make sure [Python][] 3.12 or later is available to CMake.
2. Open a command prompt.
3. Change directories to a location where you'd like a clone of this STL repository.
4. `git clone https://github.com/microsoft/STL --recurse-submodules`
4. `git clone https://github.com/microsoft/STL.git --recurse-submodules`

To build the x86 target:

Expand Down
2 changes: 1 addition & 1 deletion azure-devops/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
- name: poolName
value: 'StlBuild-2023-10-10T1443-Pool'
value: 'StlBuild-2023-11-15T0519-Pool'
readonly: true
- name: poolDemands
value: 'EnableSpotVM -equals true'
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) {
$PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe'

# https://github.com/PowerShell/PowerShell/releases/latest
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down
46 changes: 23 additions & 23 deletions stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct incrementable_traits<const _Ty> : incrementable_traits<_Ty> {};

template <_Has_member_difference_type _Ty>
struct incrementable_traits<_Ty> {
using difference_type = typename _Ty::difference_type;
using difference_type = _Ty::difference_type;
};

template <class _Ty>
Expand All @@ -117,7 +117,7 @@ _EXPORT_STD template <class>
struct iterator_traits;

_EXPORT_STD template <class _Ty>
using iter_difference_t = typename conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
using iter_difference_t = conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
incrementable_traits<remove_cvref_t<_Ty>>, iterator_traits<remove_cvref_t<_Ty>>>::difference_type;

template <class>
Expand Down Expand Up @@ -160,7 +160,7 @@ template <_Has_member_value_type _Ty>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};

_EXPORT_STD template <class _Ty>
using iter_value_t = typename conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
using iter_value_t = conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
indirectly_readable_traits<remove_cvref_t<_Ty>>, iterator_traits<remove_cvref_t<_Ty>>>::value_type;

_EXPORT_STD template <_Dereferenceable _Ty>
Expand All @@ -176,7 +176,7 @@ concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_
template <bool _Has_member_typedef>
struct _Old_iter_traits_pointer {
template <class _It>
using _Apply = typename _It::pointer;
using _Apply = _It::pointer;
};

template <>
Expand All @@ -187,17 +187,17 @@ struct _Old_iter_traits_pointer<false> {

template <_Has_iter_types _It>
struct _Iterator_traits_base<_It> {
using iterator_category = typename _It::iterator_category;
using value_type = typename _It::value_type;
using difference_type = typename _It::difference_type;
using pointer = typename _Old_iter_traits_pointer<_Has_member_pointer<_It>>::template _Apply<_It>;
using reference = typename _It::reference;
using iterator_category = _It::iterator_category;
using value_type = _It::value_type;
using difference_type = _It::difference_type;
using pointer = _Old_iter_traits_pointer<_Has_member_pointer<_It>>::template _Apply<_It>;
using reference = _It::reference;
};

template <bool _Has_member_typedef>
struct _Iter_traits_difference {
template <class _It>
using _Apply = typename incrementable_traits<_It>::difference_type;
using _Apply = incrementable_traits<_It>::difference_type;
};

template <>
Expand Down Expand Up @@ -233,7 +233,7 @@ struct _Iterator_traits_base<_It> {
using iterator_category = output_iterator_tag;
using value_type = void;
using difference_type =
typename _Iter_traits_difference<_Has_member_difference_type<incrementable_traits<_It>>>::template _Apply<_It>;
_Iter_traits_difference<_Has_member_difference_type<incrementable_traits<_It>>>::template _Apply<_It>;
using pointer = void;
using reference = void;
};
Expand All @@ -253,7 +253,7 @@ struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_void> {
template <>
struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_member> {
template <class _It>
using _Apply = typename _It::pointer;
using _Apply = _It::pointer;
};

template <>
Expand All @@ -268,7 +268,7 @@ concept _Has_member_arrow = requires(_Ty&& __t) { static_cast<_Ty&&>(__t).operat
template <bool _Has_member_typedef>
struct _Iter_traits_reference {
template <class _It>
using _Apply = typename _It::reference;
using _Apply = _It::reference;
};

template <>
Expand All @@ -290,7 +290,7 @@ struct _Iter_traits_category4<false> {
// clang-format off
template <class _It>
concept _Cpp17_random_delta = totally_ordered<_It>
&& requires(_It __i, typename incrementable_traits<_It>::difference_type __n) {
&& requires(_It __i, incrementable_traits<_It>::difference_type __n) {
{ __i += __n } -> same_as<_It&>;
{ __i -= __n } -> same_as<_It&>;
{ __i + __n } -> same_as<_It>;
Expand All @@ -304,7 +304,7 @@ concept _Cpp17_random_delta = totally_ordered<_It>
template <bool _Is_bidi>
struct _Iter_traits_category3 {
template <class _It>
using _Apply = typename _Iter_traits_category4<_Cpp17_random_delta<_It>>::type;
using _Apply = _Iter_traits_category4<_Cpp17_random_delta<_It>>::type;
};

template <>
Expand All @@ -323,7 +323,7 @@ concept _Cpp17_bidi_delta = requires(_It __i) {
template <bool _Is_forward>
struct _Iter_traits_category2 {
template <class _It>
using _Apply = typename _Iter_traits_category3<_Cpp17_bidi_delta<_It>>::template _Apply<_It>;
using _Apply = _Iter_traits_category3<_Cpp17_bidi_delta<_It>>::template _Apply<_It>;
};

template <>
Expand All @@ -345,27 +345,27 @@ concept _Cpp17_forward_delta = constructible_from<_It> && is_reference_v<iter_re
template <bool _Has_member_typedef>
struct _Iter_traits_category {
template <class _It>
using _Apply = typename _It::iterator_category;
using _Apply = _It::iterator_category;
};

template <>
struct _Iter_traits_category<false> {
template <class _It>
using _Apply = typename _Iter_traits_category2<_Cpp17_forward_delta<_It>>::template _Apply<_It>;
using _Apply = _Iter_traits_category2<_Cpp17_forward_delta<_It>>::template _Apply<_It>;
};

// clang-format off
template <class _It>
requires (!_Has_iter_types<_It> && _Cpp17_input_iterator<_It>)
struct _Iterator_traits_base<_It> {
using iterator_category = typename _Iter_traits_category<_Has_member_iterator_category<_It>>::template _Apply<_It>;
using value_type = typename indirectly_readable_traits<_It>::value_type;
using difference_type = typename incrementable_traits<_It>::difference_type;
using pointer = typename _Iter_traits_pointer<(
using iterator_category = _Iter_traits_category<_Has_member_iterator_category<_It>>::template _Apply<_It>;
using value_type = indirectly_readable_traits<_It>::value_type;
using difference_type = incrementable_traits<_It>::difference_type;
using pointer = _Iter_traits_pointer<(
_Has_member_pointer<_It> ? _Itraits_pointer_strategy::_Use_member
: _Has_member_arrow<_It&> ? _Itraits_pointer_strategy::_Use_decltype
: _Itraits_pointer_strategy::_Use_void)>::template _Apply<_It>;
using reference = typename _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>;
using reference = _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>;
};
// clang-format on

Expand Down
8 changes: 6 additions & 2 deletions stl/inc/__msvc_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR

#ifndef __cpp_lib_concepts // note: <format> includes this header in C++20 mode
#error The contents of <print> are available only with C++23. (Also, you should not include this internal header.)
#endif // ^^^ !defined(__cpp_lib_concepts) ^^^

#include <cstdio>
#include <xfilesystem_abi.h>

Expand All @@ -18,7 +22,7 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new

_EXTERN_C
extern "C" {

enum class __std_unicode_console_handle : intptr_t { _Invalid = -1 };

Expand Down Expand Up @@ -51,7 +55,7 @@ _NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error
__stdcall __std_print_to_unicode_console(_In_ __std_unicode_console_handle _Console_handle,
_In_reads_(_Str_size) const char* _Str, _In_ size_t _Str_size) noexcept;

_END_EXTERN_C
} // extern "C"

_STD_BEGIN

Expand Down
5 changes: 3 additions & 2 deletions stl/inc/__msvc_sanitizer_annotate_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ extern const bool _Asan_vector_should_annotate;
#ifdef _INSERT_STRING_ANNOTATION
extern const bool _Asan_string_should_annotate;
#endif
}
} // extern "C"

#if defined(_INSERT_VECTOR_ANNOTATION) || defined(_INSERT_STRING_ANNOTATION)
extern "C" {
// This must match ASan's primary declaration, which isn't marked `noexcept`.
void __cdecl __sanitizer_annotate_contiguous_container(
const void* _First, const void* _End, const void* _Old_last, const void* _New_last);
}
} // extern "C"

#ifdef _M_ARM64EC
#pragma comment(linker, \
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/__msvc_system_error_abi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ _STL_DISABLE_CLANG_WARNINGS
#define __CLRCALL_PURE_OR_STDCALL __stdcall
#endif

_EXTERN_C
extern "C" {
_NODISCARD size_t __CLRCALL_PURE_OR_STDCALL __std_get_string_size_without_trailing_whitespace(
const char* _Str, size_t _Size) noexcept;

_NODISCARD size_t __CLRCALL_PURE_OR_STDCALL __std_system_error_allocate_message(
unsigned long _Message_id, char** _Ptr_str) noexcept;
void __CLRCALL_PURE_OR_STDCALL __std_system_error_deallocate_message(char* _Str) noexcept;
_END_EXTERN_C
} // extern "C"

#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
Expand Down
9 changes: 7 additions & 2 deletions stl/inc/__msvc_tzdb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new

_EXTERN_C
extern "C" {

using __std_tzdb_epoch_milli = double;

Expand Down Expand Up @@ -92,7 +92,7 @@ void __stdcall __std_tzdb_delete_leap_seconds(__std_tzdb_leap_info* _Info) noexc
_NODISCARD void* __stdcall __std_calloc_crt(size_t _Count, size_t _Size) noexcept;
void __stdcall __std_free_crt(void* _Ptr) noexcept;

_END_EXTERN_C
} // extern "C"

_STD_BEGIN

Expand Down Expand Up @@ -151,6 +151,11 @@ class _Crt_allocator {
void deallocate(_Ty* const _Ptr, size_t) noexcept {
__std_free_crt(_Ptr);
}

template <class _Other>
_NODISCARD bool operator==(const _Crt_allocator<_Other>&) const noexcept {
return true;
}
};

_STD_END
Expand Down
Loading

0 comments on commit 35dc14f

Please sign in to comment.