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