Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2321R2: Added std::views::zip. #3035

Merged
merged 116 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
6585715
Added the std::views::zip implementation.
tylerbrawl Aug 15, 2022
1982609
Fixed some rather sneaky errors.
tylerbrawl Aug 15, 2022
2c8a884
Executed a ClangFormat formatting pass.
tylerbrawl Aug 15, 2022
c3eb358
Moved most implementation details into a different namespace.
tylerbrawl Aug 15, 2022
efe0b06
Added a work-around for P2165R4.
tylerbrawl Aug 16, 2022
6eacd17
Fixed a minor bug with distance calculation.
tylerbrawl Aug 16, 2022
4c3f04a
Fixed Clang compilation errors.
tylerbrawl Aug 16, 2022
ed15aca
Fixed more Clang compilation errors.
tylerbrawl Aug 16, 2022
05a9cfb
Removed excessive use of _STD and _RANGES.
tylerbrawl Aug 16, 2022
dc66136
Removed _Zip::_Tuple_or_pair in favor of std::tuple.
tylerbrawl Aug 16, 2022
409d39a
Fixed some formatting errors.
tylerbrawl Aug 16, 2022
8932d3b
Fixed formatting (for real this time).
tylerbrawl Aug 16, 2022
7ae33ec
Removed the speculative feature test macro.
tylerbrawl Aug 16, 2022
77c6141
Refactored the implementation to remove recursion.
tylerbrawl Aug 16, 2022
972a5be
Fixed some Clang compilation errors.
tylerbrawl Aug 16, 2022
c0f46a6
Merge pull request #1 from tylerbrawl/recursive-removal
tylerbrawl Aug 16, 2022
4c97a8d
Reinstated the __cpp_lib_ranges_zip feature test macro.
tylerbrawl Aug 16, 2022
2c59b35
Added __cpp_lib_ranges_zip to the VSO_0157762 test.
tylerbrawl Aug 16, 2022
389fe1c
Updated the implemented feature list in yvals_core.h.
tylerbrawl Aug 16, 2022
e7e4eb5
Update stl/inc/yvals_core.h
tylerbrawl Aug 17, 2022
70e2e38
Applied suggested changes from code review 1.
tylerbrawl Aug 17, 2022
ea0a6e6
Applied a formatting pass.
tylerbrawl Aug 17, 2022
6a6007f
Merge pull request #2 from tylerbrawl/code-review-1
tylerbrawl Aug 17, 2022
c28843d
Removed _Zip::_Allow_views.
tylerbrawl Aug 17, 2022
f9cc980
Moved and renamed member variables for conformance.
tylerbrawl Aug 17, 2022
ccf498e
Added const for difference_type parameters.
tylerbrawl Aug 17, 2022
443cf75
Merge pull request #3 from tylerbrawl/code-review-1
tylerbrawl Aug 17, 2022
2413a20
Moved _Iterator_type further up in _Sentinel.
tylerbrawl Aug 17, 2022
96ee337
Merge pull request #4 from tylerbrawl/code-review-1
tylerbrawl Aug 17, 2022
1f726e4
Added the relevant files.
tylerbrawl Aug 17, 2022
3705dfb
Merge branch 'main' into test-suite
tylerbrawl Aug 17, 2022
baeb38b
Added the first real set of tests.
tylerbrawl Aug 20, 2022
48b3405
Added back commented tests.
tylerbrawl Aug 20, 2022
40a1d45
Added back even more commented tests.
tylerbrawl Aug 20, 2022
b641627
Merge pull request #5 from tylerbrawl/test-suite
tylerbrawl Aug 20, 2022
586f9fd
Fixed some formatting errors.
tylerbrawl Aug 20, 2022
7ccfb04
Merge pull request #6 from tylerbrawl/test-suite
tylerbrawl Aug 20, 2022
837533f
Added [[no_unique_address]] comments.
tylerbrawl Aug 20, 2022
88c48f6
Merge pull request #7 from tylerbrawl/test-suite
tylerbrawl Aug 20, 2022
cab2d65
Reduced the number of generated tests.
tylerbrawl Aug 20, 2022
6dc5ad2
Merge pull request #8 from tylerbrawl/test-suite
tylerbrawl Aug 20, 2022
2b95bcb
Added the std::views::zip test to test.lst.
tylerbrawl Aug 20, 2022
c1ceef0
Merge pull request #9 from tylerbrawl/test-suite
tylerbrawl Aug 20, 2022
394c41d
Update tests/std/tests/P2321R2_views_zip/test.cpp
tylerbrawl Aug 20, 2022
9616eac
Applied some suggested style changes to test.cpp.
tylerbrawl Aug 20, 2022
63b8d91
Merge pull request #10 from tylerbrawl/test-suite-style
tylerbrawl Aug 20, 2022
da8e159
Merge remote-tracking branch 'upstream/main' into pr/tylerbrawl/3035
strega-nil Aug 24, 2022
a5a5fa2
fix reference to P2165R4
strega-nil Aug 24, 2022
51f67cd
Applied strega-nil-ms' first set of changes.
tylerbrawl Aug 30, 2022
c3f859a
Applied cpplearner's suggested changes.
tylerbrawl Aug 30, 2022
32ce22e
Defined _Iterator and _Sentinel inline.
tylerbrawl Aug 30, 2022
1d7176a
Renamed _Ranges to _Views in zip_view.
tylerbrawl Aug 30, 2022
ec9e878
Applied some minor changes.
tylerbrawl Aug 30, 2022
1c5ca01
Applied more trivial code review suggestions.
tylerbrawl Aug 31, 2022
6800ec2
Added the remainder of strega-nil-ms' suggestions.
tylerbrawl Aug 31, 2022
95db9fd
Added namespace qualifiers to iter_move and iter_swap calls in test.cpp.
tylerbrawl Sep 1, 2022
dff0535
Added clarification for the use of the strict testing matrix.
tylerbrawl Sep 1, 2022
b6f717e
Added back some removed tests.
tylerbrawl Sep 1, 2022
b30cb70
Merge pull request #11 from tylerbrawl/code-review-2
tylerbrawl Sep 1, 2022
7721522
Fixed some formatting errors.
tylerbrawl Sep 1, 2022
63c06c3
Merge pull request #12 from tylerbrawl/code-review-2
tylerbrawl Sep 1, 2022
5647852
Applied some more suggestions.
tylerbrawl Sep 15, 2022
003a62a
Fixed some missing test code paths.
tylerbrawl Sep 18, 2022
37a0fb2
Modified yvals_core for consistency.
tylerbrawl Sep 18, 2022
a0bebe7
Removed explicit `std::` prefixes in the test code.
tylerbrawl Sep 18, 2022
9ed6849
Fixed a ridiculous formatting error.
tylerbrawl Sep 18, 2022
3cf01cb
Merge pull request #13 from tylerbrawl/code-review-3
tylerbrawl Sep 18, 2022
6d2ebbc
Modularized the zip test to fix compiler crashed and increase through…
tylerbrawl Sep 19, 2022
9d15eb0
Fixed the return type of a function.
tylerbrawl Sep 19, 2022
b454a76
Merge pull request #14 from tylerbrawl/code-review-3
tylerbrawl Sep 19, 2022
c62bf57
Even the .lst files need formatting...
tylerbrawl Sep 19, 2022
2dd2f08
Merge pull request #15 from tylerbrawl/code-review-3
tylerbrawl Sep 19, 2022
e2b8fa3
Merge branch 'microsoft:main' into main
tylerbrawl Sep 19, 2022
f5000ee
Added `_EXPORT_STD` for the `std` module.
tylerbrawl Sep 20, 2022
d261bb8
Merge pull request #16 from tylerbrawl/modules-support
tylerbrawl Sep 20, 2022
364c7e3
Moved `_Zip_fn` into `std::views` for consistency with `_Meow_fn`.
tylerbrawl Sep 20, 2022
b724bd0
Merge pull request #17 from tylerbrawl/zip-fn-in-views
tylerbrawl Sep 20, 2022
ddba898
CRs
strega-nil Sep 26, 2022
d8a63a5
lambda -> closure
strega-nil Sep 26, 2022
8d58992
algorithm was, in fact, required.
strega-nil Sep 26, 2022
fc8c01e
Merge branch 'microsoft:main' into main
tylerbrawl Oct 15, 2022
586e1eb
Moved `ranges::max` and `ranges::min` to `<xutility>`.
tylerbrawl Oct 15, 2022
664930c
Implemented suggested changes from StephenTLavavej.
tylerbrawl Oct 15, 2022
22ca087
Fixed some compilation errors found in testing.
tylerbrawl Oct 15, 2022
dfb5a2e
Merge pull request #18 from tylerbrawl/code-review-4
tylerbrawl Oct 15, 2022
2e05705
I forgot to format the test suite...
tylerbrawl Oct 15, 2022
972baec
Merge pull request #19 from tylerbrawl/code-review-4
tylerbrawl Oct 15, 2022
5ed5d17
Revert an accidental LLVM update...
tylerbrawl Oct 15, 2022
f5a90ce
Merge pull request #20 from tylerbrawl/code-review-4
tylerbrawl Oct 15, 2022
ead1f72
Added most libc++ tests for zip_view.
tylerbrawl Oct 16, 2022
40ef315
Merge pull request #21 from tylerbrawl/code-review-4
tylerbrawl Oct 16, 2022
b8b9ccd
Add missing semicolon.
StephanTLavavej Oct 18, 2022
ae02fa3
Sort by iterator strength.
StephanTLavavej Oct 18, 2022
282af2f
Mirror changes to skipped_tests.txt.
StephanTLavavej Oct 18, 2022
e4d1a99
Remove clang-format suppression, no changes or improved formatting.
StephanTLavavej Oct 18, 2022
c73ebf8
Use _Off and _Where instead of _STD declval<difference_type>().
StephanTLavavej Oct 18, 2022
28096b9
Use lvalue references so declval will match the expressions.
StephanTLavavej Oct 18, 2022
455bb9d
Omit unnecessary `inline`.
StephanTLavavej Oct 18, 2022
c56cb2b
Use zip_view's injected-class-name.
StephanTLavavej Oct 18, 2022
181f8b7
Use more _Maybe_const in _Is_end_noexcept.
StephanTLavavej Oct 18, 2022
a2f6298
Add _NODISCARD to _Zip_fn's _Is_invocation_noexcept and operator().
StephanTLavavej Oct 18, 2022
b088079
Include more headers.
StephanTLavavej Oct 18, 2022
c935e50
Simplify with min(initializer_list).
StephanTLavavej Oct 18, 2022
3c6625d
Avoid unnecessary copies by taking const array&.
StephanTLavavej Oct 18, 2022
e8963f0
Style: Omit parens in return.
StephanTLavavej Oct 18, 2022
0c804a6
Naming: Take `ranges` plural.
StephanTLavavej Oct 19, 2022
6b59620
Add missing as_const to as_const(zipped_range).size().
StephanTLavavej Oct 19, 2022
66fcece
Remove forced wrapping and suppression; clang-format 15 does a good job.
StephanTLavavej Oct 19, 2022
7b2e4b1
Remove hyphen from "postfix", add "the".
StephanTLavavej Oct 19, 2022
450cb3e
Reorder LocalZipType before ArrayType to match function parameters.
StephanTLavavej Oct 19, 2022
02bd609
The primary template range_type_solver<IsMoveOnly> should be the true…
StephanTLavavej Oct 19, 2022
31e6d91
Style: Use braces to construct temporary tuple.
StephanTLavavej Oct 19, 2022
fa55122
Fix and test noexcept strengthening.
StephanTLavavej Oct 19, 2022
ae9175e
Work around VSO-1655299 "C1XX Assertion failed: HasAnyErrors() || Has…
StephanTLavavej Oct 22, 2022
00c33f0
Perma-workaround VSO-1655455 "C1XX Assertion failed: FATAL_UNREACHABL…
StephanTLavavej Oct 22, 2022
573b546
Work around VSO-1655459 'C1XX Assertion failed: !"If lookup found RDS…
StephanTLavavej Oct 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
439 changes: 0 additions & 439 deletions stl/inc/algorithm

