[PATCH] Remove unnecessary typedef from std::function

Jonathan Wakely jwakely@redhat.com
Thu Jan 5 17:36:00 GMT 2017


TThis typedef is only used once, in a function body, so it doesn't
need to be defined at class scope. It doesn't need to be defined at
all.

	* include/bits/std_function.h (function::_Signature_type): Remove.
	(function::function(_Functor)): Adjust.

Tested powerpc64le-linux, committed to trunk.

-------------- next part --------------
commit 6bcf4be09c82827b8396b81ff623e827fbbea305
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jan 5 17:24:02 2017 +0000

    Remove unnecessary typedef from std::function
    
    	* include/bits/std_function.h (function::_Signature_type): Remove.
    	(function::function(_Functor)): Adjust.

diff --git a/libstdc++-v3/include/bits/std_function.h b/libstdc++-v3/include/bits/std_function.h
index 7b10c42..f7bb22a 100644
--- a/libstdc++-v3/include/bits/std_function.h
+++ b/libstdc++-v3/include/bits/std_function.h
@@ -456,8 +456,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
       private _Function_base
     {
-      typedef _Res _Signature_type(_ArgTypes...);
-
       template<typename _Func,
 	       typename _Res2 = typename result_of<_Func&(_ArgTypes...)>::type>
 	struct _Callable : __check_func_return_type<_Res2, _Res> { };
@@ -715,7 +713,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       function(_Functor __f)
       : _Function_base()
       {
-	typedef _Function_handler<_Signature_type, _Functor> _My_handler;
+	typedef _Function_handler<_Res(_ArgTypes...), _Functor> _My_handler;
 
 	if (_My_handler::_M_not_empty_function(__f))
 	  {


More information about the Libstdc++ mailing list