aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/std/functional48
2 files changed, 28 insertions, 26 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 34b7d05..afa10f4 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,11 @@
2016-10-10 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/functional (_Bind_result::__enable_if_void): Use alias
+ template instead of class template.
+ (_Bind_result::__disable_if_void): Likewise.
+ (_Bind_result::__call): Adjust uses of __enable_if_void and
+ __disable_if_void.
+
* doc/xml/manual/intro.xml: Document DR 2296 status.
* doc/xml/manual/status_cxx2017.xml: Update status.
* include/bits/move.h (__addressof): Add _GLIBCXX_CONSTEXPR and
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 1c7523e..2587392 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1000,15 +1000,17 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// sfinae types
template<typename _Res>
- struct __enable_if_void : enable_if<is_void<_Res>::value, int> { };
+ using __enable_if_void
+ = typename enable_if<is_void<_Res>{}>::type;
+
template<typename _Res>
- struct __disable_if_void : enable_if<!is_void<_Res>::value, int> { };
+ using __disable_if_void
+ = typename enable_if<!is_void<_Res>{}, _Result>::type;
// Call unqualified
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- _Result
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __disable_if_void<_Res>::type = 0)
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
{
return _M_f(_Mu<_Bound_args>()
(std::get<_Indexes>(_M_bound_args), __args)...);
@@ -1016,9 +1018,8 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call unqualified, return void
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- void
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __enable_if_void<_Res>::type = 0)
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
{
_M_f(_Mu<_Bound_args>()
(std::get<_Indexes>(_M_bound_args), __args)...);
@@ -1026,9 +1027,8 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call as const
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- _Result
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __disable_if_void<_Res>::type = 0) const
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
{
return _M_f(_Mu<_Bound_args>()
(std::get<_Indexes>(_M_bound_args), __args)...);
@@ -1036,9 +1036,8 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call as const, return void
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- void
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __enable_if_void<_Res>::type = 0) const
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
{
_M_f(_Mu<_Bound_args>()
(std::get<_Indexes>(_M_bound_args), __args)...);
@@ -1046,9 +1045,8 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call as volatile
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- _Result
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __disable_if_void<_Res>::type = 0) volatile
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) volatile
{
return _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...);
@@ -1056,9 +1054,8 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call as volatile, return void
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- void
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __enable_if_void<_Res>::type = 0) volatile
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) volatile
{
_M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...);
@@ -1066,9 +1063,9 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call as const volatile
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- _Result
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
- typename __disable_if_void<_Res>::type = 0) const volatile
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args,
+ _Index_tuple<_Indexes...>) const volatile
{
return _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...);
@@ -1076,10 +1073,9 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
// Call as const volatile, return void
template<typename _Res, typename... _Args, std::size_t... _Indexes>
- void
+ __enable_if_void<_Res>
__call(tuple<_Args...>&& __args,
- _Index_tuple<_Indexes...>,
- typename __enable_if_void<_Res>::type = 0) const volatile
+ _Index_tuple<_Indexes...>) const volatile
{
_M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...);