Граф коммитов

241 Коммитов

Автор SHA1 Сообщение Дата
Bishwajeet Parhi b88c580219
_MSVC_STL_UPDATE changed to current month (#1801) 2021-04-05 17:12:46 -07:00
Casey Carter 1cca4823a4
Define __cpp_lib_ranges (#1748)
Update list of implemented proposals

I have verified that all 23 proposals and 35 LWG issues listed in #39 are implemented either on main, in #1436, or in #1731.

Fixes #39
2021-03-18 13:32:26 -07:00
Jonathan Emmett c5ee3b32bd
Downlevel standard coroutine support (#1730)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2021-03-11 20:45:03 -08:00
Stephan T. Lavavej ba4711881e
Toolset update: VS 2019 16.10 Preview 1 (#1711) 2021-03-04 14:27:48 -08:00
J Guy Davidson 108a112736
Update _MSVC_STL_UPDATE to March 2021 (#1708) 2021-03-02 13:21:37 -08:00
Daniel Marshall 30ac4400e5
P1208R6 <source_location> (#664)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-03-01 17:37:36 -08:00
Michael Schellenberger Costa 52b7b3205f
P0980R1 constexpr std::string (#1502)
Co-authored-by: Miya Natsuhara <minatsuh@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-02-26 21:38:32 -08:00
Adam Bucior 66ca0f30e8
Uses-Allocator and Guaranteed Copy Elision For Piecewise Construction (#1668)
Co-authored-by: ArtemSarmini <16746066+ArtemSarmini@users.noreply.github.com>
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2021-02-25 18:26:14 -08:00
Stephan T. Lavavej b52c3797e2
P1614R2 Adding Spaceship <=> To The Library (#1678)
Co-authored-by: Ahana Mukhopadhyay <t-ahmukh@microsoft.com>
Co-authored-by: Anju Del Moral Gonzalez <judelmor@microsoft.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Charlie Barto <chbarto@microsoft.com>
Co-authored-by: Curtis Bezault <cubezaul@microsoft.com>
Co-authored-by: d-winsor <danwin@microsoft.com>
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>
Co-authored-by: statementreply <statementreply@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-02-24 16:19:31 -08:00
Michael S. Rizkalla 834baa6aca
P0053R7 <syncstream> (#1564)
Co-Authored-By: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-Authored-By: Berrysoft <37586447+Berrysoft@users.noreply.github.com>
Co-Authored-By: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-02-19 12:03:41 -08:00
Michael S. Rizkalla 87152f41a1
<variant>: P0608R3 Improving variant's converting constructor/assignment (#1629)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Igor Zhukov <4289847+fsb4000@users.noreply.github.com>
Co-authored-by: S. B. Tam <8998201+cpplearner@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2021-02-17 18:53:52 -08:00
Michael Schellenberger Costa a31bd6ed6b
P1004R2 constexpr std::vector (#1407)
Co-authored-by: Miya Natsuhara <minatsuh@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-02-16 23:54:27 -08:00
Peter Schussheim 7b1dfe5017
Update _MSVC_STL_UPDATE for Feb 2021 (#1626) 2021-02-12 14:59:12 -08:00
Michael Schellenberger Costa 47cd70315d
Prepare the constexpr machinery needed for string and vector (#1546)
Co-authored-by: Miya Natsuhara <minatsuh@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-02-03 13:54:37 -08:00
Michael S. Rizkalla d1f6fe969f
<xmemory>: remove deprecated std::allocator members in C++20 (#1585) 2021-02-01 19:35:06 -08:00
Daniel Marshall 6779b613e1
<chrono>: Partially implement P0355R7 (#323)
Co-authored-by: Curtis Jacques Bezault <curtbezault@gmail.com>
Co-authored-by: MattStephanson <68978048+MattStephanson@users.noreply.github.com>
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2021-02-01 14:22:32 -08:00
Mahmoud Saleh c319a7b2e4
P0466R5 Layout-Compatibility And Pointer-Interconvertibility Traits (#1575)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2021-01-30 16:31:31 -08:00
Berrysoft 6c9f6da6ef
P0408R7 Efficient Access To basic_stringbuf's Buffer (#919)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2021-01-15 19:36:47 -08:00
Michael S. Rizkalla 256197425b
P0784R7 Library Support For More constexpr Containers (#1369)
Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Curtis Jacques Bezault <curtbezault@gmail.com>
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2021-01-07 19:01:52 -08:00
Kunjan Gevariya 54cce5e15e
Updated _MSVC_STL_UPDATE to January 2021 (#1552) 2021-01-05 17:31:29 -08:00
Stephan T. Lavavej 2ce62b5848
Always use `if constexpr`, require CUDA 10.1 Update 2 (#1544) 2021-01-05 17:19:12 -08:00
Chris Ohk 26eeac13cc
Updated _MSVC_STL_UPDATE to December 2020 (#1535) 2020-12-17 17:53:50 -08:00
Stephan T. Lavavej 58160d548f Toolset update: VS 2019 16.9 Preview 2 with Clang 11
* Fix #1471 by properly waiting for the Windows Driver Kit installation to finish.
* Update `azure-pipelines.yml` to use the new pool `StlBuild-2020-12-08`.
* Update `README.md` to mention Preview 2. (Its CMake and Ninja versions haven't changed,
  and we don't directly mention the Clang version.)
* Update `yvals_core.h` to require Clang 11. (Note that MSVC's `_MSC_VER` is remaining `1928` for the 16.9 release.)
* Remove the workaround for LLVM-37556. (We were treating it as an uncommented perma-workaround, but I remembered.)
* Remove many workarounds in `P1502R1_standard_library_header_units`.
* Remove the VSO-1225825 workaround in `<iterator>` and `<ranges>`.
* Unrelated cleanup in `<valarray>`: `__cpp_aligned_new` implies `if constexpr`.
* Update the vcpkg submodule for Boost 1.74.0. This is just their latest commit.
* In `CMakeLists.txt`, require Boost 1.74.0. (This, combined with the toolset update,
  implies that contributors will need to `git submodule update`, clean out the `vcpkg`
  submodule with `git clean -x -d -f`, and then bootstrap vcpkg and build boost-math.)
* Simplify conditional operators in `seed_seq::generate`.
  + Thanks to @AlexGuteniev for suggesting extracting `_Off` and noticing
    that `_Myvec[(_Kx - 1) % _Sx]` was unnecessarily complicated. Given `_Kx` in `[1, _Sx]`,
    then `_Kx - 1` is in `[0, _Sx - 1]`, so `% _Sx` does nothing.
* Take advantage of clang-format 11. This sets `AlignOperands: AlignAfterOperator` and `IndentCaseBlocks: true`.
2020-12-10 09:27:45 -08:00
Casey Carter 2aa944beba
LWG-3036 polymorphic_allocator::destroy is extraneous (#1455)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-12-03 15:03:07 -08:00
Adam Bucior 9bb2a983df
P1771R1 [[nodiscard]] For Constructors (#1495)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-12-02 15:10:23 -08:00
Stephan T. Lavavej d06561f891
Code cleanups: Unify _Float_traits and _Floating_type_traits (#1442) 2020-12-01 14:51:25 -08:00
Avinal Kumar 8b6e9600ca
Updated _MSVC_STL_UPDATE to November 2020 (#1439) 2020-11-13 18:03:25 -08:00
Stephan T. Lavavej ea156e730c
VS 2019 16.9 Preview 1 toolset update (#1451) 2020-11-13 13:29:26 -08:00
Stephan T. Lavavej 1469bf36dc
Finish P0768R1 by adding Spaceship CPOs (#1370)
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-10-29 00:48:50 -07:00
Adam Bucior 1f83628a3e
P1020R1 Smart Pointer Creation With Default Initialization (#1315)
Co-authored-by: Weheineman <t-giwein@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2020-10-16 23:31:43 -07:00
Praveen Ojha 03ab954ea2
Updated _MSVC_STL_UPDATE to October 2020 (#1340)
Co-authored-by: Praveen Ojha <praveeno@nova.tech>
2020-10-02 20:23:07 -07:00
onihusube c47cedc99e
P0339R6 polymorphic_allocator<> (#1311)
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-09-25 16:10:43 -07:00
Igor Zhukov 6e6321c8f6
P1007R3 assume_aligned() (#1306)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-09-22 18:05:58 -07:00
Billy O'Neal 9e264ab0b3
P0660R10 <stop_token> And jthread (#1196)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-09-22 16:53:42 -07:00
Casey Carter 3d88a64538
Minimal changes to support constexpr allocation in MSVC (#1313)
* Minimal changes to support constexpr allocation in MSVC

* Define `_CONSTEXPR20_DYNALLOC` macro to `constexpr` when the compiler defines `__cpp_constexpr_dynamic_alloc` and `inline` otherwise.
* Implement and test `ranges::construct_at` and `ranges::destroy_at`, mark them (and `std` flavors) `_CONSTEXPR20_DYNALLOC`.
* Implement `ranges::destroy` and `ranges::destroy_n` which share machinery with `ranges::destroy_at` with minimal test coverage. (More to follow.)

[This is a dual of internal MSVC-PR-275909.]
2020-09-22 15:02:43 -07:00
Madhvan 5a4f64b278
Update yvals_core.h (#1272) 2020-09-15 21:06:33 -07:00
Casey Carter 10c4fecd7b
Integrate P1391 into views::take and views::drop (#1271)
Completes a bit more of WG21-P1739 "Avoiding Template Bloat For Ranges".

Annotate implementation of P1391R4 and partial implementation of P1739R4 in `<yvals_core.h>`.
2020-09-15 21:01:55 -07:00
Russell Johnston 9e76d8c3d3
Enable __cpp_lib_concepts for IntelliSense (#1286) 2020-09-10 17:43:30 -07:00
Alex Guteniev 3b2956b18e
Latch, Semaphore, Barrier (part of #52, P1135R6) (#1057) 2020-08-31 20:57:17 -07:00
Stephan T. Lavavej 3cca47387b
Update __cpp_lib_coroutine. (#1204) 2020-08-18 13:00:00 -07:00
Billy O'Neal 87dc1d3383
Guard noexcept annotated function pointer type for __cpp_noexcept_function_type. (#1150)
Resolves VSO-1166234.
2020-08-13 11:49:21 -07:00
Alex Guteniev f3ca37d67c
Implement atomic_ref (#2, p0019r8) (#843)
Co-authored-by: Billy O'Neal <bion@microsoft.com>
Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-08-12 18:10:46 -07:00
Stephan T. Lavavej d83bc99312
Upgrade toolset to VS 2019 16.8 Preview 1 (#1153)
Fixes #1051.
2020-08-09 14:56:45 -07:00
leejy12 cbfc5272c8
Update _MSVC_STL_UPDATE to August 2020 (#1144) 2020-08-05 00:21:15 -07:00
Alex Guteniev e4b75dcd44
Implement std::atomic::wait (#593)
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-08-01 17:54:07 -07:00
Billy O'Neal 8ec6b33a92
P1001R2 execution::unseq (#1111)
Resolves #44.
2020-08-01 17:02:51 -07:00
Casey Carter e2912b6e48
Implement ranges::ssize (#1076) 2020-08-01 16:19:09 -07:00
statementreply e9f56a6148
Finish P0811R3 midpoint and lerp (#1048)
* Removes workaround for missing `bit_cast` and mark `lerp` constexpr.

* Changes how `lerp` handles infinite inputs according to
  https://github.com/microsoft/STL/issues/65#issuecomment-563811523 and
  https://github.com/microsoft/STL/issues/65#issuecomment-564102550.

* Adds constexpr tests.

Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-29 20:49:20 -07:00
Casey Carter 21acd23ad8
Implement ranges::copy_backward (#1026)
* Implement ranges::copy_backward

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-07-16 22:10:13 -07:00
God-father1 89c3b4910c
Update _MSVC_STL_UPDATE for July 2020 (#989) 2020-07-07 14:21:55 -07:00
Stephan T. Lavavej 06827feb4c
Code cleanups: remove workarounds, use braces (#978)
* Fix #433: Warnings C4472 and C4571 were removed in VS 2019 16.6.
* Fix #693: Remove workarounds now that we require VS 2019 16.7.
* Use braces to construct tags (especially `_Iter_cat_t`), function objects, and empty `shared_ptr`s.
2020-07-07 14:08:27 -07:00
Adam Bucior 98a10bf2e2
P1065R2 constexpr INVOKE (#703)
Fixes #51.

Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-07-02 18:28:50 -07:00
Charlie Barto 5e3423a377
MSVC <bit> (#795)
Adds MSVC support to the `<bit>` functions.
2020-07-01 20:27:49 -07:00
Stephan T. Lavavej c8144e3a03
Require VS 2019 16.7 Preview 2 or later. (#911) 2020-06-24 00:12:51 -07:00
Hikmat Farhat 44c22f30ac
Updated _MSVC_STL_UPDATE macro (#897)
Fixes #895.
2020-06-19 23:58:24 -07:00
Jonathan Emmett 0cdf5fbfac
Library support for C++20 coroutines (#894)
* Library support for C++20 coroutines

Implements most of <coroutine>. Usefulness of this header is dependent
on a compatible compiler (e.g. Visual Studio 2019 16.8 Preview 1 or
later) that defines `__cpp_impl_coroutine`. With such a compiler
this header exposes the coroutine library support in the `std` namespace
without the need for an `/await` switch.

This implementation is not yet complete:

- noop coroutines are not yet implemented
- symmetric transfer is not yet implemented

The value of `__cpp_lib_coroutine` is defined to a value less than the
Standard-mandated value to represent the incomplete feature.

Co-authored-by: Daniel Marshall <xandan@gmail.com>
2020-06-17 09:08:37 -07:00
Michael Schellenberger Costa 212de15c59
P1032R1 Miscellaneous constexpr (#491) 2020-05-23 00:03:27 -07:00
Daniil Goncharov 48f79a3112
<utility> P0586R2 Integer Comparison Functions (#621)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-05-14 15:20:28 -07:00
Alex Guteniev 7353cd1fbc
atomic_flag_test, lock free type aliases (#684)
Addresses #52 (Partially implements P1135R6).

Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-05-12 14:08:04 -07:00
Casey Carter 07627b63ea
C++20 move_iterator changes and move_sentinel (#787)
* C++20 move_iterator changes and move_sentinel

Changes primarily come from P0896R4 "<ranges>", but the `operator<=>` from P1614R2 "Adding Spaceship <=> To The Library" is here as well.

I've also speculatively implemented the proposed resolutions of LWG-3293, LWG-3391, and LWG-3435.

I had to [patch a pair of libc++ tests](https://reviews.llvm.org/D79343) that fail with these changes; the LLVM reference is updated here to pull in those tests.

Drive-by:
* s/explicit constexpr/constexpr explicit/g (I somehow managed to sneak two occurrences into `subrange`)

* Skip flaky libc++ test (detached threads)
2020-05-07 16:02:40 -07:00
Koki Nishihara 430b569d0a
Update _MSVC_STL_UPDATE in yvals_core.h (#793) 2020-05-05 12:39:46 -07:00
Stephan T. Lavavej 2f4c5792b2
Fix CUDA warnings/errors, _Noinit shadowing, other cleanups (#772) 2020-05-01 14:53:40 -07:00
Casey Carter d346a6a4be
__cpp_consteval indicates support for consteval (#765) 2020-04-30 03:06:00 -07:00
Daniil Goncharov 2bc5f9bc71
P0415R1 constexpr For <complex> (Again) (#367)
Fixes #16 and fixes #190.

Co-authored-by: Curtis.Bezault <curtbezault@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-04-30 02:13:55 -07:00
Stephan T. Lavavej b64eeed4ef
Silence Clang -Wc++20-extensions. (#737) 2020-04-24 18:45:04 -07:00
Charlie Barto 0cbd1b2470
Remove EDG-related workaround for bit_cast (#733)
This was Microsoft-internal VSO-1041044.
2020-04-22 01:53:51 -07:00
Abhishek Bhattacharya b76647085e
Refactored some `for` loops to the normal pattern. (#709)
Fixes #678.
2020-04-22 01:38:41 -07:00
Michael Schellenberger Costa 72c724007c
P1831R1 Deprecating volatile In The Standard Library (#634)
Fixes #558.
2020-04-22 01:30:11 -07:00
Casey Carter ae34ee631f
Require MSVC 19.26 and Clang 10 in the STL (#708)
* `<yvals_core.h>` changes:
  * Clang 10 `_HAS_CONDITIONAL_EXPLICIT` in C++14 mode (Only CUDA now requires the `_HAS_CONDITIONAL_EXPLICIT == 0` code paths)
  * reject Clang < 10
  * reject MSVC < 1926

* Unskip libc++ tests that need Concepts and/or `<=>`

* `std/tests/P0595R2_is_constant_evaluated`: We no longer need  suppress the warning Clang 9 emits when it sees the suppression for the warning Clang 10 emits in this test ;)

* `std/tests/VSO_0157762_feature_test_macros`: Remove Clang 9 support

* `std/tests/concepts_matrix.lst`: This is now simply a copy of `usual_latest_matrix.lst` with the `/BE` lines (EDG configs) commented out. (i.e., we now run the Concepts tests with Clang as well as MSVC.)

* Remove workarounds for LLVM-38491 "clang-cl should accept __declspec(allocator)": Replace uses of `_DECLSPEC_ALLOCATOR` with `__declspec(allocator)`, and suppress Clang's warning when the return type isn't a pointer or reference.

* Remove workarounds for LLVM-43531 "clang-format damages 'alternative representations' for operators": Re-enable clang-format in the test which triggered the bug.

* Remove workarounds for LLVM-38478 "clang -fno-ms-compatibility rejects Windows.h": Add -fno-ms-compatibility to the XXX_winsdk_XXX.lst files. (Yes, we still need these because the Windows SDK breaks `/Za`.)

* Drive-by: unskip libc++ new.version now that we implement destroying delete
2020-04-13 13:09:34 -07:00
Adam Bucior 433b8a16b6
Implement P0718R2 atomic<shared_ptr<T>>, atomic<weak_ptr<T>> (#601) 2020-04-09 19:56:00 -07:00
Casey Carter 0055b5bf80
<yvals_core.h>: Fix <bit> feature-test macros (#695)
* Don't define `__cpp_lib_bitops` when `__EDG__`, so IntelliSense is consistent with MSVC
* Don't define `__cpp_lib_int_pow2` when `__cpp_lib_bitops` isn't defined since the facilities that correspond with `__cpp_lib_int_pow2` are only provided when `__cpp_lib_bitops` is defined.
* Update feature-test macro test accordingly

(See discussion starting at https://github.com/microsoft/STL/issues/313#issuecomment-585127653.)
2020-04-09 19:27:35 -07:00
Adam Bucior a099e85ce3
P0674R1 make_shared() For Arrays (#309)
Fixes #33.

Co-authored-by: Gianni Weinand <t-giwein@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-04-08 12:23:05 -07:00
joemmett 714f499f4b
Library support for P0722R3 - Efficient sized delete for variable siz… (#692)
Library support for P0722R3 - Efficient sized delete for variable sized classes

Implements the struct type `std::destroying_delete_t`, variable
`std::destroying_delete`, and feature test macro
`__cpp_lib_destroying_delete` in C++20 mode with a compiler that defines
`__cpp_impl_destroying_delete`.
2020-04-08 09:38:43 -07:00
s00kee 43e07f3fad
Updated _MSVC_STL_UPDATE to April 2020 (#676)
Fixes #670.
2020-04-02 17:54:50 -07:00
Charlie Barto 3e8b26950f
Revert "Replace __pragma with _Pragma (#662)" (#675)
This reverts commit 42d5df07d0.

Reverting due to a bug in how /Zc:preprocessor handles _Pragma
see VSO-1091758 for more details

Co-authored-by: Charles <barto.charlie+code@gmail.com>
2020-04-02 14:44:09 -07:00
Miroslav Hrnčíř 42d5df07d0
Replace __pragma with _Pragma (#662)
* Replace __pragma with _Pragma

VS 2019 16.6 Preview 2 now supports Standard _Pragma.

* Fix formatting

* _Pragma takes a string
2020-04-01 18:41:51 -07:00
Andrew Marino dba4ef945c
Disable warning C4648 'standard attribute 'x' ignored' (#672)
In a future release of MSVC, the compiler warns with C4648 on uses of `[[no_unique_address]]`, which the compiler recognizes but does not yet implement. Since `<algorithm>` intentionally uses the attribute, disable the warning in STL headers. This mirrors changes in internal MSVC-PR-239026.
2020-04-01 16:18:00 -07:00
Gianni Georg Weinand 90bc6215e4
constexpr for std::array Comparisons (#599)
* Add constexpr to array comparison functions + change feature test macro.

* Fixed clang-format on array and moved comment in yvals_core.h

* Corrected feature test macro constant

* Removed libcxx test skip

* Added constexpr testing for array comparison operators

* clang-formatted the test file

* Added CXX20 feature test macro

* Fixed 0 size array initialization in test file.

* Test variables made global and const, removed to_array, fix typo

* clang-format test file

* Fixed typo, duplicate line and alignment in the constexpr operator test.

* clang-format array

* Changed const global variables to constexpr in test file.

* Removed double parenthesis in test file.

Co-Authored-By: Stephan T. Lavavej <stl@nuwen.net>

* Update tests/std/tests/P1023R0_constexpr_for_array_comparisons/test.cpp

Co-Authored-By: Stephan T. Lavavej <stl@nuwen.net>

* STL's suggestion to avoid disabling clang-format and shorten test.

* clang-format 10 array

* Removed test skip from expected_results.txt to match skipped_tests.txt

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-03-31 14:33:55 -07:00
WojciechMigda 603971feb8
Bump _MSVC_STL_UPDATE for March 2020 (#637)
Fixes #579.
2020-03-25 23:26:36 -07:00
Casey Carter 2ff4d3447b
P1871R1 disable_sized_sentinel_for (#607)
Rename the variable template `disable_sized_sentinel` to `disable_sized_sentinel_for` for consistency with the name of the associated concept `sized_sentinel_for`.

Addresses #39.
2020-03-16 13:10:19 -07:00
Michael Schellenberger Costa d8b5008ea3
P2116R0 Removing tuple-Like Protocol Support From Fixed-Extent span (#587)
Fixes #556.
2020-03-08 14:16:29 -07:00
Michael Schellenberger Costa 2af0749fc1
P1976R2 Explicit Constructors For Fixed-Extent span From Dynamic-Extent Ranges (#500)
Fixes #557.
2020-03-08 13:41:14 -07:00
Billy O'Neal 0d75fc5ab6
<functional> Avoid layers of forwards in invoke (#585)
This change removes the last "nonessential" stack frame that would be encountered for threads, and makes the debugging experience for several standard components, like `std::function`, nicer by not needing so many step into / step out of sequences.

![image](https://user-images.githubusercontent.com/1544943/75860992-92b2b000-5db1-11ea-90f1-d7ec3adde21b.png)

1. CRT's thread entry point
2. std::thread's entry point that staples the parameters on
3. invoke
4. already user code yay!

Hopefully this makes debug codegen better too, particularly now that ranges hammers invoke even harder than we used to.

I didn't change any of the metaprogramming for deciding which strategy to use -- I like that we don't use SFINAE to make that decision, and don't really consider myself competent enough a metaprogrammer to confidently make changes there. I just make `_Invoker_xyz` also supply a strategy value that is fed into `if constexpr`. @CaseyCarter suggested some larger changes which might have sped up metaprogramming I tried, but ran into issues because one can't deduce the calling convention of pointers-to-member-function.

I've also made a one time exception to our usual policy of using `std::forward` rather than `static_cast`, with the rationale that `invoke` is hammered *everywhere*, and also by traits, and we want the debugging experience of that to be as nice as possible.

(Also drive-by removed unnecessary compilation of iostreams from the `Dev10_729003_bind_reference_wrapper` I noticed debugging a test case failure)

Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-03-05 15:36:26 -08:00
Charlie Barto 8a6c278743
add bit_cast and tests (#583)
* add bit_cast and tests
Mirror MSVC-PR-228495
2020-03-05 13:57:04 -08:00
Casey Carter 930b843f31
Several range algorithms (#565)
* Several range algorithms

In `<algorithm>`, implement:
* the generic algorithm result types from P2106R0 (lines 75-227)
* `ranges::for_each` and its result alias `for_each_result` (lines 289-322)
* `ranges::for_each_n` and its result alias `for_each_result_n` (lines 324-351) from P1243R4
* `ranges::find` (lines 353-384)
* `ranges::find_if` (lines 396-426)
* `ranges::find_if_not` (lines 454-484)
* `ranges::count` (lines 526-568)
* `ranges::count_if` (lines 587-617)
* `ranges::mismatch` and its result alias `mismatch_result` (lines 798-891)
* `ranges::equal` (lines 893-980)
* `ranges::all_of` (lines 1006-1033)
* `ranges::any_of` (lines 1060-1087)
* `ranges::none_of` (lines 1114-1141)
* `ranges::copy` and its result alias `copy_result` (lines 1143-1175)
* `ranges::copy_n` and its result alias `copy_n_result` (lines 1177-1207)
* `ranges::copy_if` and its result alias `copy_if_result` (lines 1262-1302)

In `<concepts>`:
* implement LWG-3194 which includes the resolution of LWG-3151 (lines 51-53)
* LWG-3175 has been merged, remove conditional implementation (line 183)
* replace `boolean` concept with _`boolean-testable`_ concept from P1964R2 (lines 198-237, 283)
* move `movable` (pun intended) into synopsis order (lines 254-256)
* Modify concept `copyable` per P2102R0 (lines 260-261)
* Implement concept `equivalence_relation` from P1716R3 (lines 290-293)

In `<xutility>`:
* promote `identity` from `<functional>` for visibility in `<algorithm>` (lines 160-168)
* promote `common_range` from `<ranges>` for visibility in `<algorithm>` (lines 3091-3095)
* remove LWG-3247 and LWG-3299 annotations (lines 622, 626, and 963)
* prefix `indirectly_` to the names of `readable_traits`, `readable`, and `writable` (a great many lines); and modify `iter_value_t` (lines 366-367), `iter_reference_t` (lines ), `iter_difference_t`, `iter_rvalue_reference_t`, `indirectly_readable` (lines 688-701) and `indirectly_swappable` per P1878R1
* define alias template `_Make_unsigned_like_t` to implement P1522R1's _`make-unsigned-like-t`_ (it does nothing interesting yet, since we provide no integer-class types) (lines 727-729)
* implement the "Indirect callable" concepts `indirectly_unary_invocable`, `indirectly_regular_unary_invocable`, `indirect_unary_predicate`, `indirect_binary_predicate`, `indirect_equivalence_relation`, `indirect_strict_weak_order`, and helpers `indirect_result_t` and `projected` (lines 852-926)
* implement `indirectly_copyable` and `indirectly_copyable_storable` concepts (lines 939-952)
* implement `indirectly_swappable`, `indirectly_comparable`, `permutable`, `mergeable`, and `sortable` concepts (lines 1032-1061)
* rename `safe_range` and `enable_safe_range` to `borrowed_range` and `enable_borrowed_range` per LWG-3379 (lines 2168-2173 and 2327-2330)
* remove "Implements D2091R0" comments (various lines in 2175-2710)
* add `ranges::data` to the list of access CPOs that hard error for arrays of incomplete element types (lines 2204-2205 and 2277-2278)
* `ranges::empty` rejects arrays of unbound bound per P2091R0 (lines 2664-2692)
* implement concept `_Not_same_as` (the exposition-only _`not-same-as`_ from the working draft) (lines 3087-3089)
* implement `ranges::dangling` (lines 3097-3102)
* implement `ranges::borrowed_iterator_t` (lines 3104-3106)

In `<yvals_core.h>`:
* Indicate implementation of:
  * P1207R4 Movability of Single-Pass Iterators
  * P1248R1 Fixing Relations
  * P1474R1 Helpful Pointers For contiguous_iterator
  * P1716R3 Range Comparison Algorithms Are Over-Constrained
  * P1878R1 Constraining Readable Types
  * P1964R2 Replacing `boolean` with _`boolean-testable`_
  * P2091R0 Fixing Issues With Range Access CPOs
  * P2102R0 Make "implicit expression variations" More Explicit
* and partial implementation of:
  * P1243R4 Rangify New Algorithms
* remove conditional definition of `_HAS_STD_BOOLEAN` (we never has `std::boolean` now)

`tests/std/include/instantiate_algorithms.hpp`:
* define non-movable type `Immobile`, and use it to ensure that standard algorithms neither copy nor move random number generators nor uniform random bit generators

Add header `tests/std/include/range_algorithm_support.hpp` with support machinery for the ranges algorithm tests. It notably defines:
* `is_permissive` for determining whether we are compiling in MSVC's permissive mode (lines 18-37)
* A class template `borrowed<bool>` whose specializations always model `range` and model `borrowed_range` iff the template parameter is `true` (lines 39-46)
* Function objects `get_first` and `get_second` which project the pertinent member from `pair` arguments (lines 48-54)
* A class template `move_only_range<T>` which adapts a `contiguous_range` of `T` into a move-only `view` with move-only `input_iterator`s (lines 56-150)
* A "phony" iterator class template `test_iterator` with tunable category, value type, and difference capability for instantiation tests (lines 152-363)
* A similar "phony" class template `test_range` with tunable category, size, and commonality (i.e., is the sentinel type the same as the iterator type) (lines 365-423)
* "phony" predicate and projection types for instantiation tests (lines 425-442)
* combinatoric instantiation machinery for instantiation tests that instantiate with all interesting kinds of output iterators or input ranges (lines 444-529)

A new compile-only test `tests/std/tests/P0896R4_ranges_algorithm_machinery` which covers:
* `indirectly_unary_invocable`/`indirectly_regular_unary_invocable`
* `indirect_unary_predicate`/`indirect_binary_predicate`/`indirect_result_t`
* `projected`
* `indirectly_copyable`/`indirectly_swappable`/`indirectly_comparable`
* `dangling`/`borrowed_iterator_t`
* the result types `in_found_result`/`in_fun_result`/`in_in_result`/`in_out_result`/`in_in_out_result`/`in_out_out_result`/`min_max_result`

Very simple smoke and instantiation tests for the 15 new algorithms in:
* `tests/std/tests/P0896R4_ranges_alg_all_of`
* `tests/std/tests/P0896R4_ranges_alg_any_of`
* `tests/std/tests/P0896R4_ranges_alg_copy`
* `tests/std/tests/P0896R4_ranges_alg_copy_if`
* `tests/std/tests/P0896R4_ranges_alg_copy_n`
* `tests/std/tests/P0896R4_ranges_alg_count`
* `tests/std/tests/P0896R4_ranges_alg_count_if`
* `tests/std/tests/P0896R4_ranges_alg_equal`
* `tests/std/tests/P0896R4_ranges_alg_find`
* `tests/std/tests/P0896R4_ranges_alg_find_if`
* `tests/std/tests/P0896R4_ranges_alg_find_if_not`
* `tests/std/tests/P0896R4_ranges_alg_for_each`
* `tests/std/tests/P0896R4_ranges_alg_for_each_n`
* `tests/std/tests/P0896R4_ranges_alg_mismatch`
* `tests/std/tests/P0896R4_ranges_alg_none_of`

Resolves:
* #537 `<concepts>`: LWG-3175 has been accepted, so we should remove commented-out code
* #540 LWG-3194 `ConvertibleTo` prose does not match code
* #546 LWG-3379 `safe` in several library names is misleading
* #559 P1964R2 "Replacing `boolean` with _`boolean-testable`_"
* #561 P2102R0 "Making 'Implicit Expression Variations' More Explicit"
* #563 P2091R0 "Fixing Issues With Range Access CPOs"
2020-03-04 22:19:53 -08:00
Stephan T. Lavavej fee81ee626
Replace `_STATIC_UNLESS_PURE` with `static`. (#584)
This was a workaround for a compiler bug (in constexpr initialization)
that has been fixed.
2020-03-03 16:24:56 -08:00
Xiang Fan b85797476f
Apply a new attribute '[[msvc::known_semantics]]' (#580)
Apply a new attribute '[[msvc::known_semantics]]' to communicate to the compiler that certain type trait specializations have the standard-mandated semantics
2020-03-02 15:30:16 -08:00
Daniel Marshall 627eced6ec
P1115R3 erase()/erase_if() Return size_type (#566)
Fixes #555.
2020-02-29 14:35:24 -08:00
Charlie Barto e03429600e
P1956R1 <bit> has_single_bit(), bit_ceil(), bit_floor(), bit_width() (#524)
* apply P1956R1

Mirror of MSVC-PR-231381

* rename test folder and update yvals_core naming

* repair test.lst

* fix nitpicks
2020-02-24 19:00:15 -08:00
Jean Philippe 1b59f0d1e7
Update _MSVC_STL_UPDATE value to February 2020 (#486)
Fixes #477.
2020-02-06 11:45:20 -08:00
Michael Schellenberger Costa b3504262fe
P0619R4 Removing C++17-Deprecated Features (#380)
Fixes #28 and fixes #478.
2020-02-03 02:55:53 -08:00
Michael Schellenberger Costa ed70349f27
P1423R3 char8_t compatibility remedies (#470)
Deletes stream insertion operators for `ostream` with non-`char` character types, and for `wostream` with `charX_t` character types. The `char8_t` operators are deleted in all language modes, but the others are C++20-only to avoid gratuitous breakage (with escape hatch `_HAS_STREAM_INSERTIONS_REMOVED_IN_CXX20`).

Skips libc++ tests that expect the pre-P1423R3 value of `__cpp_lib_char8_t`.

Resolves #59.
2020-02-01 12:27:53 -08:00
Billy O'Neal 94d39ed515
Avoid double strlen for string operator+ and implement P1165R1 (#467)
Resolves GH-53.
Resolves GH-456.

Co-authored by: @barcharcraz
Co-authored by: @ArtemSarmini 

This change adds a bespoke constructor to `basic_string` to handle string concat use cases, removing any EH states we previously emitted in our operator+s, avoiding double strlen in our operator+s,

The EH states problem comes from our old pattern:

```
S operator+(a, b) {
    S result;
    result.reserve(a.size() +b.size()); // throws
    result += a; // throws
    result += b; // throws
    return result;
}
```

Here, the compiler does not know that the append operation can't throw, because it doesn't understand `basic_string` and doesn't know the `reserve` has made that always safe. As a result, the compiler emitted EH handing code to call `result`'s destructor after each of the reserve and `operator+=` calls.

Using a bespoke concatenating constructor avoids these problems because there is only one throwing operation (in IDL0 mode). As expected, this results in a small performance win in all concats due to avoiding needing to set up EH stuff, and a large performance win for the `const char*` concats due to the avoided second `strlen`:

Performance:

```
#include <benchmark/benchmark.h>
#include <stdint.h>
#include <string>

constexpr size_t big = 2 << 12;
constexpr size_t multiplier = 64;

static void string_concat_string(benchmark::State &state) {
    std::string x(static_cast<size_t>(state.range(0)), 'a');
    std::string y(static_cast<size_t>(state.range(1)), 'b');
    for (auto _ : state) {
        (void)_;
        benchmark::DoNotOptimize(x + y);
    }
}

BENCHMARK(string_concat_string)->RangeMultiplier(multiplier)->Ranges({{2, big}, {2, big}});

static void string_concat_ntbs(benchmark::State &state) {
    std::string x(static_cast<size_t>(state.range(0)), 'a');
    std::string yBuf(static_cast<size_t>(state.range(1)), 'b');
    const char *const y = yBuf.c_str();
    for (auto _ : state) {
        (void)_;
        benchmark::DoNotOptimize(x + y);
    }
}

BENCHMARK(string_concat_ntbs)->RangeMultiplier(multiplier)->Ranges({{2, big}, {2, big}});

static void string_concat_char(benchmark::State &state) {
    std::string x(static_cast<size_t>(state.range(0)), 'a');
    for (auto _ : state) {
        (void)_;
        benchmark::DoNotOptimize(x + 'b');
    }
}

BENCHMARK(string_concat_char)->Range(2, big);

static void ntbs_concat_string(benchmark::State &state) {
    std::string xBuf(static_cast<size_t>(state.range(0)), 'a');
    const char *const x = xBuf.c_str();
    std::string y(static_cast<size_t>(state.range(1)), 'b');
    for (auto _ : state) {
        (void)_;
        benchmark::DoNotOptimize(x + y);
    }
}

BENCHMARK(ntbs_concat_string)->RangeMultiplier(multiplier)->Ranges({{2, big}, {2, big}});

static void char_concat_string(benchmark::State &state) {
    std::string x(static_cast<size_t>(state.range(0)), 'a');
    for (auto _ : state) {
        (void)_;
        benchmark::DoNotOptimize('b' + x);
    }
}

BENCHMARK(char_concat_string)->Range(2, big);

BENCHMARK_MAIN();

```

Times are in NS on a Ryzen Threadripper 3970X, improvements are `((Old/New)-1)*100`

|                                 | old x64 | new x64 | improvement | old x86 | new x86 | improvement |
| ------------------------------- | ------- | ------- | ----------- | ------- |-------- | ----------- |
| string_concat_string/2/2        | 12.8697 | 5.78125 |     122.61% | 13.9029 | 11.0696 |      25.60% |
| string_concat_string/64/2       |  62.779 | 61.3839 |       2.27% | 66.4394 | 61.6296 |       7.80% |
| string_concat_string/4096/2     | 125.558 | 124.512 |       0.84% | 124.477 | 117.606 |       5.84% |
| string_concat_string/8192/2     | 188.337 | 184.152 |       2.27% | 189.982 | 185.598 |       2.36% |
| string_concat_string/2/64       | 64.5229 | 64.1741 |       0.54% | 67.1338 | 61.4962 |       9.17% |
| string_concat_string/64/64      | 65.5692 | 59.9888 |       9.30% | 66.7742 | 60.4781 |      10.41% |
| string_concat_string/4096/64    | 122.768 | 122.768 |       0.00% | 126.774 | 116.327 |       8.98% |
| string_concat_string/8192/64    |  190.43 | 181.362 |       5.00% | 188.516 | 186.234 |       1.23% |
| string_concat_string/2/4096     | 125.558 | 119.978 |       4.65% | 120.444 | 111.524 |       8.00% |
| string_concat_string/64/4096    | 125.558 | 119.978 |       4.65% | 122.911 | 117.136 |       4.93% |
| string_concat_string/4096/4096  | 188.337 | 184.152 |       2.27% | 193.337 | 182.357 |       6.02% |
| string_concat_string/8192/4096  | 273.438 | 266.811 |       2.48% | 267.656 | 255.508 |       4.75% |
| string_concat_string/2/8192     | 205.078 | 194.964 |       5.19% | 175.025 | 170.181 |       2.85% |
| string_concat_string/64/8192    | 205.078 | 188.337 |       8.89% | 191.676 |  183.06 |       4.71% |
| string_concat_string/4096/8192  | 266.811 | 256.696 |       3.94% | 267.455 | 255.221 |       4.79% |
| string_concat_string/8192/8192  |  414.69 | 435.965 |      -4.88% | 412.784 |  403.01 |       2.43% |
| string_concat_ntbs/2/2          | 12.8348 |  5.9375 |     116.17% |   14.74 |  11.132 |      32.41% |
| string_concat_ntbs/64/2         | 71.1496 |  59.375 |      19.83% | 70.6934 | 60.9371 |      16.01% |
| string_concat_ntbs/4096/2       | 128.697 | 114.397 |      12.50% | 126.626 | 121.887 |       3.89% |
| string_concat_ntbs/8192/2       | 194.964 | 176.479 |      10.47% | 196.641 |  186.88 |       5.22% |
| string_concat_ntbs/2/64         | 100.446 |  74.986 |      33.95% | 109.082 | 83.3939 |      30.80% |
| string_concat_ntbs/64/64        | 106.027 | 78.4738 |      35.11% | 109.589 | 84.3635 |      29.90% |
| string_concat_ntbs/4096/64      | 164.969 | 138.114 |      19.44% | 165.417 | 142.116 |      16.40% |
| string_concat_ntbs/8192/64      | 224.958 | 200.195 |      12.37% | 228.769 | 200.347 |      14.19% |
| string_concat_ntbs/2/4096       | 2040.32 | 1074.22 |      89.94% | 2877.33 | 1362.74 |     111.14% |
| string_concat_ntbs/64/4096      | 1994.98 | 1074.22 |      85.71% | 2841.93 | 1481.62 |      91.81% |
| string_concat_ntbs/4096/4096    | 2050.78 | 1147.46 |      78.72% | 2907.78 | 1550.82 |      87.50% |
| string_concat_ntbs/8192/4096    | 2148.44 | 1227.68 |      75.00% | 2966.92 | 1583.78 |      87.33% |
| string_concat_ntbs/2/8192       | 3934.14 | 2099.61 |      87.37% | 5563.32 | 2736.56 |     103.30% |
| string_concat_ntbs/64/8192      | 3989.95 | 1994.98 |     100.00% | 5456.84 | 2823.53 |      93.26% |
| string_concat_ntbs/4096/8192    | 4049.24 | 2197.27 |      84.29% | 5674.02 | 2957.04 |      91.88% |
| string_concat_ntbs/8192/8192    | 4237.58 | 2249.58 |      88.37% | 5755.07 | 3095.65 |      85.91% |
| string_concat_char/2            | 12.8348 | 3.44936 |     272.09% | 11.1104 | 10.6976 |       3.86% |
| string_concat_char/8            | 8.99833 | 3.45285 |     160.61% | 11.1964 | 10.6928 |       4.71% |
| string_concat_char/64           | 65.5692 | 60.9375 |       7.60% | 65.7585 | 60.0182 |       9.56% |
| string_concat_char/512          | 72.5446 | 69.7545 |       4.00% |  83.952 | 79.5254 |       5.57% |
| string_concat_char/4096         | 125.558 | 119.978 |       4.65% | 123.475 | 117.103 |       5.44% |
| string_concat_char/8192         |  190.43 | 187.988 |       1.30% | 189.181 | 185.174 |       2.16% |
| ntbs_concat_string/2/2          | 13.4975 | 6.13839 |     119.89% | 14.8623 |   11.09 |      34.02% |
| ntbs_concat_string/64/2         |  104.98 | 79.5201 |      32.02% | 112.207 | 83.7111 |      34.04% |
| ntbs_concat_string/4096/2       | 2085.66 | 1098.63 |      89.84% | 2815.19 | 1456.08 |      93.34% |
| ntbs_concat_string/8192/2       | 3899.27 | 2099.61 |      85.71% | 5544.52 | 2765.16 |     100.51% |
| ntbs_concat_string/2/64         | 71.4983 |  62.779 |      13.89% | 72.6602 | 63.1953 |      14.98% |
| ntbs_concat_string/64/64        |  104.98 | 80.2176 |      30.87% | 111.073 | 81.8413 |      35.72% |
| ntbs_concat_string/4096/64      | 2085.66 | 1074.22 |      94.16% | 2789.73 |  1318.7 |     111.55% |
| ntbs_concat_string/8192/64      | 3989.95 | 2085.66 |      91.30% | 5486.85 | 2693.83 |     103.68% |
| ntbs_concat_string/2/4096       | 136.719 | 128.348 |       6.52% | 122.605 |  114.44 |       7.13% |
| ntbs_concat_string/64/4096      | 167.411 | 142.997 |      17.07% | 168.572 | 138.566 |      21.65% |
| ntbs_concat_string/4096/40      | 2099.61 | 1171.88 |      79.17% | 2923.85 | 1539.02 |      89.98% |
| ntbs_concat_string/8192/40      | 4098.07 | 2246.09 |      82.45% | 5669.34 | 3005.25 |      88.65% |
| ntbs_concat_string/2/8192       |   213.1 | 199.498 |       6.82% | 178.197 | 168.532 |       5.73% |
| ntbs_concat_string/64/8192      | 223.214 | 214.844 |       3.90% | 232.263 | 203.722 |      14.01% |
| ntbs_concat_string/4096/81      | 2148.44 | 1255.58 |      71.11% | 2980.78 | 1612.97 |      84.80% |
| ntbs_concat_string/8192/81      | 4237.58 | 2406.53 |      76.09% | 5775.55 | 3067.94 |      88.25% |
| char_concat_string/2            | 11.1607 | 3.60631 |     209.48% | 11.2101 | 10.7192 |       4.58% |
| char_concat_string/8            | 11.4746 | 3.52958 |     225.10% | 11.4595 |  10.709 |       7.01% |
| char_concat_string/64           | 65.5692 | 66.9643 |      -2.08% | 66.6272 | 60.8601 |       9.48% |
| char_concat_string/512          | 68.0106 | 73.2422 |      -7.14% | 91.1946 | 83.0791 |       9.77% |
| char_concat_string/4096         | 125.558 | 122.768 |       2.27% | 119.432 | 110.031 |       8.54% |
| char_concat_string/8192         | 199.498 | 199.498 |       0.00% | 171.895 | 169.173 |       1.61% |


Code size:
```
#include <string>

std::string strings(const std::string& a, const std::string& b) {
    return a + b;
}
std::string string_ntbs(const std::string& a, const char * b) {
    return a + b;
}
std::string string_char(const std::string& a, char b) {
    return a + b;
}
std::string ntbs_string(const char * a, const std::string& b) {
    return a + b;
}
std::string char_string(char a, const std::string& b) {
    return a + b;
}
```

Sizes are in bytes for the `.obj`, "Times Original" is New/Old, `cl /EHsc /W4 /WX /c /O2 .\code_size.cpp`:

| Bytes | Before | After  | Times Original |
| ----- | ------ | ------ | -------------- |
| x64   | 70,290 | 34,192 |          0.486 |
| x86   | 47,152 | 28,792 |          0.611 |
2020-01-31 16:45:39 -08:00
Stephan T. Lavavej c5cde6ecba
is_constant_evaluated() is constantly available. (#454) 2020-01-24 12:10:49 -08:00
Pavol Misik 10a227676c yvals_core.h: Require _MSC_VER 1925 (#430)
Fixes #422.
2020-01-24 12:07:11 -08:00
Pavol Misik 6f39aad760 Update _MSVC_STL_UPDATE value to January 2020 (#429)
Fixes #409.
2020-01-24 12:05:18 -08:00
Michael Schellenberger Costa 0e336ac737 P0935R0 Eradicating Unnecessarily Explicit Default Constructors (#415)
Fixes #41.
2020-01-24 12:01:10 -08:00
Adam Bucior a46d897ac0 Finish Fixing Atomic Initialization (P0883R2) (#390)
Co-authored-by: AdamBucior https://github.com/AdamBucior
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Billy O'Neal <billy.oneal@gmail.com>
2020-01-23 22:50:22 -08:00
Billy O'Neal 3447e56030 Implement constexpr algorithms. (#425)
* Implement constexpr algorithms.

Resolves GH-6 ( P0202R3 ), resolves GH-38 ( P0879R0 ), and drive-by fixes GH-414.

Everywhere: Add constexpr, _CONSTEXPR20, and _CONSTEXPR20_ICE to things.

skipped_tests.txt: Turn on all tests previously blocked by missing constexpr algorithms (and exchange and swap). Mark those algorithms that cannot be turned on that we have outstanding PRs for with their associated PRs.
yvals_core.h: Turn on feature test macros.
xutility:
* Move the _Ptr_cat family down to copy, and fix associated SHOUTY comments to indicate that this is really an implementation detail of copy, not something the rest of the standard library intends to use directly. Removed and clarified some of the comments as requested by Casey Carter.
* Extract _Copy_n_core which implements copy_n using only the core language (rather than memcpy-as-an-intrinsic). Note that we cannot use __builtin_memcpy or similar to avoid the is_constant_evaluated check here; builtin_memcpy only works in constexpr contexts when the inputs are of type char.
numeric: Refactor as suggested by GH-414.

* Attempt alternate fix of GH-414 suggested by Stephan.

* Stephan product code PR comments:

* _Swap_ranges_unchecked => _CONSTEXPR20
* _Idl_dist_add => _NODISCARD (and remove comments)
* is_permutation => _NODISCARD
* Add yvals_core.h comments.

* Delete unused _Copy_n_core and TRANSITION, DevCom-889321 comment.

* Put the comments in the right place and remove phantom braces.
2020-01-22 17:57:27 -08:00
Michael Schellenberger Costa b3598a4f0b P0122R7 <span> (#142)
Fixes #4.
2020-01-17 19:23:11 -08:00
Casey Carter e36c3bff61
Don't assume _HAS_CONDITIONAL_EXPLICIT for __INTEL_COMPILER (#424)
This change is not a statement of support for the Intel C++ compiler by the STL, so much as an attempt to not break it gratuitously.

Fixes DevCom-744112.
2020-01-17 12:53:03 -08:00
Adam Bucior d862650bd5 Support For Incomplete Types In reference_wrapper (#393)
* Implement P0357R3
* Update LLVM to get skip of libcxx\test\std\utilities\function.objects\refwrap\weak_result.pass.cpp, and exclude "// REQUIRES: c++98 || c++03 || c++11 || c++14 || c++17" as a 'magic comment'.

Co-authored-by: Billy O'Neal <billy.oneal@gmail.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-01-09 13:54:20 -08:00
Adam Bucior eb4a486c83 P1006R1 constexpr For pointer_traits<T*>::pointer_to() (#397)
Co-authored-by: Billy O'Neal <billy.oneal@gmail.com>
2020-01-09 10:38:13 -08:00
Daniil Goncharov 7ad0d63987 <numeric> Implement P1645R1 "constexpr for <numeric> algorithms" (#399)
Co-authored-by: Billy O'Neal <billy.oneal@gmail.com>
2020-01-08 19:23:30 -08:00
Daniel Marshall 48c7f31413 <utility> Deprecate std::rel_ops & resolve #403 (#402)
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Billy O'Neal <billy.oneal@gmail.com>
2020-01-08 19:16:40 -08:00
Casey Carter 4d5d226a72
Implement LWG-3356 (#404)
...which renames the feature-test macro `__cpp_lib_nothrow_convertible` to `__cpp_lib_is_nothrow_convertible`. We *just* added this feature-test macro which hasn't yet shipped, and therefore want to rename it quickly - ideally before customers notice it exists. LWG has tentatively approved this issue resolution.
2020-01-06 13:05:00 -08:00
Michael Schellenberger Costa 4aaa0135d9 [ranges] Implement some range concepts (#389)
P1456R1 Move-Only Views
P1870R1 safe_range
2019-12-16 21:58:58 -08:00
Daniil Goncharov 47881a869f Define _CONSTEXPR20 (#387) 2019-12-16 21:38:20 -08:00
Adam Bucior 07e85d10c0 Remove weak_equality and strong_equality (#381)
Implement WG21-P1959 Removing `weak_equality` And `strong_equality`, working towards #64.
2019-12-13 15:00:50 -08:00
Stephan T. Lavavej 1666b7c145
Fix #347: <shared_mutex>: Do we still need the _USING_V110_SDK71_ guard? (#373)
While we must continue to support `msvcp140.dll` running on Windows XP,
we don't need to support compiling our headers with the (removed)
`v140_xp` toolset and its corresponding old Windows SDK. Accordingly,
we can unconditionally define `shared_mutex`. (This is a C++17 feature,
but it was implemented before Standard modes, so it's not guarded by
`_HAS_CXX17`.)
2019-12-11 16:27:13 -08:00
Stephan T. Lavavej 0781d10b9d
yvals_core.h: Remove "toolset update" workaround. (#372)
Currently, we're building the STL in both our Microsoft-internal MSVC
repo and in GitHub, as we work on the migration. The MSVC repo uses a
checked-in compiler (the "toolset") to build the STL and the compiler
itself. Earlier, the checked-in toolset identified itself as
19.25.28318.97 but lacked support for `is_constant_evaluated`, so we
needed to detect that exact version number. Now, the toolset has been
updated, so this workaround is no longer necessary.

When VS 2019 16.5 Preview 2 is available in the future, we'll begin
requiring it to build the GitHub sources, at which point we'll be able
to unconditionally define `__cpp_lib_is_constant_evaluated`.
2019-12-11 16:26:38 -08:00
SasLuca ad5b80690d Use _STD addressof(_Val), update _MSVC_STL_UPDATE (#358)
* Fix #272: `<future>: promise<_Ty&>::set_value(_Ty& _Val)` should use `_STD addressof(_Val)`
* Fix #344: `<yvals_core.h>`: Update `_MSVC_STL_UPDATE` to December 2019
2019-12-06 19:38:33 -08:00
Stephan T. Lavavej 19067f6752 Reorder and rewrap yvals_core.h comments. 2019-12-04 20:21:54 -08:00
Stephan T. Lavavej bef8b56dc9 Fix #156: WG21-P0595 is_constant_evaluated() 2019-12-04 20:21:54 -08:00
Stephan T. Lavavej d9d7bd808e Fix #339: WG21-P1902 Missing Feature-Test Macros 2017-2019 2019-12-04 20:21:54 -08:00
Stephan T. Lavavej 664adab3ab Fix #335: LWG-3257 Missing feature testing macro update from WG21-P0858 2019-12-04 20:21:54 -08:00
S. B. Tam 1d39dfac99 Implement P1690R1 Refining Heterogeneous Lookup For Unordered Containers (#341)
* Implement P1690R1 Refining Heterogeneous Lookup For Unordered Containers

* Mark P1690R1 as implemented in yvals_core.h.
2019-12-02 20:34:31 -08:00
Casey Carter 1e8b8d4eef
[range.iter.ops], default_sentinel, and unreachable_sentinel (#329)
Implements iterator primitive operations `std::ranges::advance`, `std::ranges::next`, `std::ranges::prev`, and `std::ranges::distance`; as well as `std::default_sentinel` and `std::unreachable_sentinel`.

This change reworks the STL's iterator unwrapping machinery to enable unwrapping of C++20 move-only single-pass iterators (and `if constepxr`s all the things). Consequently, `_Iter_ref_t`, `_Iter_value_t`, and `_Iter_diff_t` resolve to `iter_reference_t`, `iter_value_t`, and `iter_difference_t` (respectively) in `__cpp_lib_concepts` (soon to be C++20) mode. This change necessitates some fixes to `unique_copy` and `_Fill_memset_is_safe` which both assume that `_Iter_value_t<T>` is well-formed for any iterator `T`. (`iter_value_t<T>` does not have that property: it is only well-formed when `readable<T>`.)

I notably haven't unified `default_sentinel_t` with `_Default_sentinel` out of an abundance of paranoia. Our `move_iterator` is comparable with `_Default_sentinel`, which is not the case for `std::default_sentinel`.

Drive-by:
* This change `if constexpr`-izes `unique_copy`.
2019-12-02 15:32:14 -08:00
Charlie Barto 1980e1a295 Add P0553R4 and P0556R3 to <bit> (with D1956 rename) (#310)
Resolves #25 and resolves #26. Currently active for Clang and EDG, but not C1XX.
2019-11-18 23:27:19 -08:00
Adam Bucior c5aaa28e52 P1612R1 Relocating endian To <bit> (#305)
Resolves  #61.
2019-11-18 23:13:38 -08:00
S. B. Tam 6a96a3b0bc STL: Remove !_HAS_EXACT_COMPOUND_REQUIREMENT fallback (#301)
Fixes #299.
2019-11-15 17:16:01 -08:00
Stephan T. Lavavej bfb96b1e12
Update __cpp_lib_concepts (see WG21-P1902). (#287)
This feature-test macro is being extensively queried, so we're updating it with high priority ahead of the other feature-test macro changes in this paper.
2019-11-11 21:25:16 -08:00
Daniel Marshall 1de980c54b P0340R3 SFINAE-Friendly underlying_type (#284)
Resolves #11. Implemented unconditionally.
2019-11-11 21:20:08 -08:00
Daniel Marshall eba6a71983 P0631R8 <numbers> Math Constants (#261)
Resolves #29.
2019-11-11 21:17:34 -08:00
Michael Schellenberger Costa f9b1dccd12 P0738R2 istream_iterator Cleanup (#246)
This change is unconditional.

Resolves #35.
2019-11-07 14:52:26 -08:00
Stephan T. Lavavej 5add7295ed
Enable clang-format AlignConsecutiveMacros. (#269)
* Update `.clang-format` defaults.

* Enable `AlignConsecutiveMacros`, newly supported by clang-format 9.
We often followed this style before using clang-format, and I believe
that it produces generally positive changes.

* Apply clang-format changes.

* Replace `_FITS` and `_NEXT_ALIGN` macros. clang-format didn't damage
them, it just brought them to my attention. These macros weren't
improving clarity, and the code is more systematic without them.
(For the time being, I have refrained from further overhauling the
metaprogramming here.)
2019-11-07 14:43:51 -08:00
SumanjaliDamarla d0d724fb91 Update _MSVC_STL_UPDATE to 201911L (#253)
Fixes #247.
2019-11-04 11:36:54 -08:00
Daniel Marshall 28ec9a3295 P1209R0 erase_if(), erase() (#236)
Resolves #55.

* Deprecate experimental::erase

* Implement P1209R0

* Update yvals_core.h

* Update deprecations and remove <experimental/xutility>

* move and reorder erase/erase_if

* moved _Erase and remove and friends to <xmemory>

* Consistently place erase_if() definitions.
2019-11-01 14:32:39 -07:00
Casey Carter b9eb320940
Update required compiler versions (#231)
* Update required compiler versions

Update required version of MSVC to VS 2019 16.4p2, and Clang/LLVM to 9.0.0.

* Tell `<yvals_core.h>` that Clang 9 implements `consteval` (WG21 hasn't yet defined a feature-test macro for `consteval`)
* Tell `<atomic>` that Clang 9 implements the `__iso_volatile_load64` intrinsic on x86

* Update mentions of VS version in `README.md`
2019-10-29 20:40:09 -07:00
Nathan Ward fb7dba4b19 P0655R1 visit<R>() (#201)
Implements P0655R1 `visit<R>()` 

Resolves #31.
2019-10-25 18:48:15 -07:00
Stanislav Ershov f05c358509 P0767R1 Deprecating is_pod (#179)
Resolves #36.
2019-10-22 17:17:11 -07:00
Nathan Ward 379e61781a P0356R5 bind_front() (#158)
Resolves #13.
2019-10-22 17:15:35 -07:00
Nathan Ward 957fe99f41 P0966R1 string::reserve() should not shrink (#176)
Fixes #42.
2019-10-17 16:06:27 -07:00
Stephan T. Lavavej 712b7971bd
Update comments to follow custom autolink syntax (#168)
* Use custom autolinks.

* Also update .clang-format.

* Use ArchivedOS.
2019-10-11 13:43:06 -07:00
Michael Schellenberger Costa cf55d69c40 P1227R2 Signed std::ssize() (#130)
Fixes #56.
2019-09-26 20:10:40 -07:00
Michael Schellenberger Costa 13fa3d8b0e P1357R1 is_bounded_array, is_unbounded_array (#127)
Fixes #58.
2019-09-26 19:54:23 -07:00
Andrew Fogarty 3ed27b95ce P0439R0 enum class memory_order (#124)
Fixes #17.
2019-09-26 19:51:00 -07:00
Charlie Barto ff7d132b2e
implement P0325R4 to_array (#135) 2019-09-25 19:30:31 -07:00
Casey Carter 6fe5ae883f Suppress warning C4180 STL-wide (#84)
C4180 "qualifier applied to function type has no meaning; ignored" is emitted from `std::remove_reference<T>` when `T` is a function type or reference to such after applying the changes in #82. We could suppress it locally, but the warning is extremely low-value for the STL in general so let's simply suppress it globally.
2019-09-10 20:50:35 -07:00
Casey Carter c5e2e3f799 Ranges <range> machinery
* Implements a selection of support machinery in `std::ranges` and adds the `<ranges>` header. Primarily consists of the range access customization point objects:
  * `ranges::begin`
  * `ranges::end`
  * `ranges::cbegin`
  * `ranges::cend`
  * `ranges::rbegin`
  * `ranges::rend`
  * `ranges::crbegin`
  * `ranges::crend`
  * `ranges::size`
  * `ranges::empty`
  * `ranges::data`
  * `ranges::cdata`

  and range concepts:

  * `ranges::range`
  * `ranges::output_range`
  * `ranges::input_range`
  * `ranges::forward_range`
  * `ranges::bidirectional_range`
  * `ranges::random_access_range`
  * `ranges::contiguous_range`
  * `ranges::sized_range`
  * `ranges::view`
  * `ranges::common_range`

  and the associated type aliases:

  * `ranges::iterator_t`
  * `ranges::sentinel_t`
  * `ranges::range_value_t`
  * `ranges::range_reference_t`
  * `ranges::range_difference_t`
  * `ranges::range_rvalue_reference_t`

* Adds `<ranges>` - which is mostly empty since the support machinery is defined in `<xutility>` so as to be visible to `<algorithm>`

* Annotates [P0896R4](https://wg21.link/p0896r4) as partially implemented in the "`_HAS_CXX20` directly controls" section of `<yvals_core.h>`.

* Touches `<regex>`, `<set>`, and `<unordered_set>` to add partial specializations of `ranges::enable_view` for `match_results` and `(unordered_)?multi?set` as mandated by the WD to override the heuristic.

* Partially implements [P1474R1 "Helpful pointers for `ContiguousIterator`"](https://wg21.link/p1474r1):
  * Push `pointer_traits` from `<xmemory>` and `to_address` from `<memory>` up into `<xutility>`
  * Add `to_address` expression requirement to `contiguous_iterator` concept, and update `P0896R4_ranges_iterator_machinery` appropriately
  * Implement the changes to `ranges::data` (but not `view_interface` since it isn't yet implemented)

* Drive-by:
  * Simplify the definition of `pointer_traits::_Reftype` by eschewing `add_lvalue_reference_t`.
  * Strengthen `reverse_iterator`'s constructors and `make_reverse_iterator` so `ranges::rbegin` and `ranges::rend` can be `noexcept` in more cases
  * Since we're using `_Rng` as the template parameter name for models of `std::ranges::range`, rename a local variable `_Rng` to `_Generator` in `<random>`
2019-09-09 15:31:26 -07:00
Stephan T. Lavavej 219514876e Initial commit. 2019-09-04 15:57:56 -07:00