Skip to content

Commit

Permalink
Use -Dnsel_P2505R=0 to disable monadic operations (#61, addendum to #…
Browse files Browse the repository at this point in the history
…60, thanks @szaszm)

and conditionally compile `invoke` tests, only test if `invoke` itself
is compiled
  • Loading branch information
szaszm committed Sep 30, 2023
1 parent 2b956b1 commit 45a54fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
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
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

0 comments on commit 45a54fa

Please sign in to comment.