Move std::function constructor SFINAE into template parameter list. Fixes PR20002.

Although inheriting constructors have already been fixed in Clang 3.9 I still
choose to fix std::function so users can derive from it with older compilers.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2016-07-20 05:21:00 +00:00
parent 155b681794
commit 16ed718fc6

View File

@ -1595,12 +1595,10 @@ public:
function(nullptr_t) _NOEXCEPT : __f_(0) {}
function(const function&);
function(function&&) _NOEXCEPT;
template<class _Fp>
function(_Fp, typename enable_if
<
__callable<_Fp>::value &&
!is_same<_Fp, function>::value
>::type* = 0);
template<class _Fp, class = typename enable_if<
__callable<_Fp>::value && !is_same<_Fp, function>::value
>::type>
function(_Fp);
template<class _Alloc>
_LIBCPP_INLINE_VISIBILITY
@ -1612,9 +1610,8 @@ public:
function(allocator_arg_t, const _Alloc&, const function&);
template<class _Alloc>
function(allocator_arg_t, const _Alloc&, function&&);
template<class _Fp, class _Alloc>
function(allocator_arg_t, const _Alloc& __a, _Fp __f,
typename enable_if<__callable<_Fp>::value>::type* = 0);
template<class _Fp, class _Alloc, class = typename enable_if<__callable<_Fp>::value>::type>
function(allocator_arg_t, const _Alloc& __a, _Fp __f);
function& operator=(const function&);
function& operator=(function&&) _NOEXCEPT;
@ -1728,13 +1725,8 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
}
template<class _Rp, class ..._ArgTypes>
template <class _Fp>
function<_Rp(_ArgTypes...)>::function(_Fp __f,
typename enable_if
<
__callable<_Fp>::value &&
!is_same<_Fp, function>::value
>::type*)
template <class _Fp, class>
function<_Rp(_ArgTypes...)>::function(_Fp __f)
: __f_(0)
{
if (__function::__not_null(__f))
@ -1757,9 +1749,8 @@ function<_Rp(_ArgTypes...)>::function(_Fp __f,
}
template<class _Rp, class ..._ArgTypes>
template <class _Fp, class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
typename enable_if<__callable<_Fp>::value>::type*)
template <class _Fp, class _Alloc, class>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f)
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;