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

94 Коммитов

Автор SHA1 Сообщение Дата
Stephan T. Lavavej d9d7bd808e Fix #339: WG21-P1902 Missing Feature-Test Macros 2017-2019 2019-12-04 20:21:54 -08:00
Stephan T. Lavavej 664adab3ab Fix #335: LWG-3257 Missing feature testing macro update from WG21-P0858 2019-12-04 20:21:54 -08:00
Stephan T. Lavavej bb41688bb1 Fix #70: LWG-3199 istream >> bitset<0> fails 2019-12-04 20:21:54 -08:00
Stephan T. Lavavej b01023144a Fix #332: LWG-3266 to_chars(bool) should be deleted 2019-12-04 20:21:54 -08:00
Casey Carter d42d1cd2a5 Hide std::unreachable_sentinel_t's friends harder (#352)
Hidden friends aren't hidden in C1XX's permissive mode, so let's use an alternate mechanism to make these operators truly ADL-only. (We want to avoid checking `weakly_incrementable` for every type that is compared via `==` or `!=` with a type associated with namespace `std`.)
2019-12-04 20:20:56 -08:00
Casey Carter 40017205af Improve diagnostic for std::function<void() noexcept> (#350)
Programs that include such specializations are ill-formed, since the Standard only specifies a partial specialization of `std::function<T>` for non-`noexcept` function types `T`. The current diagnostic:
```
error C2027: use of undefined type 'std::_Get_function_impl<_Fty>'
```
is not great.

Fixes DevCom-825902.

[This is a replay of Microsoft-internal MSVC-PR-215822.]
2019-12-04 20:20:28 -08:00
Krystyna Lopez 20adb42ae3 Change return type from non-const to const (#324)
Addresses #268 by changing the implementation to match the current Standardese.
2019-12-04 20:17:48 -08:00
S. B. Tam 1d39dfac99 Implement P1690R1 Refining Heterogeneous Lookup For Unordered Containers (#341)
* Implement P1690R1 Refining Heterogeneous Lookup For Unordered Containers

* Mark P1690R1 as implemented in yvals_core.h.
2019-12-02 20:34:31 -08:00
Stephan T. Lavavej c82f9a5c2f
The latest C++ Working Draft is now WG21-N4842. (#346) 2019-12-02 19:38:57 -08:00
Casey Carter 1e8b8d4eef
[range.iter.ops], default_sentinel, and unreachable_sentinel (#329)
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`.
2019-12-02 15:32:14 -08:00
Billy O'Neal a4034496ee
Use on/off SFINAE in std::function when not blocked by compiler bugs. (#244)
Xiang Fan of the C1XX frontend team reported that this improved throughput in a customer submitted benchmark.
2019-12-02 14:36:53 -08:00
Stephan T. Lavavej 8f4c816377
Simplify thread0.cpp and xthrow.cpp. (#320)
* Simplify thread0.cpp and xthrow.cpp.

I verified with `#error` that these files are always compiled with
`_HAS_EXCEPTIONS=1`.

thread0.cpp
Include only necessary headers.

Move the lookup tables within `_STD_BEGIN` to avoid repeated `_STD`
qualification. They're `static`, so this doesn't affect bincompat.

Add trailing commas for readability.

Make `codes` a table of `errc` so we don't need to cast each value.

Mark `_Throw_Cpp_error` as `[[noreturn]]`, matching its declaration
in the header. (No bincompat effect.)

Use `_THROW` for consistency. (Even though exceptions are enabled,
we conventionally use this in `src`.)

`system_error` is a type, so we don't need to `_STD` qualify it.

`static_cast<int>` the `errc`, once.

xthrow.cpp
Coalesce headers. Coalesce `std` regions.

Remove unnecessary comments.

Mark value parameters as const.

* Add constexpr.
2019-11-20 17:10:23 -08:00
Charlie Barto 1980e1a295 Add P0553R4 and P0556R3 to <bit> (with D1956 rename) (#310)
Resolves #25 and resolves #26. Currently active for Clang and EDG, but not C1XX.
2019-11-18 23:27:19 -08:00
Adam Bucior c5aaa28e52 P1612R1 Relocating endian To <bit> (#305)
Resolves  #61.
2019-11-18 23:13:38 -08:00
Julie Philip James 580e61a5f5 Marked _Doraise() functions as override (#302)
Improves #207.
2019-11-15 17:20:06 -08:00
S. B. Tam 6a96a3b0bc STL: Remove !_HAS_EXACT_COMPOUND_REQUIREMENT fallback (#301)
Fixes #299.
2019-11-15 17:16:01 -08:00
Krystyna Lopez 1648f3de58 <algorithm>: Use iter[idx] for clarity (#289)
Fixes #278.
2019-11-15 17:07:14 -08:00
Stephan T. Lavavej 58bb49d63d
Improve the PR and issue templates (#288)
* Simplify paths in ISSUE_TEMPLATE.md.

* Mention WG21 papers and LWG issues in PR template.

* Exclude reference implementations.

* Increase clang-format timeout to 60 minutes.
2019-11-12 17:12:22 -08:00
Stephan T. Lavavej bfb96b1e12
Update __cpp_lib_concepts (see WG21-P1902). (#287)
This feature-test macro is being extensively queried, so we're updating it with high priority ahead of the other feature-test macro changes in this paper.
2019-11-11 21:25:16 -08:00
Michael Schellenberger Costa 10f1c819cc Use unqualified function calls for valarray (#286)
* Use unqualified function calls for valarray

The transcend functions require that the function is applied unqualified to each element

* Add comments to unqualified calls.

Fixes #285.
2019-11-11 21:23:24 -08:00
Daniel Marshall 1de980c54b P0340R3 SFINAE-Friendly underlying_type (#284)
Resolves #11. Implemented unconditionally.
2019-11-11 21:20:08 -08:00
Daniel Marshall eba6a71983 P0631R8 <numbers> Math Constants (#261)
Resolves #29.
2019-11-11 21:17:34 -08:00
Michael Schellenberger Costa f9b1dccd12 P0738R2 istream_iterator Cleanup (#246)
This change is unconditional.

Resolves #35.
2019-11-07 14:52:26 -08:00
Stephan T. Lavavej 5add7295ed
Enable clang-format AlignConsecutiveMacros. (#269)
* Update `.clang-format` defaults.

* Enable `AlignConsecutiveMacros`, newly supported by clang-format 9.
We often followed this style before using clang-format, and I believe
that it produces generally positive changes.

* Apply clang-format changes.

* Replace `_FITS` and `_NEXT_ALIGN` macros. clang-format didn't damage
them, it just brought them to my attention. These macros weren't
improving clarity, and the code is more systematic without them.
(For the time being, I have refrained from further overhauling the
metaprogramming here.)
2019-11-07 14:43:51 -08:00
Stephan T. Lavavej 66b1e235af
Add .vscode/settings.json. (#263)
This file is gitignored, so it will provide default settings that can
be further customized without showing up as pending changes.

It enables `editor.formatOnSave` to help with clang-format enforcement.

It sets `files.eol` to CRLF and enables `files.insertFinalNewline`,
`files.trimFinalNewlines`, and `files.trimTrailingWhitespace` to help
with whitespace enforcement.

It uses `files.associations` to mark our extensionless headers as C++.

It excludes the `stl/msbuild` subdirectory (which isn't used by the
GitHub repo, and is doomed soon). It also excludes the `vcpkg`
submodule, to prevent its files from showing up in Quick Open (Ctrl+P).
2019-11-07 14:31:22 -08:00
Stephan T. Lavavej d9cf06ead0
Move vcpkg_windows.txt to azure-devops. (#262)
`azure-devops/run_build.yml` is the only thing that uses
`vcpkg_windows.txt`, so I don't believe that it belongs
in the root of the repo.
2019-11-06 15:26:50 -08:00
Stephan T. Lavavej 58c5c4d628
Make enforce-clang-format.cmd also run `git diff`. (#255)
* Make `enforce-clang-format.cmd` also run `git diff`. This will produce more informative output for clang-format failures.
* Also add timeouts to every task in `run_build.yml`.
* Also remove default `targetPlatform` from `run_build.yml`. This is provided by `azure-pipelines.yml`.
2019-11-05 15:09:45 -08:00
Daniel Marshall 9d635aaef7 Use consistent phrasing of required standard mode (#252)
Fixes #250.
2019-11-05 13:12:34 -08:00
SumanjaliDamarla d0d724fb91 Update _MSVC_STL_UPDATE to 201911L (#253)
Fixes #247.
2019-11-04 11:36:54 -08:00
Michael Schellenberger Costa 3b0a1c9cfa Consistently use "int = 0" SFINAE (#226)
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).
2019-11-01 18:15:37 -07:00
Daniel Marshall 28ec9a3295 P1209R0 erase_if(), erase() (#236)
Resolves #55.

* Deprecate experimental::erase

* Implement P1209R0

* Update yvals_core.h

* Update deprecations and remove <experimental/xutility>

* move and reorder erase/erase_if

* moved _Erase and remove and friends to <xmemory>

* Consistently place erase_if() definitions.
2019-11-01 14:32:39 -07:00
Billy O'Neal 389066634b
Remove delay comment in PR template because we've been merging PRs (#243)
* Remove delay comment in PR template because we've been merging PRs.

* Add readme.md note, and change "CI" to "automated testing" in checklist.

* Also remove statement from readme.md.
2019-10-31 18:39:31 -07:00
Casey Carter 1d094330aa
<compare> implement == for comparison categories (#242)
WG21-P1614 "The Mothership has Landed" added `==` operators to the comparison category types (`weak_equality`, `strong_equality`, `partial_ordering`, `weak_ordering`, and `strong_ordering`) defined in `<compare>`. This PR implements those operators to bring the comparison category types up to spec once again. It also implements P1614R2's removal of operators that rewrite into calls to `operator==(X, nullptr_t)` for each comparison category type `X`.

Drive-by changes:
* Move the TODO list of tasks for WG21-P0768 "Library Support for the Spaceship (Comparison) Operator" completion out of `<compare>` and into microsoft/STL#64
* Remove the `#if 0 // Not yet implemented` block from `<compare>`
2019-10-31 17:37:56 -07:00
Stephan T. Lavavej d736fe46b9
Update cgmanifest.json and README.md. (#238)
* Replay MSVC internal PR 209928.

* README.md: Capitalize Preview.
2019-10-30 19:06:27 -07:00
Stephan T. Lavavej 9c1c63cd26
Enforce ASCII and whitespace conventions (#229)
Fixes #141.

* Change LF to CRLF.
* Remove UTF-8 BOMs.
* Add validate.cpp.
* Add validate to CMakeLists.txt.
* Add validate to azure-devops.
* Wrap enforce-clang-format.cmd.
* Code review feedback: abort().
* Code review feedback: Assign previous3.
* Code review feedback: Don't catch everything.
* Code review feedback: MaxErrorsForDisallowedCharacters.
* Cleanup: Remove `enabled: true`.
* Code review feedback: Character code comments.
* Code review feedback: Allow certain files to be tabby.
* Code review feedback: Use native wchar_t paths.
2019-10-30 16:22:33 -07:00
Casey Carter b9eb320940
Update required compiler versions (#231)
* Update required compiler versions

Update required version of MSVC to VS 2019 16.4p2, and Clang/LLVM to 9.0.0.

* Tell `<yvals_core.h>` that Clang 9 implements `consteval` (WG21 hasn't yet defined a feature-test macro for `consteval`)
* Tell `<atomic>` that Clang 9 implements the `__iso_volatile_load64` intrinsic on x86

* Update mentions of VS version in `README.md`
2019-10-29 20:40:09 -07:00
Billy O'Neal f4f3acde83
Avoid self-move-assign of all elements in vector when erasing an empty range. (#228)
Resolves DevCom-776568.
2019-10-28 19:41:58 -07:00
Billy O'Neal 5bf80b41d1
Use casts for most common atomic cases (#227)
Resolves #85 / DevCom-706195

Casey applying the new atomic implementation fixed us breaking the
strict aliasing rules, but the memcpy is causing a code size regression
for non-`/Oi` customers. This change should restore code size for the
most common uses of atomic, which are `atomic<integral>` and
`atomic<pointer>`.
2019-10-28 15:49:58 -07:00
Julie Philip James 04cf94886a Changed TODO comments to TRANSITION comments (#221)
Fixes #200.
2019-10-27 14:12:14 -07:00
Christian Deneke 99b75ab51d Move nlsdownlevel.h into winapinls.cpp (#220)
Fixes #188.
2019-10-27 14:04:30 -07:00
Nathan Ward fb7dba4b19 P0655R1 visit<R>() (#201)
Implements P0655R1 `visit<R>()` 

Resolves #31.
2019-10-25 18:48:15 -07:00
Krystyna Lopez a69a00e33b Fix #218 - remove public redundancy (#219) 2019-10-25 11:26:59 -07:00
Billy O'Neal 6b0238d703
Changes made from update to clang-format to 9.0.0. (#205) 2019-10-24 16:47:28 -07:00
Nathan Ward 447f879b13 LWG-2899 is_(nothrow_)move_constructible and tuple, optional, and unique_ptr (#193)
Resolves #68.
2019-10-22 17:50:05 -07:00
Nathan Ward a7d9526804 LWG-3158 tuple(allocator_arg_t, const Alloc&) should be conditionally explicit (#195)
Resolves #69.
2019-10-22 17:25:38 -07:00
Stanislav Ershov f05c358509 P0767R1 Deprecating is_pod (#179)
Resolves #36.
2019-10-22 17:17:11 -07:00
Nathan Ward 379e61781a P0356R5 bind_front() (#158)
Resolves #13.
2019-10-22 17:15:35 -07:00
Stephan T. Lavavej 1e4f423120
Update README and PR template (#194)
* README.md: New Working Draft N4835.

* Simplify pull_request_template.md.

We can remove the N/A guidance by updating
the two checkboxes that are commonly N/A.

Remove the "feature has been voted into the WP" checkbox.
We haven't had issues with people submitting non-Standard PRs,
and the README's Non-Goals section clearly explains
our acceptance criteria.

For the `_Ugly` checkbox, allow people to check it
if there aren't any product code changes at all.
2019-10-21 13:12:13 -07:00
Nathan Ward 957fe99f41 P0966R1 string::reserve() should not shrink (#176)
Fixes #42.
2019-10-17 16:06:27 -07:00
Stephan T. Lavavej 53cdb9f8a8
Fix #94 and remove compiler bug workarounds. (#175)
* Properly comment "Tukey's ninther".

* Remove workarounds for VSO-946746.

VSO-946746 "conditional explicit(bool) doesn't work with /clr:pure"
was fixed on 2019-07-23, and should be available in
VS 2019 16.4 Preview 1.

* Remove workarounds for VSO-433486.

VSO-433486 "_Count / 2 inside while (0 < _Count) loop is not
transformed into a simple shift" was fixed on 2019-08-27
and should be available in VS 2019 16.4 Preview 2.

Some shifts are still necessary, and are now commented.

* This mirrors a Microsoft-internal PR:
https://devdiv.visualstudio.com/DevDiv/_git/msvc/pullrequest/207988
2019-10-15 16:49:36 -07:00