18#ifndef IOX_HOOFS_CXX_FUNCTION_REF_HPP
19#define IOX_HOOFS_CXX_FUNCTION_REF_HPP
21#include "iceoryx_hoofs/cxx/requires.hpp"
22#include "iceoryx_hoofs/cxx/type_traits.hpp"
33template <
typename SignatureType>
63template <
class ReturnType,
class... ArgTypes>
66 using SignatureType = ReturnType(ArgTypes...);
68 template <
typename T1,
typename T2>
69 using has_same_decayed_type =
typename std::integral_constant<
71 bool(std::is_same<
typename std::decay<T1>::type,
typename std::decay<T2>::type>::value)>;
86 template <typename CallableType,
88 && !has_same_decayed_type<CallableType,
function_ref>::value
108 ReturnType operator()(ArgTypes... args) const noexcept;
112 explicit operator
bool() const noexcept;
119 void* m_pointerToCallable{
nullptr};
120 ReturnType (*m_functionPointer)(
void*, ArgTypes...){
nullptr};
126#include "iceoryx_hoofs/internal/cxx/function_ref.inl"
function_ref() noexcept
Creates an empty function_ref in an invalid state.
Definition: function_ref.hpp:34
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:29
Check whether T is a function pointer with arbitrary signature.
Definition: type_traits.hpp:122
Verifies whether the passed Callable type is in fact invocable with the given arguments.
Definition: type_traits.hpp:71