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

monadic operations: fix disable #61

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Define this macro to 1 to experience the by-design compile-time errors of the li

By default, *expected lite* provides monadic operations as described in [P2505R5](http://wg21.link/p2505r5). You can disable these operations by defining the following macro.

-D<b>nsel\_P2505R</b>=
-D<b>nsel\_P2505R</b>=0

You can use the R3 revision of P2505, which lacks `error_or`, and uses `remove_cvref` for transforms, by defining the following macro.

Expand Down
2 changes: 2 additions & 0 deletions test/expected.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,7 @@ CASE( "issue-58" )
EXPECT( !unexpected.has_value() );
}

#if nsel_P2505R >= 3
CASE( "invoke" )
{
struct A {
Expand All @@ -2197,6 +2198,7 @@ CASE( "invoke" )
EXPECT( nonstd::expected_lite::detail::invoke(&A::get2, ref, 'a') == 12 );
EXPECT( nonstd::expected_lite::detail::invoke(&A::get2, cref, 'a') == 7 );
}
#endif // nsel_P2505R >= 3

// -----------------------------------------------------------------------
// using as optional
Expand Down