Large diffs are not rendered by default.

487 changes: 487 additions & 0 deletions stl/inc/ranges

Large diffs are not rendered by default.

439 changes: 439 additions & 0 deletions stl/inc/xutility

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,15 @@
// P1989R2 Range Constructor For string_view
// P2077R3 Heterogeneous Erasure Overloads For Associative Containers
// P2136R3 invoke_r()
// P2165R4 Compatibility Between tuple, pair, And tuple-like Objects
// (changes to views::zip only)
// P2166R1 Prohibiting basic_string And basic_string_view Construction From nullptr
// P2186R2 Removing Garbage Collection Support
// P2273R3 constexpr unique_ptr
// P2291R3 constexpr Integral <charconv>
// P2302R4 ranges::contains, ranges::contains_subrange
// P2321R2 zip
// (changes to pair, tuple, and vector<bool>::reference only)
// (missing views::zip_transform, views::adjacent, and views::adjacent_transform)
// P2387R3 Pipe Support For User-Defined Range Adaptors
// P2417R2 More constexpr bitset
// P2438R2 string::substr() &&
Expand Down
44 changes: 18 additions & 26 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ std/containers/unord/unord.set/insert_and_emplace_allocator_requirements.pass.cp
# Bogus test believes that copyability of array<T, 0> must be the same as array<T, 1>
std/containers/sequences/array/array.cons/implicit_copy.pass.cpp FAIL

