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>
`_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.
Includes the `mergeable` concept and algorithms `ranges::includes`, `ranges::set_union`, `ranges::set_intersection`, `ranges::set_difference`, and `ranges::set_symmetric_difference`.
* 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.
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()`.
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>
* 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>
* 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>
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.
* 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.
* 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.