* include/std/functional (_Bind_simple): Simplify construction.
authorJonathan Wakely <jwakely@redhat.com>
Tue, 4 Nov 2014 02:49:27 +0000 (02:49 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 4 Nov 2014 02:49:27 +0000 (02:49 +0000)
From-SVN: r217065

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/functional

index 88e93524d2b14c8c72b8fd67a768a418b4863f8d..c8e2ef28365f47893c4bbe493be48faf4d7ff5bc 100644 (file)
@@ -4,6 +4,8 @@
        * include/experimental/optional (__constexpr_addressof): Likewise.
        (_Optional_base, optional, make_optional): Likewise.
 
+       * include/std/functional (_Bind_simple): Simplify construction.
+
 2014-11-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/parallel/algo.h: Do not use default arguments in function
index f615ae4ea67cd8d75ab9e6857be0d4319a7c2b82..f8e9b54fd9162e0bf5a61909ae9e242a3d0cd74f 100644 (file)
@@ -1582,18 +1582,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
     {
       typedef typename result_of<_Callable(_Args...)>::type result_type;
 
-      template<typename... _Args2, typename = typename
-               enable_if< sizeof...(_Args) == sizeof...(_Args2)>::type>
+      template<typename _Tp, typename... _Up>
         explicit
-        _Bind_simple(const _Callable& __callable, _Args2&&... __args)
-        : _M_bound(__callable, std::forward<_Args2>(__args)...)
-        { }
-
-      template<typename... _Args2, typename = typename
-               enable_if< sizeof...(_Args) == sizeof...(_Args2)>::type>
-        explicit
-        _Bind_simple(_Callable&& __callable, _Args2&&... __args)
-        : _M_bound(std::move(__callable), std::forward<_Args2>(__args)...)
+        _Bind_simple(_Tp&& __f, _Up&&... __args)
+        : _M_bound(std::forward<_Tp>(__f), std::forward<_Up>(__args)...)
         { }
 
       _Bind_simple(const _Bind_simple&) = default;
@@ -1607,7 +1599,6 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
       }
 
     private:
-
       template<std::size_t... _Indices>
         typename result_of<_Callable(_Args...)>::type
         _M_invoke(_Index_tuple<_Indices...>)