Patchwork [v3] remove __async_sfinae_helper

login
register
mail settings
Submitter Jonathan Wakely
Date Dec. 17, 2012, 9:30 p.m.
Message ID <CAH6eHdSJN_dDRX2rGtu6oeYCM1prsWGB64LVEUVFodykb-xQ7g@mail.gmail.com>
Download mbox | patch
Permalink /patch/206999/
State New
Headers show

Comments

Jonathan Wakely - Dec. 17, 2012, 9:30 p.m.
With the implementation of N3436 we no longer need the
__async_sfinae_helper, as result_of does the same job on its own.

        * include/std/future (__async_sfinae_helper): Remove.

Tested x86_64-linux, committed to trunk.
commit 797f96cc81e09197bc377206319667c579ecb81b
Author: Jonathan Wakely <jwakely.gcc@gmail.com>
Date:   Mon Dec 17 21:00:57 2012 +0000

    	* include/std/future (__async_sfinae_helper): Remove.

Patch

diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index c24ab77..2ecf438 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -170,19 +170,8 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
     future<typename result_of<_Fn(_Args...)>::type>
     async(launch __policy, _Fn&& __fn, _Args&&... __args);
 
-  template<typename _FnCheck, typename _Fn, typename... _Args>
-    struct __async_sfinae_helper
-    {
-      typedef future<typename result_of<_Fn(_Args...)>::type> type;
-    };
-
   template<typename _Fn, typename... _Args>
-    struct __async_sfinae_helper<launch, _Fn, _Args...>
-    { };
-
-  template<typename _Fn, typename... _Args>
-    typename
-    __async_sfinae_helper<typename decay<_Fn>::type, _Fn, _Args...>::type
+    future<typename result_of<_Fn(_Args...)>::type>
     async(_Fn&& __fn, _Args&&... __args);
 
 #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
@@ -1509,8 +1498,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// async, potential overload
   template<typename _Fn, typename... _Args>
-    inline typename
-    __async_sfinae_helper<typename decay<_Fn>::type, _Fn, _Args...>::type
+    inline future<typename result_of<_Fn(_Args...)>::type>
     async(_Fn&& __fn, _Args&&... __args)
     {
       return async(launch::async|launch::deferred, std::forward<_Fn>(__fn),