Skip to content

Commit

Permalink
Update thunk_test.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-loew committed Apr 6, 2024
1 parent 0798c37 commit 067bbb4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/thunk_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SimpleObject
void member_func_test()
{
SimpleObject dt;
lunaticpp::thunk<&SimpleObject::add> thunk(&dt);
lunaticpp::thunk<LUNATIC_THUNKS_MAKE_CALL(SimpleObject::add)> thunk(&dt);
int (*add)(int,int)=thunk.func();

auto result=add(1,2);
Expand All @@ -24,8 +24,9 @@ void member_func_test()

void std_function_test()
{
std::function<int(int, int)> f=[](int a, int b){return a+b;};
lunaticpp::thunk<&std::function<int(int, int)>::operator ()> thunk(&f);
using func_type = int(int, int);
std::function<func_type> f=[](int a, int b){return a+b;};
lunaticpp::thunk< LUNATIC_THUNKS_MAKE_CALL(std::function<func_type>::operator ())> thunk(&f);
int (*add)(int,int)=thunk.func();

auto result=add(1,2);
Expand Down

0 comments on commit 067bbb4

Please sign in to comment.