Skip to content

Commit

Permalink
iox-#1394 Add missing declaration of swap to .hpp
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <[email protected]>
  • Loading branch information
mossmaurice committed Jul 15, 2022
1 parent c9c54dd commit ffd5a26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion iceoryx_hoofs/include/iceoryx_hoofs/cxx/function_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class function_ref<ReturnType(ArgTypes...)> final
/// @note This overload is needed, as the general implementation
/// will not work properly for function pointers.
/// This ctor is not needed anymore once we can use user-defined-deduction guides (C++17)
// For justification see c'tor above
// Implicit conversion needed for method pointers
// NOLINTNEXTLINE(hicpp-explicit-conversions)
function_ref(ReturnType (&function)(ArgTypes...)) noexcept;

Expand All @@ -114,6 +114,9 @@ class function_ref<ReturnType(ArgTypes...)> final
ReturnType (*m_functionPointer)(void*, ArgTypes...){nullptr};
};

template <class ReturnType, class... ArgTypes>
void swap(function_ref<ReturnType(ArgTypes...)>& lhs, function_ref<ReturnType(ArgTypes...)>& rhs) noexcept;

} // namespace cxx
} // namespace iox

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ template <class ReturnType, class... ArgTypes>
inline function_ref<ReturnType(ArgTypes...)>::function_ref(ReturnType (&function)(ArgTypes...)) noexcept
// the cast is required to work on POSIX systems
// AXIVION Next Construct AutosarC++19_03-A5.2.4, AutosarC++19_03-A5.2.4-M5.2.6 : Type-safety ensured by casting
// back on call
// back function pointer on call
// NOLINTNEXTLINE (cppcoreguidelines-pro-type-reinterpret-cast)
: m_pointerToCallable(reinterpret_cast<void*>(function))
,
Expand Down

0 comments on commit ffd5a26

Please sign in to comment.