aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-10-14 20:04:56 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2016-10-14 20:04:56 +0100
commitde1d079440179287ff154a66218b2f2fd41a9acf (patch)
tree7409d6610897d518f0e50d3ca93a99dd2df1707d /libstdc++-v3/src
parent064ed55a66a788b1939fb93bd64ea3705e8384c7 (diff)
downloadgcc-de1d079440179287ff154a66218b2f2fd41a9acf.zip
gcc-de1d079440179287ff154a66218b2f2fd41a9acf.tar.gz
gcc-de1d079440179287ff154a66218b2f2fd41a9acf.tar.bz2
Make std::bind use std::invoke
* include/std/functional (_Mu<A, false, true>, _Mu<A, true, false>): Simplify forwarding from tuple of references. (_Maybe_wrap_member_pointer): Remove. (_Bind::__call, _Bind::__call_c, _Bind::__call_v, _Bind::__call_c_v): Use std::__invoke. (_Bind::_Mu_type, _Bind::_Res_type_impl, _Bind::_Res_type) (_Bind::__dependent, _Bind::_Res_type_cv): New helpers to simplify return type deduction. (_Bind::operator(), _Bind::operator() const): Use new helpers. (_Bind::operator() volatile, _Bind::operator() const volatile): Likewise. Add deprecated attribute for C++17 mode. (_Bind_result::__call): Use std::__invoke. (_Bind_result::operator() volatile) (_Bind_result::operator() const volatile): Add deprecated attribute. (_Bind_helper::__maybe_type, _Bindres_helper::__maybe_type): Remove. (_Bind_helper, _Bindres_helper): Don't use _Maybe_wrap_member_pointer. (bind, bind<R>): Don't use __maybe_type. * src/c++11/compatibility-thread-c++0x.cc (_Maybe_wrap_member_pointer): Define here for compatibility symbols. * testsuite/20_util/bind/68912.cc: Don't test volatile-qualification in C++17 mode. * testsuite/20_util/bind/cv_quals.cc: Likewise. * testsuite/20_util/bind/cv_quals_2.cc: Likewise. From-SVN: r241178
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc
index 5ca2da8..066b08b 100644
--- a/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc
+++ b/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc
@@ -116,6 +116,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Replaced with inline definition in gcc-4.8.0
__future_base::_Async_state_common::~_Async_state_common() { _M_join(); }
+ template<typename _Tp>
+ struct _Maybe_wrap_member_pointer;
+
+ template<typename _Tp, typename _Class>
+ struct _Maybe_wrap_member_pointer<_Tp _Class::*>
+ {
+ typedef _Mem_fn<_Tp _Class::*> type;
+
+ static constexpr type
+ __do_wrap(_Tp _Class::* __pm)
+ { return type(__pm); }
+ };
+
template<typename _Signature>
struct _Bind_simple;