* @par Example:
* @code
* void foo(int) {}
- * sigc::slot<void, int> sl = sigc::ptr_fun(&foo);
+ * sigc::slot<void(int)> sl = sigc::ptr_fun(&foo);
* @endcode
*
* @par Example:
* void foo(int) {} // choose this one
* void foo(float) {}
* void foo(int, int) {}
- * sigc::slot<void, long> sl = sigc::ptr_fun<void, int>(&foo);
+ * sigc::slot<void(long)> sl = sigc::ptr_fun<void, int>(&foo);
* @endcode
*
* ptr_fun() can also be used to convert a pointer to a static member
* {
* static void bar(int) {}
* };
- * sigc::slot<void, int> sl = sigc::ptr_fun(&foo::bar);
+ * sigc::slot<void(int)> sl = sigc::ptr_fun(&foo::bar);
* @endcode
*
* @ingroup sigcfunctors
* @ingroup ptr_fun
*/
template <class T_return, class... T_args>
-class pointer_functor : public functor_base
+class pointer_functor;
+
+template <class T_return, class... T_args>
+class pointer_functor<T_return(T_args...)>
+ : public functor_base
{
using function_type = T_return (*)(T_args...);
protected:
* @ingroup ptr_fun
*/
template <class T_return, class... T_args>
-inline pointer_functor<T_return, T_args...>
+inline decltype(auto)
ptr_fun(T_return (*_A_func)(T_args...))
-{ return pointer_functor<T_return, T_args...>(_A_func); }
+{ return pointer_functor<T_return(T_args...)>(_A_func); }
} /* namespace sigc */
#endif /* _SIGC_FUNCTORS_PTR_FUN_H_ */