summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/functional
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-10-22 18:25:04 +0000
committerdim <dim@FreeBSD.org>2012-10-22 18:25:04 +0000
commit708d8e446e991358da23bb52ec5320440221f12f (patch)
tree3a061d75674cd5b60d9f6df45d0b8d755da3782f /contrib/libc++/include/functional
parentb8c74d455d2690e710a0802a98a9d310995a52eb (diff)
parent13334223d751d249ccd6475b8cba36ff71ddc972 (diff)
downloadFreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.zip
FreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.tar.gz
Import libc++ trunk r165949. Among other improvements and bug fixes,
this has many visibility problems fixed, which should help with compiling certain ports that exercise C++11 mode (i.e. Firefox). Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files, which are referred to in all the source files. MFC after: 1 month
Diffstat (limited to 'contrib/libc++/include/functional')
-rw-r--r--contrib/libc++/include/functional11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/libc++/include/functional b/contrib/libc++/include/functional
index 884a577..ec5c5e5 100644
--- a/contrib/libc++/include/functional
+++ b/contrib/libc++/include/functional
@@ -1113,7 +1113,8 @@ class _LIBCPP_VISIBLE function<_Rp(_ArgTypes...)>
_LIBCPP_INLINE_VISIBILITY
static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;}
- template <class _Fp, bool = __invokable<_Fp&, _ArgTypes...>::value>
+ template <class _Fp, bool = !is_same<_Fp, function>::value &&
+ __invokable<_Fp&, _ArgTypes...>::value>
struct __callable;
template <class _Fp>
struct __callable<_Fp, true>
@@ -1350,6 +1351,7 @@ function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
__f_ = __f.__f_;
__f.__f_ = 0;
}
+ return *this;
}
template<class _Rp, class ..._ArgTypes>
@@ -1361,6 +1363,7 @@ function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
else if (__f_)
__f_->destroy_deallocate();
__f_ = 0;
+ return *this;
}
template<class _Rp, class ..._ArgTypes>
@@ -1707,7 +1710,11 @@ public:
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
- template <class _Gp, class ..._BA>
+ template <class _Gp, class ..._BA,
+ class = typename enable_if
+ <
+ is_constructible<_Fd, _Gp>::value
+ >::type>
_LIBCPP_INLINE_VISIBILITY
explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
: __f_(_VSTD::forward<_Gp>(__f)),
OpenPOWER on IntegriCloud