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

396 Коммитов

Автор SHA1 Сообщение Дата
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
Michael Schellenberger Costa f49ffafb5d
Uglify the current member of move_iterator (#1080) 2020-07-27 11:42:15 -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
Billy O'Neal 6c044964f8
<system_error> Enable [[msvc::noop_dtor]] from Visual Studio 2019 version 16.8. (#1016)
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-21 00:55:06 -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
Stephan T. Lavavej 8fcc25fe97
Update vcpkg to 2020.06. (#1042) 2020-07-14 15:24:09 -07:00
Michael Schellenberger Costa f357e2c3cb
Implement ranges::replace, ranges::replace_copy, ranges::replace_copy_if (#983)
Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-11 16:59:25 -07:00
Stephan T. Lavavej 294355d4fa
Provide comparison operators for map/set/etc. instead of _Tree (#1022)
Fixes #215.
2020-07-11 15:42:17 -07:00
Stephan T. Lavavej a09bfc7696
Code cleanup: Brace for impact (#1020)
* Change meow<>() to meow<>{}.

* Change meow<>{} to meow{} when C++17 has CTAD.
2020-07-11 15:39:24 -07:00
Casey Carter 6d441a10f4
Implement most ranges partition algorithms (#976)
Includes `ranges::is_partitioned`, `ranges::partition`, `ranges::partition_copy`, and `ranges::partition_point`.
2020-07-11 15:30:17 -07:00
Michael Schellenberger Costa 672bcb29a6
Modernize ranges::count_if (#975) 2020-07-11 15:05:45 -07:00
Michael Schellenberger Costa c99a4f32d7
Modernize ranges::count (#974)
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-07-11 14:56:07 -07:00
Michael Schellenberger Costa 1f0f88f946
Modernize ranges::move (#970)
Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-07-11 14:52:39 -07:00
Michael Schellenberger Costa 215ec06bf6
Modernize ranges::copy_if (#958)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-11 14:47:22 -07:00
Michael Schellenberger Costa d31b0c7bdb
Remove invalid overload of ranges::copy_n (#957)
Co-authored-by: Casey Carter <cartec69@gmail.com>
2020-07-11 14:38:25 -07:00
Michael Schellenberger Costa d1cae3aeef
Modernize ranges::copy (#956)
Co-authored-by: Casey Carter <Casey@Carter.net>
2020-07-11 14:26:56 -07:00
ahanamuk ee6019de81
Implement ranges::generate and ranges::generate_n (#905)
Co-authored-by: Casey Carter <Casey@Carter.net>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-11 14:20:10 -07:00
Stephan T. Lavavej 8ead4f61b5
Disable /analyze in concepts_matrix.lst. (#1031)
This is a temporary workaround for #1030 to unblock ranges PRs.
2020-07-11 14:11:30 -07:00
Casey Carter 550713eba2
Update VM Scale Set to VS 2019 Preview 3 (#1015)
* Update the Azure VM Scale Set that runs the CI pipeline to VS 2019 Preview 3
* Install the `psutil` python module while provisioning VMs (Fixes #773)

Co-authored-by: Curtis Jacques Bezault <curtbezault@gmail.com>
2020-07-08 16:46:25 -07:00
Casey Carter d531112e1e
Correct naked `if constexpr` in C++14 mode (#1011)
Fixes VSO-1152720.
2020-07-07 14:25:22 -07:00
Casey Carter 896e137c52
Style cleanup of requires\s*\( (#999)
* Style cleanup of `requires\s*\(`

To consistently follow the guidelines established in #982.

Fixes #982.
2020-07-07 14:24:04 -07:00
God-father1 89c3b4910c
Update _MSVC_STL_UPDATE for July 2020 (#989) 2020-07-07 14:21:55 -07:00
Alex Guteniev 7253921718
Use new 64-bit interlocked intrinsics on x86 (#986)
* Use new 64-bit interlocked intrinsics on x86

Resolves #965.

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-07-07 14:15:51 -07:00
Michael Schellenberger Costa aac7b3fbb1
Implement ranges::replace_if (#984) 2020-07-07 14:11:49 -07:00
Michael Schellenberger Costa ed5698b003
Avoid name ambiguities in Ranges test machinery (#979)
We get errors due to ambiguous symbols of `test::iterator` and `std::iterator` (thanks `using namespace std;`!)
Explicitly pull in `test::iterator` and `test::range` as well for good measure.
2020-07-07 14:11:08 -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
Casey Carter 37f5689197
Cleanup `using _Pred` and `using operator<` comments (#977)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2020-07-07 14:05:59 -07:00
Alex Guteniev 5be7d49c24
Revert #653 "<chrono>: Cache QPF() and divide just once" (#972)
This reverts commit ad1a26ad97 which was later modified by #694.

Fixes #971.

Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2020-07-02 18:52:44 -07:00
Casey Carter 43851a5892
Updates to Ranges test machinery (#959)
* Replace "base" member of test::iterator and test::sentinel with "peek"

* The point is to break the abstraction and provide access to the internal pointer. There's no reason to mimic the behavior of iterator/sentinel adaptors, it just makes the test tool harder to use.

* Enforce that `begin` is called at most once in `test::range::_Unchecked_begin`

* Remove default arguments to the `test_meow` functions in `<range_algorithm_support.hpp>`.

* ...and swap_ranges, of course.
2020-07-02 18:40:21 -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
Casey Carter 585583b54c
Implement ranges heap algorithms (#930)
`ranges::is_heap`, `ranges::is_heap_until`, `ranges::make_heap`, `ranges::push_heap`, `ranges::pop_heap`, and `ranges::sort_heap`.
2020-07-02 07:36:30 -07:00
DailyShana 3d7fa78426
Implement LWG-3070 (#923) 2020-07-02 07:29:34 -07:00
ahanamuk 9b248c7041
Implement ranges::swap_ranges (#918) 2020-07-02 07:27:54 -07:00
ahanamuk 123b2b2bfa
Implement ranges::fill and ranges::fill_n (#904) 2020-07-02 07:24:14 -07:00