* Update to Clang 10 and Visual Studio 2019 version 16.6p2
* re-clang-formats the tree to comply with new clang 10 clang-format
* updates our agents to F series VMs which are faster and cheaper for our build workloads
* defaults scale set to 0 VMs and lets the Azure Pipelines service control all resizing
* fix tests to pass with the new compilers
Co-authored by Casey Carter and Curtis Bezault
* Removes VSO-406237 "C1XX does not do constant initialization where the standard requires" workarounds.
* Introduce `_Immortalize_memcpy_image` which avoids the need for synchronization when constructing the error categories. See the big comment block for explanation of how we got here. For compilers which let us declare instances with the empty virtual destructor as constexpr variables (currently only clang in C++20 mode), we can avoid the workaround.
* Turn on `/Zc:threadSafeInit-` and warning 4640 in most tests to ensure we aren't emitting thread-local initializers in `<system_error>`.
* Move `_Immortalizer` and friends to the one remaining caller in the `exception_ptr` implementation.
* Remove `_Generic_error_category` from the base class hierarchies of error categories to workaround DevCom-928781.
Includes:
* concepts `three_way_comparable` and `three_way_comparable_with`,
* type trait `std::compare_three_way_result` (with `_t` alias), and
* function object `compare_three_way`.
in `<compare>`, and:
* function objects `ranges::equal_to` and `ranges::less` (in `<xutility>` for
easy algorithm access), `ranges::not_equal_to`, `ranges::less_equal`,
`ranges::greater`, and `ranges::greater_equal` (in `<functional>`),
* slight refactoring of concept definitions in `<concepts>` to avoid redundant
requirements for the single-type comparison concepts `equality_comparable`,
`totally_ordered`, and `three_way_comparable`,
* heavy refactoring of the trait `common_comparison_category` (and `_t` alias)
in `<compare>` to requires only `n + c` template instantiations instead of `cn`
template instantiations,
* ======== ABI BREAK =========== remove the `_Is_unordered` member from
`std::partial_ordering` in `<compare>` since (a) it's true if and only if the
stored value has a particular value, and (b) Clang expects all of the
comparison category types to have size 1,
* reorder all `is_transparent` alias declarations in the STL to be after the
corresponding `operator()` to agree with synopsis order.
Also adds a new test `P0896R4_P1614R2_comparisons` that exercises the above.
The ABI BREAK sounds scary - as it should - but note that:
* this is a `/std:c++latest` feature, which is subject to change,
* objects of comparison category type aren't typically stored,
* only MSVC has released `<compare>` so far, so it's not widely used.
Altogether, it's extremely unlikely that anyone has encoded this in ABI.
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`.
Fixes#187.
Add TRANSITION comments for #248 and #249, blocked by compiler bugs.
Add `_Enabled` names. When we don't have `enable_if_t`, this makes the
template parameter's purpose clearer. When we do have `enable_if_t`
but without `= 0`, this makes it somewhat clearer that we haven't
forgotten the default argument (it's simply elsewhere).
* 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>`