# Bogus test returns a non-const int& using a const iterator's member variable
std/ranges/range.adaptors/range.zip/end.pass.cpp FAIL

# libc++ doesn't implement LWG-3648: "format should not print bool with 'c'"
std/utilities/format/format.functions/vformat_to.locale.pass.cpp FAIL
std/utilities/format/format.functions/vformat_to.pass.cpp FAIL
Expand All @@ -55,6 +58,21 @@ std/strings/basic.string/string.nonmembers/string_op+/allocator_propagation.pass
# libc++ hasn't updated move_iterator for P2520R0
std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp FAIL

# libc++ doesn't implement LWG-3692: "zip_view::iterator's operator<=> is overconstrained"
std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp FAIL

# libc++ is incorrect on the constraints for constructors of zip_view::iterator and zip_view::sentinel
std/ranges/range.adaptors/range.zip/begin.pass.cpp SKIPPED
std/ranges/range.adaptors/range.zip/sentinel/ctor.default.pass.cpp SKIPPED

# libc++ has not implemented P2165R4: "Compatibility between tuple, pair, and tuple-like objects"
# for zip_view
std/ranges/range.adaptors/range.zip/cpo.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp FAIL


# *** INTERACTIONS WITH CONTEST / C1XX THAT UPSTREAM LIKELY WON'T FIX ***
# Tracked by VSO-593630 "<filesystem> Enable libcxx filesystem tests"
Expand Down Expand Up @@ -192,32 +210,6 @@ std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp SKIPPED
# P2321R2 zip
std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp FAIL
std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/begin.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/borrowing.compile.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/cpo.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/ctad.compile.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/ctor.views.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/end.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/general.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/ctor.other.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/decrement.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/increment.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/iter_move.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/iter_swap.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/singular.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/range.concept.compile.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/sentinel/ctor.default.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/sentinel/ctor.other.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/sentinel/eq.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/sentinel/minus.pass.cpp FAIL
std/ranges/range.adaptors/range.zip/size.pass.cpp FAIL

# P2255R2 "Type Traits To Detect References Binding To Temporaries"
std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp FAIL
Expand Down
1 change: 1 addition & 0 deletions tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ tests\P2273R3_constexpr_unique_ptr
tests\P2302R4_ranges_alg_contains
tests\P2302R4_ranges_alg_contains_subrange
tests\P2321R2_proxy_reference
tests\P2321R2_views_zip
tests\P2387R3_bind_back
tests\P2387R3_pipe_support_for_user_defined_range_adaptors
tests\P2401R0_conditional_noexcept_for_exchange
Expand Down
13 changes: 13 additions & 0 deletions tests/std/tests/P2321R2_views_zip/env.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# NOTE: zip_view::_Iterator defines ADL overloads for iter_swap and iter_move,
# so the test fails to compile unless /permissive- is set. This issue isn't
# unique to zip_view; all view types whose iterators define overloads for these
# functions have this requirement.
RUNALL_INCLUDE ..\strict_concepts_latest_matrix.lst
RUNALL_CROSSLIST
PM_CL="/DTEST_INPUT"
PM_CL="/DTEST_BIDIRECTIONAL"
PM_CL="/DTEST_FORWARD"
PM_CL="/DTEST_RANDOM"
Loading