From 45a54fac224e5aae5f8e70bb1c2423181ae554da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Sz=C3=A1sz?= Date: Sat, 30 Sep 2023 18:37:51 +0200 Subject: [PATCH] Use `-Dnsel_P2505R=0` to disable monadic operations (#61, addendum to #60, thanks @szaszm) and conditionally compile `invoke` tests, only test if `invoke` itself is compiled --- README.md | 2 +- test/expected.t.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f43283d..a0ce580 100644 --- a/README.md +++ b/README.md @@ -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. --Dnsel\_P2505R= +-Dnsel\_P2505R=0 You can use the R3 revision of P2505, which lacks `error_or`, and uses `remove_cvref` for transforms, by defining the following macro. diff --git a/test/expected.t.cpp b/test/expected.t.cpp index 10f5dcf..61fbd6f 100644 --- a/test/expected.t.cpp +++ b/test/expected.t.cpp @@ -2171,6 +2171,7 @@ CASE( "issue-58" ) EXPECT( !unexpected.has_value() ); } +#if nsel_P2505R >= 3 CASE( "invoke" ) { struct A { @@ -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