Skip to content

Commit

Permalink
Changed comment
Browse files Browse the repository at this point in the history
Simplified unit test
  • Loading branch information
jwellbelove committed Nov 10, 2024
1 parent 31740b8 commit 5b01a4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/etl/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ namespace etl
#if ETL_USING_CPP17
//*****************************************************************************
// Wraps a functor with a static free function at compile time.
// Creates a static member 'function' that calls the specified functor.
// Creates a static member 'call' that calls the specified functor.
//*****************************************************************************
template <auto& Instance>
struct functor_as_static
Expand All @@ -693,7 +693,7 @@ namespace etl

//*****************************************************************************
// Wraps a member function with a static free function at compile time.
// Creates a static member function that calls the specified member function.
// Creates a static member 'call' that calls the specified member function.
//*****************************************************************************
template <auto Method, auto& Instance>
struct member_function_as_static
Expand Down
6 changes: 4 additions & 2 deletions test/test_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,11 @@ namespace
//*************************************************************************
TEST(test_function_ptr_as_functor)
{
constexpr decltype(TestGlobal)* fptr = TestGlobal;
using function_type = decltype(TestGlobal);

constexpr etl::function_ptr_as_functor<decltype(TestGlobal)> fpaf(fptr);
constexpr function_type* fptr = TestGlobal;

constexpr etl::function_ptr_as_functor<function_type> fpaf(fptr);

CHECK_EQUAL(2, fpaf(1));
}
Expand Down

0 comments on commit 5b01a4b

Please sign in to comment.