From adc60de44ccebc61a118d622cc05c64b1aa7ac9a Mon Sep 17 00:00:00 2001 From: Vincent Chabannes Date: Wed, 21 Aug 2024 23:59:21 +0200 Subject: [PATCH] fix #1 --- examples/ex1.cpp | 1 + test/unit-cvref.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/ex1.cpp b/examples/ex1.cpp index 83d1bf9..d6a7b64 100644 --- a/examples/ex1.cpp +++ b/examples/ex1.cpp @@ -1,6 +1,7 @@ #include #include #include +#include constexpr auto& _parameters = NA::identifier; constexpr auto& _task = NA::identifier; diff --git a/test/unit-cvref.cpp b/test/unit-cvref.cpp index 8ab4f01..c5254a3 100644 --- a/test/unit-cvref.cpp +++ b/test/unit-cvref.cpp @@ -40,7 +40,7 @@ std::string test_nonconst( Ts && ... v ) auto args = NA::make_arguments( std::forward(v)... ); auto && data = args.get(_data); auto && data2 = args.get_else(_data2,data); - auto && data3 = args.get_else_invocable(_data3,[&data]() -> decltype(auto) { return data; }); + auto && data3 = args.get_else_invocable(_data3,[&data]() -> decltype(auto) { return std::forward( data ); }); data.setI(12); data2.setI(13); @@ -57,7 +57,7 @@ std::string test_const( Ts && ... v ) auto args = NA::make_arguments( std::forward(v)... ); auto && data = args.get(_data); auto && data2 = args.get_else(_data2,data); - auto && data3 = args.get_else_invocable(_data3,[&data]() -> decltype(auto) { return data; }); + auto && data3 = args.get_else_invocable(_data3,[&data]() -> decltype(auto) { return std::forward( data ); }); static_assert( std::is_const_v>, "should be const" ); static_assert( std::is_const_v>, "should be const" );