diff --git a/libs/type_index/examples/exact_types_match.cpp b/libs/type_index/examples/exact_types_match.cpp index 349a1ef..41f2ba1 100644 --- a/libs/type_index/examples/exact_types_match.cpp +++ b/libs/type_index/examples/exact_types_match.cpp @@ -15,6 +15,7 @@ #include #include +#include class type_erased_unary_function { void* function_ptr_; @@ -23,7 +24,7 @@ class type_erased_unary_function { public: template type_erased_unary_function(void(*ptr)(ParamT)) - : function_ptr_(ptr) // ptr - is a pointer to function returning `void` and accepting parameter of type `ParamT` + : function_ptr_(reinterpret_cast(ptr)) // ptr - is a pointer to function returning `void` and accepting parameter of type `ParamT` , exact_param_t_(boost::template_id_with_cvr()) {} @@ -33,7 +34,7 @@ public: throw std::runtime_error("Incorrect `ParamT`"); } - return (static_cast(function_ptr_))(v); + return (reinterpret_cast(function_ptr_))(v); } };