Skip to content

Commit

Permalink
fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchabannes committed Aug 21, 2024
1 parent dad6939 commit adc60de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/ex1.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <napp/na.hpp>
#include <tuple>
#include <iostream>
#include <string>

constexpr auto& _parameters = NA::identifier<struct parameters_tag>;
constexpr auto& _task = NA::identifier<struct task_tag>;
Expand Down
4 changes: 2 additions & 2 deletions test/unit-cvref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std::string test_nonconst( Ts && ... v )
auto args = NA::make_arguments( std::forward<Ts>(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<decltype(data)>( data ); });

data.setI(12);
data2.setI(13);
Expand All @@ -57,7 +57,7 @@ std::string test_const( Ts && ... v )
auto args = NA::make_arguments( std::forward<Ts>(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<decltype(data)>( data ); });

static_assert( std::is_const_v<std::remove_reference_t<decltype(data)>>, "should be const" );
static_assert( std::is_const_v<std::remove_reference_t<decltype(data2)>>, "should be const" );
Expand Down

0 comments on commit adc60de

Please sign in to comment.