functional (232924) | functional (241900) |
---|---|
1// -*- C++ -*- 2//===------------------------ functional ----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// --- 1099 unchanged lines hidden (view full) --- 1108 static bool __not_null(_R2 (_Cp::*__p)(_Ap...) volatile) {return __p;} 1109 template <class _R2, class _Cp, class ..._Ap> 1110 _LIBCPP_INLINE_VISIBILITY 1111 static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const volatile) {return __p;} 1112 template <class _R2, class ..._Ap> 1113 _LIBCPP_INLINE_VISIBILITY 1114 static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;} 1115 | 1// -*- C++ -*- 2//===------------------------ functional ----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// --- 1099 unchanged lines hidden (view full) --- 1108 static bool __not_null(_R2 (_Cp::*__p)(_Ap...) volatile) {return __p;} 1109 template <class _R2, class _Cp, class ..._Ap> 1110 _LIBCPP_INLINE_VISIBILITY 1111 static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const volatile) {return __p;} 1112 template <class _R2, class ..._Ap> 1113 _LIBCPP_INLINE_VISIBILITY 1114 static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;} 1115 |
1116 template <class _Fp, bool = __invokable<_Fp&, _ArgTypes...>::value> | 1116 template <class _Fp, bool = !is_same<_Fp, function>::value && 1117 __invokable<_Fp&, _ArgTypes...>::value> |
1117 struct __callable; 1118 template <class _Fp> 1119 struct __callable<_Fp, true> 1120 { 1121 static const bool value = 1122 is_convertible<typename __invoke_of<_Fp&, _ArgTypes...>::type, 1123 _Rp>::value; 1124 }; --- 220 unchanged lines hidden (view full) --- 1345 __f_ = (__base*)&__buf_; 1346 __f.__f_->__clone(__f_); 1347 } 1348 else 1349 { 1350 __f_ = __f.__f_; 1351 __f.__f_ = 0; 1352 } | 1118 struct __callable; 1119 template <class _Fp> 1120 struct __callable<_Fp, true> 1121 { 1122 static const bool value = 1123 is_convertible<typename __invoke_of<_Fp&, _ArgTypes...>::type, 1124 _Rp>::value; 1125 }; --- 220 unchanged lines hidden (view full) --- 1346 __f_ = (__base*)&__buf_; 1347 __f.__f_->__clone(__f_); 1348 } 1349 else 1350 { 1351 __f_ = __f.__f_; 1352 __f.__f_ = 0; 1353 } |
1354 return *this; |
|
1353} 1354 1355template<class _Rp, class ..._ArgTypes> 1356function<_Rp(_ArgTypes...)>& 1357function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT 1358{ 1359 if (__f_ == (__base*)&__buf_) 1360 __f_->destroy(); 1361 else if (__f_) 1362 __f_->destroy_deallocate(); 1363 __f_ = 0; | 1355} 1356 1357template<class _Rp, class ..._ArgTypes> 1358function<_Rp(_ArgTypes...)>& 1359function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT 1360{ 1361 if (__f_ == (__base*)&__buf_) 1362 __f_->destroy(); 1363 else if (__f_) 1364 __f_->destroy_deallocate(); 1365 __f_ = 0; |
1366 return *this; |
|
1364} 1365 1366template<class _Rp, class ..._ArgTypes> 1367template <class _Fp> 1368typename enable_if 1369< 1370 function<_Rp(_ArgTypes...)>::template __callable<typename decay<_Fp>::type>::value, 1371 function<_Rp(_ArgTypes...)>& --- 330 unchanged lines hidden (view full) --- 1702 { 1703 __f_ = _VSTD::move(__b.__f_); 1704 __bound_args_ = _VSTD::move(__b.__bound_args_); 1705 return *this; 1706 } 1707 1708#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 1709 | 1367} 1368 1369template<class _Rp, class ..._ArgTypes> 1370template <class _Fp> 1371typename enable_if 1372< 1373 function<_Rp(_ArgTypes...)>::template __callable<typename decay<_Fp>::type>::value, 1374 function<_Rp(_ArgTypes...)>& --- 330 unchanged lines hidden (view full) --- 1705 { 1706 __f_ = _VSTD::move(__b.__f_); 1707 __bound_args_ = _VSTD::move(__b.__bound_args_); 1708 return *this; 1709 } 1710 1711#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 1712 |
1710 template <class _Gp, class ..._BA> | 1713 template <class _Gp, class ..._BA, 1714 class = typename enable_if 1715 < 1716 is_constructible<_Fd, _Gp>::value 1717 >::type> |
1711 _LIBCPP_INLINE_VISIBILITY 1712 explicit __bind(_Gp&& __f, _BA&& ...__bound_args) 1713 : __f_(_VSTD::forward<_Gp>(__f)), 1714 __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} 1715 1716 template <class ..._Args> 1717 _LIBCPP_INLINE_VISIBILITY 1718 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type --- 302 unchanged lines hidden --- | 1718 _LIBCPP_INLINE_VISIBILITY 1719 explicit __bind(_Gp&& __f, _BA&& ...__bound_args) 1720 : __f_(_VSTD::forward<_Gp>(__f)), 1721 __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} 1722 1723 template <class ..._Args> 1724 _LIBCPP_INLINE_VISIBILITY 1725 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type --- 302 unchanged lines hidden --- |