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

Implement P2505R5 Monadic Functions For std::expected #3361

Merged
merged 54 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
408091d
Implement P2505R5 Monadic Functions for std::expected
TartanLlama Jan 25, 2023
d5ac1ae
Merge branch 'main' of https://github.com/microsoft/STL
TartanLlama Jan 25, 2023
30d8417
Clang format
TartanLlama Jan 25, 2023
d70650e
Correct type traits
TartanLlama Jan 25, 2023
5429dea
Fix copy paste errors
TartanLlama Jan 25, 2023
fb3af74
Test constexpr
TartanLlama Jan 25, 2023
1bb9f01
Update test paths
TartanLlama Jan 25, 2023
0bf5fc7
Update test paths
TartanLlama Jan 25, 2023
c859ed5
Feature test macro
TartanLlama Jan 25, 2023
4757c75
Remove this->
TartanLlama Jan 26, 2023
e80e0a3
Rename test variables
TartanLlama Jan 26, 2023
54f2c16
Add const to tests
TartanLlama Jan 26, 2023
f8ec9af
Update test expectations for libc++
TartanLlama Jan 26, 2023
6ec9f92
Revert optional test change
TartanLlama Jan 26, 2023
fad0972
Remove std qualification
TartanLlama Jan 26, 2023
c9118c2
Clang format
TartanLlama Jan 26, 2023
8152435
Update expected and skipped results
TartanLlama Jan 30, 2023
8a25911
Remove extra newlines
TartanLlama Jan 30, 2023
d79e935
Change test matrix
TartanLlama Jan 30, 2023
d1af894
Change typename to class
TartanLlama Jan 30, 2023
5d208a6
Change static assert message to reflect standard
TartanLlama Jan 30, 2023
0a5d866
Change static assert message to reflect standard
TartanLlama Jan 30, 2023
ad69aa5
Remove bad ref qualifier from function type
TartanLlama Jan 30, 2023
fbf5e81
Fix standards citations
TartanLlama Jan 30, 2023
302de13
Merge branch 'main' of github.com:TartanLlama/STL
TartanLlama Jan 30, 2023
46c2340
Fix more citations
TartanLlama Jan 30, 2023
fadf2f4
Fix more standards citations
TartanLlama Jan 30, 2023
1cedf67
Fix more standards citations
TartanLlama Jan 30, 2023
c76f98f
Remove && from type trait arguments which will go through declval
TartanLlama Jan 30, 2023
ac441f4
Add static_asserts for and_then
TartanLlama Jan 30, 2023
ab446ed
Correct slashes
TartanLlama Jan 30, 2023
51e2279
Fix syntax error
TartanLlama Jan 31, 2023
2bf4e1c
Remove unnecessary default constructor in test
TartanLlama Jan 31, 2023
d1fe692
Use =default instead of {} in test
TartanLlama Jan 31, 2023
292847d
Assert that error_type is int in tests
TartanLlama Jan 31, 2023
a2acbdb
Fix incorrect comment locations
TartanLlama Feb 1, 2023
cc7436f
Fix noexcept specifications
TartanLlama Feb 1, 2023
211ec58
Guard temporary materialisation bugs
TartanLlama Feb 1, 2023
ef5a116
Improve transform and transform_error diagnostics
TartanLlama Feb 1, 2023
5a9e4d4
Casey's review comments
CaseyCarter Feb 2, 2023
c175fe6
Add test for error_or({})
TartanLlama Feb 7, 2023
42e91d2
Merge branch 'main' of github.com:TartanLlama/STL
TartanLlama Feb 7, 2023
57818d6
Address video review comments
TartanLlama Feb 7, 2023
ba9ef72
clang-format
CaseyCarter Feb 8, 2023
cc9376e
Add spaces when wrapping string literals.
StephanTLavavej Feb 10, 2023
a502b40
Cite [expected.void.monadic].
StephanTLavavej Feb 10, 2023
e8e5b8a
Enforce the error_type mandates for expected<void, E>::and_then.
StephanTLavavej Feb 10, 2023
0495ad3
Throughput-optimize invocation with no args, add comments.
StephanTLavavej Feb 10, 2023
da08d2c
BRACES FOR THE BRACE THRONE!
StephanTLavavej Feb 10, 2023
096ace6
Improve citation consistency.
StephanTLavavej Feb 10, 2023
393faff
Add assert(result) and assert(!result) for consistency.
StephanTLavavej Feb 10, 2023
28df789
Use a unique value 2000.
StephanTLavavej Feb 10, 2023
68dd1d3
Merge branch 'main' into monadic_expected
StephanTLavavej Feb 10, 2023
b08896c
Correct "equivalent to invoke()" comments
CaseyCarter Feb 10, 2023
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
843 changes: 809 additions & 34 deletions stl/inc/expected

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
// P2474R2 views::repeat
// P2494R2 Relaxing Range Adaptors To Allow Move-Only Types
// P2499R0 string_view Range Constructor Should Be explicit
// P2505R5 Monadic Functions For expected
// P2549R1 unexpected<E>::error()
// P2602R2 Poison Pills Are Too Toxic

Expand Down Expand Up @@ -1679,7 +1680,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect

#ifdef __cpp_lib_concepts
#define __cpp_lib_containers_ranges 202202L
#define __cpp_lib_expected 202202L
#define __cpp_lib_expected 202211L
#endif // __cpp_lib_concepts

#define __cpp_lib_forward_like 202207L
Expand Down
3 changes: 3 additions & 0 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_ma
# Too many constexpr operations
std/utilities/charconv/charconv.to.chars/integral.pass.cpp FAIL

# libc++ has not implemented P2505R5: "Monadic Functions for std::expected"
std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp FAIL


# *** INTERACTIONS WITH CONTEST / C1XX THAT UPSTREAM LIKELY WON'T FIX ***
# Tracked by VSO-593630 "<filesystem> Enable libcxx filesystem tests"
Expand Down
3 changes: 3 additions & 0 deletions tests/libcxx/skipped_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ utilities\utility\mem.res\mem.res.pool\mem.res.pool.mem\unsync_deallocate_matche
# Too many constexpr operations
utilities\charconv\charconv.to.chars\integral.pass.cpp

# libc++ has not implemented P2505R5: "Monadic Functions for std::expected"
language.support\support.limits\support.limits.general\expected.version.compile.pass.cpp


# *** INTERACTIONS WITH CONTEST / C1XX THAT UPSTREAM LIKELY WON'T FIX ***
# Tracked by VSO-593630 "<filesystem> Enable libcxx filesystem tests"
Expand Down
1 change: 1 addition & 0 deletions tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ tests\P2467R1_exclusive_mode_fstreams
tests\P2474R2_views_repeat
tests\P2474R2_views_repeat_death
tests\P2494R2_move_only_range_adaptors
tests\P2505R5_monadic_functions_for_std_expected
tests\P2517R1_apply_conditional_noexcept
tests\VSO_0000000_allocator_propagation
tests\VSO_0000000_any_calling_conventions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\concepts_latest_matrix.lst
Loading