* [patch] Simplify construction of _Bind_simple in <functional>
@ 2014-11-04 2:52 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2014-11-04 2:52 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 180 bytes --]
With the arity-checking I added recently we don't need the SFINAE
constraints on the number of arguments to _Bind_simple's constructors.
Tested x86_64-linux, committed to trunk.
[-- Attachment #2: patch-2.txt --]
[-- Type: text/plain, Size: 1602 bytes --]
commit d78bba658af1677b873d391649ee237150b3c916
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Nov 3 14:52:15 2014 +0000
* include/std/functional (_Bind_simple): Simplify construction.
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index f615ae4..f8e9b54 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -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...>)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-11-04 2:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 2:52 [patch] Simplify construction of _Bind_simple in <functional> Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).