[libsigcplusplus] retype: Simplify by using a template template parameter.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus] retype: Simplify by using a template template parameter.
- Date: Thu, 10 Mar 2016 13:01:15 +0000 (UTC)
commit 254891944543f59bcebc18d12fbadcdf775ea009
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Mar 10 14:01:00 2016 +0100
retype: Simplify by using a template template parameter.
sigc++/adaptors/retype.h | 55 ++-------------------------------------------
1 files changed, 3 insertions(+), 52 deletions(-)
---
diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h
index 2c511a5..f3fc538 100644
--- a/sigc++/adaptors/retype.h
+++ b/sigc++/adaptors/retype.h
@@ -100,67 +100,18 @@ struct visitor<retype_functor<T_functor, T_type...> >
#endif // DOXYGEN_SHOULD_SKIP_THIS
/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on
to the functor.
- * This function template specialization works on sigc::slot.
*
* @param _A_functor Functor that should be wrapped.
* @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
*
* @ingroup retype
*/
-template <class T_return, class... T_arg>
+template <template<class T_return, class... T_arg> class T_functor, class T_return, class... T_arg>
inline decltype(auto)
-retype(const slot<T_return, T_arg...>& _A_functor)
-{ return retype_functor<slot<T_return, T_arg...>, T_arg...>
+retype(const T_functor<T_return, T_arg...>& _A_functor)
+{ return retype_functor<T_functor<T_return, T_arg...>, T_arg...>
(_A_functor); }
-
-/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on
to the functor.
- * This function template specialization works on sigc::pointer_functor.
- *
- * @param _A_functor Functor that should be wrapped.
- * @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
- *
- * @ingroup retype
- */
-template <class T_return, class... T_arg>
-inline decltype(auto)
-retype(const pointer_functor<T_return, T_arg...>& _A_functor)
-{ return retype_functor<pointer_functor<T_return, T_arg...>, T_arg... >
- (_A_functor); }
-
-
-/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on
to the functor.
- * This function template specialization works on sigc::mem_functor.
- *
- * @param _A_functor Functor that should be wrapped.
- * @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
- *
- * @ingroup retype
- */
-template <class T_func, class... T_arg>
-inline decltype(auto)
-retype(const mem_functor<T_func, T_arg...>& _A_functor)
-{ return retype_functor<mem_functor<T_func, T_arg...>, T_arg...>
- (_A_functor);
-}
-
-/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on
to the functor.
- * This function template specialization works on sigc::bound_mem_functor.
- *
- * @param _A_functor Functor that should be wrapped.
- * @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
- *
- * @ingroup retype
- */
-template <
- class T_func,
- class... T_arg>
-inline decltype(auto)
-retype(const bound_mem_functor<T_func, T_arg...>& _A_functor)
-{ return retype_functor<bound_mem_functor<T_func, T_arg...>, T_arg...>
- (_A_functor);
-}
-
} /* namespace sigc */
#endif /* _SIGC_ADAPTORS_RETYPE_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]