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

394 Коммитов

Автор SHA1 Сообщение Дата
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 60d9ed7ef4
Allow discarding unique_lock and shared_lock (#1514)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-12-03 15:59:35 -08:00
Stephan T. Lavavej 2dbcfa5799
Allow atomic_ref<const T> (#1500) 2020-12-03 15:47:52 -08:00
Hamid Reza Arzaghi 41330915ac
<regex>: Follow the Standard in regex_traits::transform() (#1494)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-12-03 15:37:34 -08:00
futuarmo 82bb1bf20d
LWG-3117 Missing packaged_task deduction guides (#1493)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-12-03 15:34:01 -08:00
Michael Schellenberger Costa 8516f91a7a
LWG-3448 transform_view's sentinel<false> not comparable with iterator<true> (#1458)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-12-03 15:14:00 -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
Casey Carter 39ee107c95
LWG-3460 Unimplementable noop_coroutine_handle guarantees (#1452)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-12-02 15:06:02 -08:00
statementreply cbd2b1c9b8
<compare>: Improve floating-point spaceship CPO codegen (#1475)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-12-01 15:26:22 -08:00
Sam Huang b4af6e98f8
_NODISCARD for function objects (#1474) 2020-12-01 15:13:35 -08:00
futuarmo a92064eeca
LWG-3211 std::tuple<> should be trivially constructible (#1460)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-12-01 15:00:49 -08:00
Stephan T. Lavavej d06561f891
Code cleanups: Unify _Float_traits and _Floating_type_traits (#1442) 2020-12-01 14:51:25 -08:00
Stephan T. Lavavej 19c683d706
Skip the flaky parts of VSO_0226079_mutex. (#1473) 2020-11-13 18:16:31 -08:00
Michael Schellenberger Costa 560bcea81b
Remove comments for resolved LWG issues (#1456)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-11-13 18:11:08 -08:00
Hamid Reza Arzaghi 9145bf4542
Tests using /analyze:only should also use /analyze:autolog- (#1434) 2020-11-13 17:55:05 -08:00
Stephan T. Lavavej ea156e730c
VS 2019 16.9 Preview 1 toolset update (#1451) 2020-11-13 13:29:26 -08:00
statementreply 9959929c77
<complex>: Improve numerical accuracy of sqrt and log (#935)
* Fix undue overflow and underflow in complex sqrt

Modifies the scale factors in `_Fabs` (used by `sqrt`) such that:

- `_Fabs` doesn't underflow when the input is tiny.

- `sqrt` doesn't overflow when the input is huge.

* Improve accuracy of `log` when |z| is close to 1

When |z| is close to 1, compute log(|z|) as log1p(norm_minus_1(z)) / 2,
where norm_minus_1(z) = real(z) ^ 2 + imag(z) ^ 2 - 1 computed with
double width arithmetic to avoid catastrophic cancellation.

* Fix log(complex{1, tiny}) incorrectly returning -0 under FE_DOWNWARD

Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-11-09 15:24:43 -08:00
Casey Carter 04eca1ccce
hash<coroutine_handle<>>::operator() should be const (#1423)
Fixes #1422.
2020-11-06 16:53:02 -08:00
Casey Carter 231df15261
Always remove_cvref_t the argument to enable_borrowed_range (#1415)
... especially in these view tests.
2020-11-06 16:37:12 -08:00
Casey Carter 537863aefa
Move from rvalue range adaptor closures (#1410) 2020-11-06 16:20:20 -08:00
Michael Schellenberger Costa 7fd6501ece
Implement ranges::elements_view (#1406)
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-11-06 16:08:41 -08:00
Stephan T. Lavavej a6f285db8a
Include <cmeow> instead of <meow.h> (#1405) 2020-11-06 15:34:14 -08:00
Michael Schellenberger Costa 4c3942703e
Implement ranges::take_while_view (#1372)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2020-11-06 15:29:14 -08:00
Michael Schellenberger Costa 1093aa6982
Implement ranges::drop_while_view (#1366)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-11-06 15:23:39 -08:00
Hamid Reza Arzaghi 0650fa4a8d
Prevent crash when custom streambuf implementation throws (#1358)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-11-06 15:16:10 -08:00
MattStephanson 6458199849
<chrono>: [time.duration.io] output (#1341)
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-11-06 14:40:18 -08:00
Curtis J Bezault 9ee552969c
Let's rewrite the test harness (#1394)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-11-06 13:57:46 -08:00
Stephan T. Lavavej 185654c523
Shrink DLL 2% by removing dead code for Windows XP (#1397) 2020-11-03 19:21:30 -08:00
Michael Schellenberger Costa 2380824901
Implement views::counted (#1375) 2020-11-03 19:19:35 -08:00
Michael Schellenberger Costa 332fd32545
Implement ranges::common_view (#1305)
Partially addresses #39.

Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-11-03 18:03:28 -08:00
Stephan T. Lavavej 2b4cf99c04
Update the <ranges> header unit test (#1396) 2020-10-29 15:08:22 -07:00
futuarmo 6e254cf3b6
tr1: Construct initializer_lists with Standard code (#1400)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-10-29 01:13:04 -07:00
Casey Carter 374736a9cc
Fix inconsistencies in range adaptor tests (#1393) 2020-10-29 01:04:18 -07:00
futuarmo 8685c3558c
Changed unsigned to unsigned int due to convention (#1390)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2020-10-29 00:59:58 -07: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
Hamid Reza Arzaghi f6c8d335c4
<xtree>: Fix _Tree move constructor/assignment (#1357)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-29 00:38:16 -07:00
Michael Schellenberger Costa b8bae92add
Implement ranges::istream_view (#1334)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-10-29 00:33:04 -07:00
Hamid Reza Arzaghi 372021d21c
<iomanip>: fixes get_time to parse without delimiters (#1280)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-29 00:19:41 -07:00
Adam Bucior a27d894d63
Use memset in even more cases (#1273)
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-29 00:12:36 -07:00
Casey Carter ae31b78db8
Update LLVM reference (#1090)
Co-authored-by: Curtis Bezault <cubezaul@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-28 23:56:03 -07:00
Stephan T. Lavavej 624efe1a25
Test P1502R1 Standard Library Header Units (#1388) 2020-10-23 00:13:47 -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
Stephan T. Lavavej 830bedae0c
VS 2019 16.8 Preview 4, Python 3.9.0, absolute time fix (#1371)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2020-10-16 23:13:42 -07:00
Casey Carter e7d5113376
Add _CONTAINER_DEBUG_LEVEL checks for optional (#1362)
When `_CONTAINER_DEBUG_LEVEL` is `1` (which is implied by `_ITERATOR_DEBUG_LEVEL != 0`) `optional::operator*` and `optional::operator->` verify the precondition that the `optional` is not empty.

Drive-by: Add a default constructor to `death_test_executive` so we need not construct with a do-nothing function when there are no "normal" tests.

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-10-12 21:30:43 -07:00
Casey Carter 5be862db89
Remove workarounds for several compiler bugs (#1327)
Removes workarounds for:
* VSO-938163 "`constexpr` hates pointers", revealing VSO-1132704 "Bogus C3615 when implicitly-constexpr defaulted SMF calls non-trivial SMF in base class" and VSO-1217687 "Casting object reference to base and back loses track of member values in constant expression" beneath.
* VSO-1002863 "Failure to short-circuit substitution when evaluating disjunction of atomic constraints"
* VSO-1062618 "Asymmetric behavior from conditional operator with char32_t operands"
* VSO-1125263 "EDG rejects valid code using consteval"
* VSO-1132105 "[EDG] Error using non-static data member with dependent type in noexcept-specifier of member function template"
* VSO-1132186 "[EDG] Weirdness with dependent template in noexcept-specifier"
* VSO-1178211 "[EDG] Internal compiler error on template template parameter instantiated from inherited template"

Also relabels the workarounds for VSO-1174090 "Assertion failure for member subobject with multiple prospective destructors" (which is fixed!) as workarounds for VSO-1225825 "ModuleReader doesn't understand concept overloading". 

As a bonus, remove unnecessary workarounds for DevCom-1159442 "type-constraint in deduced variable type fails when immediately following an if statement"; these type-constraints don't follow the _compound-statement_ of an `if` conditional, and so don't trigger the bug.
2020-10-08 18:20:25 -07:00
Casey Carter 20a19e474c
_Node_handle: destroy with value_type allocator (#1310)
Drive-by cleanup:
* explicitly compare pointers  with `nullptr` in preference to `if (ptr)` and `if (!ptr)`
* `_STL_INTERNAL_CHECK` checkable preconditions
* Use `constinit` when available to verify `constexpr` constructor

Fixes #1309.

Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-08 18:01:17 -07:00
Casey Carter 4af65e3756
P0896R4 stream iterator changes (#1281)
Makes `istream_iterator`, `ostream_iterator`, `istreambuf_iterator`, and `ostreambuf_iterator` model the C++20 iterator concepts.
2020-10-08 17:52:46 -07:00
Hamid Reza Arzaghi 740288374f
<iomanip>: std::get_time should not fail when format is longer than the stream (#1326)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-10-05 16:21:27 -07:00
Hamid Reza Arzaghi 02130c4453
<vector>: vector's move ctor should initialize members once (#1330)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-02 20:14:42 -07:00
Russell Johnston 0614c8cc01
Support upstream EDG in the std test suite (#1328) 2020-10-02 20:11:28 -07:00
MattStephanson d05f8ecbb2
<complex>: Fix the pow(complex, arithmetic) overload set (#1299)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-02 19:59:49 -07:00
Casey Carter bb05875900
<functional>: bind_front() should use decayed types to determine its return type (#1293)
Fixes #1292.

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-10-02 19:52:19 -07:00
Hamid Reza Arzaghi a8b62af31f
<random>: Prevent distributions from returning NaN/Inf (#1228)
Co-authored-by: MattStephanson <68978048+MattStephanson@users.noreply.github.com>
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-02 19:36:23 -07:00
statementreply 974582f4dc
<charconv>: Simplify _Assemble_floating_point_value and optimize _Right_shift_with_rounding (#1220)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-10-02 19:25:01 -07:00
MattStephanson c385d02702
<random>: Fix incorrect rounding in rejection method. (#1159)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-10-02 19:11:55 -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
Hamid Reza Arzaghi d0c089e324
<filesystem>: create_directories() should throw for empty paths (#1285) 2020-09-25 16:01:42 -07:00
Hamid Reza Arzaghi 5847f82ed2
<complex>: prevent invalid conversions (#1294) 2020-09-22 18:58:24 -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
Alex Guteniev 648f2b1339
Fix atomic_ref<int8_t>::operator--(int) compiler error (#1303) 2020-09-22 17:50:41 -07:00
Daniel Marshall 8be98779bb
Fix two VS 2019 16.8 Preview 3 blocked issues (#1291)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-09-22 17:44:31 -07:00
Casey Carter 7a9998cb08
Account for C++17 deferred temporary materialization in invocable_r (#1282)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-09-22 17:30:43 -07:00
Stephan T. Lavavej d49e401dad
Use constexpr is_sorted, add charconv tests, update comments (#1278) 2020-09-22 17:18:44 -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
Michael Schellenberger Costa 5f4bc22450
Implement ranges::uninitialized_meow (#1164)
Implement several specialized memory range algorithms:
* `ranges::uninitialized_default_construct`, `ranges::uninitialized_default_construct_n`
* `ranges::uninitialized_value_construct`, `ranges::uninitialized_value_construct_n`
* `ranges::uninitialized_fill`, `ranges::uninitialized_fill_n`
* `ranges::uninitialized_copy`, `ranges::uninitialized_copy_n`
* `ranges::uninitialized_move_n`

Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-09-22 16:44:22 -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
Stephan T. Lavavej 5f3e91211a
VS 2019 16.8 Preview 3 toolset update (#1290)
* VSO-1035737 has been fixed.

* Update toolset to VS 2019 16.8 Preview 3.
2020-09-15 21:09:02 -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
Casey Carter 0e4f6b5df4
Revert "Revert "Implement common_iterator (#1092)" (#1265)" (#1268)
This reverts commit 6156ec32d5.
2020-09-15 20:57:30 -07:00
Igor Zhukov be0441cda1
enforce "non-array trivial standard-layout" for basic_string and basic_string_view (#1262) 2020-09-04 18:53:39 -07:00
Casey Carter 4f72f78574
Implement views::transform (#1258) 2020-09-04 18:52:22 -07:00
Casey Carter 0c2007a67b
Implement views::take and views::drop (#1253)
Also implements the proposed resolution of LWG-3481.
2020-09-04 17:20:27 -07:00
Casey Carter 6156ec32d5
Revert "Implement common_iterator (#1092)" (#1265)
This reverts commit 30e7a1bab3.
2020-09-04 15:58:20 -07:00
Casey Carter 37cd02e718
Implement views::filter (#1252) 2020-09-04 12:36:02 -07:00
Casey Carter 8c85c6a763
P1391R4 "Range Constructor for string_view" (#1245) 2020-09-04 11:47:15 -07:00
Casey Carter fcd8a6272d
Implement ranges::partial_sort and ranges::partial_sort_copy (#1231)
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
2020-09-04 11:32:51 -07:00
Adam Bucior d6f32c889d
Use memset and memcmp in a bit more cases (#1160)
Fixes #1183.

Co-authored-by: Alex Guteniev <gutenev@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-09-04 11:21:21 -07:00
Michael Schellenberger Costa 30e7a1bab3
Implement common_iterator (#1092)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2020-09-04 11:12:50 -07:00
Casey Carter d19446293a
Implement non-concepts fallback for coroutine_handle operator<=> (#1249)
* Implement non-concepts fallback for coroutine_handle operator<=>

... to allow EDG to compile `<coroutine>`. [This is a dual of MSVC-PR-271029.]

* Reorder feature-tests in `<experimental/generator>`

... so it won't notice that Edge defines both `__cpp_impl_coroutine` and `__cpp_coroutines` in C++20 mode.

Also don't test `VSO_0971246_legacy_await_headers` with `/BE /await`; `/await` is meaningless for Edge.
2020-09-02 12:15:57 -07:00
Casey Carter e652e72bdf
Implement views::all and views::reverse (#1229)
* Implement views:all and views::reverse

Also, perma-workaround LLVM-37556.

Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
2020-08-31 21:07:00 -07:00
Alex Guteniev 3b2956b18e
Latch, Semaphore, Barrier (part of #52, P1135R6) (#1057) 2020-08-31 20:57:17 -07:00
Stephan T. Lavavej b90b3e05d2
Fix locale test for older OSes (#1240) 2020-08-27 20:45:49 -07:00
Casey Carter ed4a1ed5bc
Avoid triggering GH-1030 in P0896R4_ranges_alg_equal (#1239) 2020-08-27 20:43:49 -07:00
Stephan T. Lavavej c74ab69ced
VS 2019 16.8 Preview 2 toolset upgrade (#1233)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-08-26 17:12:53 -07:00
Stephan T. Lavavej ab6cbd3ea3
LWG-1203 More useful rvalue stream insertion (#1225) 2020-08-26 00:51:43 -07:00
Casey Carter 7b0167c84a
Implement views::empty and views::single range factories (#1201) 2020-08-26 00:25:43 -07:00
Hamid Reza Arzaghi ea1aaf76cb
get_time() should ignore case when parsing days and months (#1168)
Fixes #1126.

Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-08-26 00:13:30 -07:00
Stephan T. Lavavej 484fbc9742
Test <coroutine> (#1215)
Co-authored-by: Jonathan Emmett <joemmett@microsoft.com>
2020-08-21 20:02:42 -07:00
Casey Carter 7a7602cb0f
Limit line length to 120 columns (#1214)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-08-21 19:53:55 -07:00
Casey Carter 8ee6e65d0f
Fix counted_iterator unwrapping bug (#1213) 2020-08-21 19:49:15 -07:00
Stephan T. Lavavej 22d061b732
Update test configurations (remove /await and skips, add missing options) (#1207) 2020-08-21 19:42:41 -07:00
Hamid Reza Arzaghi 0926c8282c
Add test to cover deque::erase(iter, iter) avoiding self-move-assigns (#1203)
Fixes #1176.
2020-08-21 19:38:00 -07:00
statementreply 0b81475cc8
Fix ostream << floating_point not correctly handling precision (#1173)
1. Hexfloat output now ignores precision as required by the standard. (Fixes #1125.)
2. Zero precision is now correctly passed to sprintf.
3. Negative precision no longer crashes.
2020-08-21 19:20:19 -07:00
MattStephanson 465d0a5e13
Fix errors in hyperbolic function crossover (#1156)
Fix integer truncation and off-by-one errors in calculating limit where
exp(-x) can be ignored in hyperbolic functions.
2020-08-21 19:12:27 -07:00
Michael Schellenberger Costa aafee761bc
Implement ranges::ref_view (#1132)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-08-21 19:04:33 -07:00
Casey Carter 54be1fd1f0
STL updates for new EDG version (#1216)
Small changes to help the new IntelliSense compiler better work with the concepts-using C++20 STL.

Drive-by: Avoid `/analyze:only` run timeouts in two Ranges tests that weren't quite exhausting memory.
2020-08-21 12:06:34 -07:00
Stephan T. Lavavej 3cca47387b
Update __cpp_lib_coroutine. (#1204) 2020-08-18 13:00:00 -07:00
Casey Carter 130696300d
Correct issues from investigation of VSO-938163 (#1191) 2020-08-17 17:59:46 -07:00
Alex Guteniev 3de20f9120
Test _Countl_zero_bsr with a dedicated test (#1166)
Resolves #1120.

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-08-17 17:56:05 -07:00
statementreply 9fb6caa54c
<charconv>: fix from_chars("0.fffffffffffff8p-1022") (#934)
Fixes #931.
2020-08-17 17:45:53 -07:00
Alex Guteniev e7451b3f9d
test_atomic_wait.hpp: remove another timing assumption (#1193) 2020-08-14 14:35:49 -07:00
Casey Carter 02bf0cf685
/std:c++latest configs are /permissive or /permissive- (#1162)
So our test coverage won't be damaged when the compiler changes `/std:c++latest` to imply `/permissive-`. I do so by adding `/permissive-` to every `/std:c++latest` command line that doesn't yet have it, and then reverting one configuration in each matrix to `/permissive`. It seems sensible to me that the majority of our coverage should change from permissive to strict mode to reflect the change in compiler default.
2020-08-14 14:33:13 -07:00
Michael Schellenberger Costa 1e42166b78
Implement counted_iterator (#1083)
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-08-14 14:27:53 -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
Casey Carter ae1068e07b
<deque>: Use _Next_iter and _Prev_iter (#1161) 2020-08-12 12:51:26 -07:00
Casey Carter 7f29487be5
Implement ranges::uninitialized_move (#1137) 2020-08-12 12:47:52 -07:00
Casey Carter 4ce746ca4e
Implement ranges::sort (#1127) 2020-08-12 12:45:48 -07:00
statementreply 3224307ff6
<random>: Fix parameter initialization of piecewise_constant_distribution and piecewise_linear_distribution (#1032) 2020-08-12 12:37:36 -07:00
Alex Guteniev bdf7710249
wait/notify atomic<shared_ptr<T>> (#52, P1644R0) (#1136)
Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
2020-08-09 15:38:59 -07:00
Casey Carter af3db68781
partial_sort_copy bugfix (#1088)
Fixes #1086.
2020-08-09 15:28:43 -07:00
Casey Carter eb33f1a1e9
Implement ranges::lexicographical_compare (#1081) 2020-08-09 15:07:00 -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
Jonathan Caves e000d3feaf
Disable a libcxx test due to the impact of P0960R3 (#1138)
Disable some tests due to impact of P0960R3: allow initializing aggregates from a parenthesized list of values
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-08-05 14:36:08 -07:00
Casey Carter 5d00b606b4
Implement ranges::merge (#1101) 2020-08-05 00:09:55 -07:00
Casey Carter 0eb754dedd
Implement ranges::next_permutation and ranges::prev_permutation (#1099) 2020-08-05 00:02:21 -07:00
Casey Carter 622b62a777
Implement ranges::reverse_copy (#1095)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-08-04 23:51:25 -07:00
Alex Guteniev b74b6188b2
Remove timing assumption that causes test to fail spuriously (#1129) 2020-08-03 13:40:04 -07:00
Stephan T. Lavavej 12c684bba7
Cleanup std qualification and old bug citations (#1119) 2020-08-01 18:35:54 -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 a712fe5042
Enable tests Dev09_172666_tr1_tuple_odr and VSO_0000000_matching_npos_address (#1109) 2020-08-01 16:53:44 -07:00
Stephan T. Lavavej 57db210e30
Fix weak_ptr conversions, preserving control blocks for expired objects (#1104)
Fixes #1102.
2020-08-01 16:36:24 -07:00
Casey Carter e2912b6e48
Implement ranges::ssize (#1076) 2020-08-01 16:19:09 -07:00
Casey Carter e58a94505b
Implement ranges::nth_element (#1063) 2020-08-01 16:08:38 -07:00
Michael Schellenberger Costa accaf18978
Modernize ranges::swap_ranges and ranges::distance (#1062)
Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-08-01 16:03:08 -07:00
Michael Schellenberger Costa 1ff3d1ef11
Optimize fill and fill_n for vector<bool> (#879)
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-08-01 15:58:39 -07:00
ArtemSarmini 0381c25b10
<type_traits>: is_function simplification (#460)
Fixes #198.

Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-08-01 15:29:40 -07:00
Michael Schellenberger Costa 58a8a39b51
Implement ranges::rotate and ranges::rotate_copy (#1073)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-07-29 21:11:32 -07:00
Casey Carter 30777d5adf
Fix thinko in ranges::iter_swap (#1072)
...by transposing arguments to `_Iter_exchange_move`.

Fixes #1067
2020-07-29 20:57:47 -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
Alex Guteniev 0e7b5d2509
<valarray>: Implement copies for slice_array, gslice_array, mask_array, and indirect_array (#988)
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-29 20:30:29 -07:00
Casey Carter 35ce1cf44a
Fix the interaction between _Pass_fn and invoke (#1091)
`_Pass_fn` returns a copy of arguments no larger than `void*`, and a call-forwarding reference-wrapper-alike `_Ref_fn` for larger function objects. This became a problem when Ranges started throwing pointers-to-member at `_Pass_fn` with the expectation that they would eventually be `invoke`d: pointers-to-member can be larger than `void*`, but `_Ref_fn` doesn't speak the `invoke` protocol.

There are two relatively obvious possible fixes:
1. Teach `_Pass_fn` to always return copies of pointers-to-member regardless of size
2. Teach `_Ref_fn` to obey the `invoke` protocol

(1) results in "large" pointers-to-member that can't be enregistered being copied and passed by hidden reference resulting in larger codesize than (2), but with no corresponding performance benefits. We therefore implement (2) by teaching `_Ref_fn` to call-forward through `invoke` when it wraps a pointer-to-member.

Fixes GH-1089.
2020-07-28 15:34:37 -07:00
Casey Carter 868cf267a0
Implement ranges::move_backward (#1053)
* Implement ranges::move_backward

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
2020-07-28 15:31:55 -07:00
Casey Carter 3659f3dc18
Implement Ranges Set Operations (#1044)
Includes the `mergeable` concept and algorithms `ranges::includes`, `ranges::set_union`, `ranges::set_intersection`, `ranges::set_difference`, and `ranges::set_symmetric_difference`.
2020-07-28 15:26:06 -07:00
Stephan T. Lavavej b2f1556d2a
Update .clang-format for Clang 10 (#1075)
* Remove unnecessary comments in ranges tests.

We taught clang-format how to sort like this automatically.

* Fix x86 compiler error in stljobs.h.

This never compiled for x86 where size_t and SIZE_T are different types.

* Update .clang-format for Clang 10.

AllowShortBlocksOnASingleLine changed from false/true to
Never/Empty/Always. We still want the default of Never, as Empty
appears to misbehave.

DeriveLineEnding was added, defaulting to true. We want to disable line
ending auto-detection.

SortPriority was added. Its documentation is difficult to understand,
but it can be used to group includes together while modifying their
otherwise-lexicographic ordering. Here, I'm using it to group WinSDK
includes together, while still sorting WinIoCtl.h last.

IncludeIsMainSourceRegex was added. This doesn't appear to be relevant
to us.

IndentGotoLabels was added. We've avoided goto.

SpaceInEmptyBlock was added. We prefer the default of no space.

SpacesInConditionalStatement was added. We definitely prefer the
default of no space.

SpaceBeforeSquareBrackets was added. Again, we definitely prefer the
default of no space.

The Standard option was overhauled. Previously, Cpp11 meant "use the
latest supported standard". That was confusing, so it has been
deprecated in favor of Latest.

UseCRLF was added. We currently use CRLF for all files. (Previously,
validate.cpp would detect LF files, but clang-format wouldn't fix
them.)

* In .clang-format, delete empty lines and move comment.

The empty lines were intended to make it easier to see customized
options, but they were actually making it harder to diff the default
config against our config.

Move the StatementMacros comment next to our customized settings,
and rewrap it.

* Reformat filesystem.cpp.
2020-07-27 11:38:12 -07:00
Michael Schellenberger Costa fc3df2f5b1
Modernize ranges::all_of and friends (#1061) 2020-07-27 11:34:50 -07:00
Michael Schellenberger Costa 5ada43e908
Modernize ranges::for_each (#1060) 2020-07-27 11:33:40 -07:00
Michael Schellenberger Costa 98f37c302a
Modernize the ranges::find family (#1058)
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-07-27 11:28:04 -07:00
Michael Schellenberger Costa 99241dce6d
Implement ranges::sample and ranges::shuffle (#1052)
Co-authored-by: statementreply <statementreply@gmail.com>
2020-07-27 11:25:42 -07:00
Michael Schellenberger Costa 28efc70584
Implement ranges::unique family (#1039)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-07-27 11:22:29 -07:00
statementreply 8e8770cb16
<random>: Fix discrete_distribution result out of range (#1025)
Mathematically, `_Par0._Pcdf.back()` should be one. However, when it is
actually slightly smaller than one due to rounding error, there is a
small probability that `_Px > _Par0._Pcdf.back()` and the original code
returns the invalid value of `_Par0._Pcdf.size()`.
2020-07-27 11:17:11 -07:00
pawREP 1555e0b861
Vectorize reverse_copy() (#804)
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-27 11:06:41 -07:00
Alex Guteniev c10ae01b4d
Atomic CAS with pad (#23, P0528R3) (#1029)
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-07-21 01:00:51 -07:00
Casey Carter 7930d3512f
<compare>: Fix 0 <=> partial_ordering::unordered (#1049)
* Break <compare> ABI again, and fix #1050.

* Remove obsolete conditional compilation from <compare>.

Co-authored-by: statementreply <statementreply@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-20 16:54:04 -07:00
Casey Carter 4f949afa0e
Implement ranges::reverse (#1028)
Co-authored-by: Ahana Mukhopadhyay <t-ahmukh@microsoft.com>
2020-07-20 16:45:04 -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
Christian Fersch 0965adad9a
Use permissive wide-to-narrow transcoding in filesystem_error (#1010) 2020-07-16 22:06:09 -07:00
Michael Schellenberger Costa 16db9931be
Implement ranges::remove family (#1005) 2020-07-16 22:03:12 -07:00
Michael Schellenberger Costa 002cdc65a9
Implement ranges::transform (#941)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-07-16 21:54:37 -07:00