Imported Upstream version 2.99.2
[platform/upstream/libsigc++.git] / sigc++ / functors / ptr_fun.h
index 9eab18a..1daa1a9 100644 (file)
@@ -13,7 +13,7 @@ namespace sigc {
  * @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:
@@ -21,7 +21,7 @@ namespace sigc {
  * 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
@@ -33,7 +33,7 @@ namespace sigc {
  * {
  *   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
@@ -49,7 +49,11 @@ namespace sigc {
  * @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: 
@@ -81,9 +85,9 @@ public:
  * @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_ */