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

396 Коммитов

Автор SHA1 Сообщение Дата
Charlie Barto 5e3423a377
MSVC <bit> (#795)
Adds MSVC support to the `<bit>` functions.
2020-07-01 20:27:49 -07:00
Stephan T. Lavavej afcf7b608d
Implement noop_coroutine(). (#961) 2020-07-01 18:29:27 -07:00
Charlie Barto 5ef22f2a88
update cgmanifest.json (#936)
Co-authored-by: Charles Barto <barto.charlie@gmail.com>
2020-06-30 11:45:00 -07:00
Casey Carter 3f6c715563
Cleanup: remove unneeded [[maybe_unused]] annotations (#920)
... from variables that are used only on some `if constexpr` branches.
2020-06-29 22:40:14 -07:00
Casey Carter ac5c8b006a
Implement the "binary search" ranges algorithm family (#917)
Includes `ranges::lower_bound`, `ranges::upper_bound`, `ranges::equal_range`, and `ranges::binary_search`.
2020-06-29 22:40:00 -07:00
Casey Carter c114d51fd1
Implement ranges min/max/minmax algorithms (#916)
* `ranges::min` (direct, `range`, and `initializer_list` overloads)
* `ranges::max` (direct, `range`, and `initializer_list` overloads)
* `ranges::minmax` (direct, `range`, and `initializer_list` overloads)
* `ranges::min_element` (`range` only)
* `ranges::max_element` (`range` only)
* `ranges::minmax_element` (`range` only)
* `ranges::clamp` (direct only)

Implements concept `indirectly_copyable_storable`, and adds test coverage for both that concept and `indirectly_movable_storable`.
2020-06-29 22:39:38 -07:00
Casey Carter 021af3e68e
Implement ranges::search_n (#914) 2020-06-29 22:39:10 -07:00
Alex Guteniev bc077c64f3
Use __iso_volatile_store64 for relaxed atomics on x86, and use __iso_volatile_store64 unconditionally (#694) 2020-06-29 21:36:59 -07:00
Casey Carter 81d88bd8e4
Implement ranges::is_sorted and ranges::is_sorted_until (#915) 2020-06-27 06:48:15 -07:00
Casey Carter 9d95c4e9b7
Implement std::permutable and std::sortable (#925) 2020-06-27 06:47:46 -07:00
statementreply 5b49a88058
LWG-2597 std::log misspecified for complex numbers (#884)
Use `_Abs` and `_Copysign` instead of branching on `x < 0`, correctly treating negative zero as a negative number. This matters when branch cuts of a complex function lies on the real or the imaginary axis, where the results for positive zero and negative zero are different.

For negative real number `x`, `pow(x - 0i, y)` and `pow(x + 0i, y)` are different:
```
pow(x - 0i, y) = exp(y * log(x - 0i)) = exp(y * (log(|x|) - πi))
pow(x + 0i, y) = exp(y * log(x + 0i)) = exp(y * (log(|x|) + πi))
```
Thus `pow(complex, real)` can't simply return `_Pow(real, real)` when the imaginary part of the base is negative zero.

Also modifies `pow(complex, complex)` to be consistent with `pow(real, complex)` when the base is a positive real number.
2020-06-27 06:46:01 -07:00
Stephan T. Lavavej 4deaf6cb27
More code cleanups in stl/src (#912) 2020-06-24 01:31:54 -07:00
Casey Carter 3c139980b6
Implement ranges::search (#896)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-06-24 00:54:23 -07:00
Stephan T. Lavavej c8144e3a03
Require VS 2019 16.7 Preview 2 or later. (#911) 2020-06-24 00:12:51 -07:00
Berrysoft 5d4f4afbed
Fix std::pow's "sufficient additional overloads" (#903)
Fixes #890.

Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-06-23 23:53:04 -07:00
Casey Carter f1515e04fd
Internal headers have extension .hpp (#902) 2020-06-23 23:45:44 -07:00
Casey Carter 70d23a16a6
Implement ranges::is_permutation (#892)
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-06-23 23:35:02 -07:00
Michael Schellenberger Costa 569efaba62
Simplify span's representation (#877)
Fixes #874.

Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-06-23 23:26:27 -07:00
Daniel Marshall de3edf22b2
P0896R4_P1614R2_comparisons/test.cpp: Increase test coverage for MSVC (#852)
Fixes #741.

Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-06-23 23:15:38 -07:00
Stephan T. Lavavej 0c34074955
tests: Avoid dialog boxes, prevent stdout from being lost (#906)
Fixes GH-781 (dialogs) and fixes GH-789 (stdout).
2020-06-20 00:28:45 -07:00
Casey Carter 65df32eb73
Implement ranges::_Ubegin and ranges::_Uend CPOs (#901)
Fixes #898.
2020-06-20 00:21:42 -07:00
Stephan T. Lavavej 5813b85aa2
Code cleanups in stl/src (#900) 2020-06-20 00:10:56 -07:00
Casey Carter 7c0310e1d3
Cleanup ranges test machinery (#899) 2020-06-20 00:03:17 -07:00
Hikmat Farhat 44c22f30ac
Updated _MSVC_STL_UPDATE macro (#897)
Fixes #895.
2020-06-19 23:58:24 -07:00
ahanamuk e507f7de17
<algorithm>: Implemented ranges::move (#888)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-06-19 23:50:20 -07:00
Curtis J Bezault 42a82716f5
Update VMSS pool to VS 2019 16.7 Preview 2 (#851) 2020-06-19 23:38:02 -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
Casey Carter c64e60bae8
The problem with Clang's tgmath.h is now tracked as LLVM-46207 (#881) 2020-06-11 14:12:01 -07:00
Casey Carter 2b0aa05918
<optional>: Don't zero storage in default constructor (#878)
* <optional>: Don't zero storage in default constructor

Providing a minor runtime and codesize benefit.
2020-06-11 14:10:57 -07:00
Casey Carter cff9e842fc
Rework test_range/test_iterator Ranges test machinery (#875)
* Rework test_range/test_iterator Ranges test machinery

These were previously compile-only tools intended for instantiation tests, but they can now adapt a contiguous sequence of elements into a range with specified properties for runtime testing. Nest in namespace `test` as `test::range` and `test::iterator`. Add `test::sentinel` to use with `test::iterator` to make non-`common_range`s. `test::iterator` and `test::range` now enforce valid combinations of parameters instead of silently ignoring inconsistencies. `test::iterator`/`test::sentinel` now have "wrapped" and "unwrapped" variations to test use of unwrapping machinery in the Range algorithms. `move_only_range` is now a special case of `test::range`. Adds new test `std/P0896R4_ranges_test_machinery` for this stuff since it's getting complicated.

* Unnest test::proxy_iterator so wrapped and unwrapped proxy iterators can have the same reference type

* More refinement:
* flesh out `proxy_reference`
* make element type configurable in instantiation machinery
* give `test::iterator` proper moves
* tiny bit of test coverage

* Name some bools
2020-06-11 14:05:20 -07:00
Sumit Bhardwaj aae2fd2f0a
Fix not unlocking and relocking in condition_variable_any::wait_for (#685) 2020-06-11 14:02:52 -07:00
Stephan T. Lavavej 7447ad59d6
Link with /MANIFEST:EMBED to avoid UNRESOLVED tests (#862)
Fixes #811.
2020-05-29 19:06:09 -07:00
Billy O'Neal c6e0592c14
Use a cryptographically secure RNG to generate admin passwords. (#868) 2020-05-29 17:56:49 -07:00
Stephan T. Lavavej 40c3f1fe9a
Code cleanup: avoid macro-like identifiers, remove double newlines (#865) 2020-05-29 17:51:28 -07:00
Stephan T. Lavavej d103c08c50
tests: Note unsupported locales, but don't warn. (#866)
Fixes #855.
2020-05-29 17:48:30 -07:00
Stephan T. Lavavej 191b184004
_CONSTEXPR20 _Copy_s, simplify char8_t compare. (#861) 2020-05-29 17:41:49 -07:00
Casey Carter 3ad64fc201
<variant>: silence useless warning (#858) 2020-05-29 17:37:02 -07:00
Alex Guteniev c4c482105a
<execution>: comment early return control flow (#849)
Fixes #818.
2020-05-29 17:33:46 -07:00
Adam Bucior ba739dc6a2
LWG-3018 `shared_ptr` of function type (#833)
Resolves #539.

Co-authored-by: Alex Guteniev <gutenev@gmail.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-05-29 17:28:09 -07:00
Michael Schellenberger Costa afaac161be
Modernize and extend _Equal_memcmp_is_safe (#831)
Fixes #819.

Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-05-29 17:21:48 -07:00
Charlie Barto fca84933a5
Add /Zc:preprocessor to our tests (#677) 2020-05-29 17:15:04 -07:00
Michael Schellenberger Costa 212de15c59
P1032R1 Miscellaneous constexpr (#491) 2020-05-23 00:03:27 -07:00
Michael Schellenberger Costa ff947563da
Enable span tests now that libc++ has been updated (#839)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-05-18 17:45:54 -07:00
Casey Carter 588dd39de4
LWG-3446 now has a number (#841) 2020-05-18 17:42:53 -07:00
Bhumij Gupta 66b0885e30
Fix P0067R5_charconv/test.cpp as C++20 adds std::chrono::last (#837) 2020-05-18 17:40:52 -07:00
Stephan T. Lavavej 4e30363272
Add charconv test cases (#835)
* Fix GH-331 "<charconv>: Test plain shortest's large integer fallback".

* Add rounding test cases.
2020-05-18 17:36:13 -07:00
Stephan T. Lavavej 809a908e50
Fix #842 "GitHub: Workflow automation is failing". (#847)
Revert "Use a GitHub Workflow to automate Code Reviews Project (#829)"

This reverts commit ed2ba34997.
2020-05-18 17:34:13 -07:00
Curtis J Bezault ed2ba34997
Use a GitHub Workflow to automate Code Reviews Project (#829) 2020-05-15 14:05:37 -07:00
Casey Carter 0e4c6412df
Allow both ::value_type and ::element_type in indirectly_readable_traits (#834)
Per [readable.traits], `indirectly_readable_traits<T>::value_type` is the same type as `remove_cv_t<T::value_type>` if it denotes an object type, or `remove_cv_t<T::element_type>` if it denotes an object type. If both `T::value_type` and `T::element_type` denote types, `indirectly_readable_traits<T>::value_type` is ill-formed. This was perhaps not the best design, given that there are iterators in the wild (Boost's unordered containers) that define both nested types. `indirectly_readable_traits` should tolerate iterators that define both nested types consistently.

Fixes VSO-1121031.
2020-05-15 09:48:14 -07:00
Stephan T. Lavavej e76f500cb3
Code cleanups (#827) 2020-05-14 15:58:54 -07:00