diff options
Diffstat (limited to 'libcxx/include')
38 files changed, 2833 insertions, 2833 deletions
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference index 9ee1dd94314..2688b5e7431 100644 --- a/libcxx/include/__bit_reference +++ b/libcxx/include/__bit_reference @@ -22,8 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template <class _C, bool _IsConst> class __bit_iterator; -template <class _C> class __bit_const_reference; +template <class _Cp, bool _IsConst> class __bit_iterator; +template <class _Cp> class __bit_const_reference; template <class _Tp> struct __has_storage_type @@ -31,22 +31,22 @@ struct __has_storage_type static const bool value = false; }; -template <class _C, bool = __has_storage_type<_C>::value> +template <class _Cp, bool = __has_storage_type<_Cp>::value> class __bit_reference { - typedef typename _C::__storage_type __storage_type; - typedef typename _C::__storage_pointer __storage_pointer; + typedef typename _Cp::__storage_type __storage_type; + typedef typename _Cp::__storage_pointer __storage_pointer; __storage_pointer __seg_; __storage_type __mask_; #if defined(__clang__) - friend typename _C::__self; + friend typename _Cp::__self; #else - friend class _C::__self; + friend class _Cp::__self; #endif - friend class __bit_const_reference<_C>; - friend class __bit_iterator<_C, false>; + friend class __bit_const_reference<_Cp>; + friend class __bit_iterator<_Cp, false>; public: _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT {return static_cast<bool>(*__seg_ & __mask_);} @@ -68,74 +68,74 @@ public: {return operator=(static_cast<bool>(__x));} _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;} - _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT - {return __bit_iterator<_C, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} + _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const _NOEXCEPT + {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} private: _LIBCPP_INLINE_VISIBILITY __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT : __seg_(__s), __mask_(__m) {} }; -template <class _C> -class __bit_reference<_C, false> +template <class _Cp> +class __bit_reference<_Cp, false> { }; -template <class _C, class _D> +template <class _Cp, class _Dp> _LIBCPP_INLINE_VISIBILITY inline void -swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT +swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT { bool __t = __x; __x = __y; __y = __t; } -template <class _C> +template <class _Cp> _LIBCPP_INLINE_VISIBILITY inline void -swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT +swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT { bool __t = __x; __x = __y; __y = __t; } -template <class _C> +template <class _Cp> _LIBCPP_INLINE_VISIBILITY inline void -swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT +swap(bool& __x, __bit_reference<_Cp> __y) _NOEXCEPT { bool __t = __x; __x = __y; __y = __t; } -template <class _C> +template <class _Cp> class __bit_const_reference { - typedef typename _C::__storage_type __storage_type; - typedef typename _C::__const_storage_pointer __storage_pointer; + typedef typename _Cp::__storage_type __storage_type; + typedef typename _Cp::__const_storage_pointer __storage_pointer; __storage_pointer __seg_; __storage_type __mask_; #if defined(__clang__) - friend typename _C::__self; + friend typename _Cp::__self; #else - friend class _C::__self; + friend class _Cp::__self; #endif - friend class __bit_iterator<_C, true>; + friend class __bit_iterator<_Cp, true>; public: _LIBCPP_INLINE_VISIBILITY - __bit_const_reference(const __bit_reference<_C>& __x) _NOEXCEPT + __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT : __seg_(__x.__seg_), __mask_(__x.__mask_) {} _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT {return static_cast<bool>(*__seg_ & __mask_);} - _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT - {return __bit_iterator<_C, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} + _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT + {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} private: _LIBCPP_INLINE_VISIBILITY __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT @@ -146,11 +146,11 @@ private: // find -template <class _C> -__bit_iterator<_C, false> -__find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +template <class _Cp> +__bit_iterator<_Cp, false> +__find_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_C, false> _It; + typedef __bit_iterator<_Cp, false> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -180,11 +180,11 @@ __find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) return _It(__first.__seg_, static_cast<unsigned>(__n)); } -template <class _C> -__bit_iterator<_C, false> -__find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +template <class _Cp> +__bit_iterator<_Cp, false> +__find_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_C, false> _It; + typedef __bit_iterator<_Cp, false> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -217,23 +217,23 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) return _It(__first.__seg_, static_cast<unsigned>(__n)); } -template <class _C, class _Tp> +template <class _Cp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_C, false> -find(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) +__bit_iterator<_Cp, false> +find(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_) { if (static_cast<bool>(__value_)) - return __find_bool_true(__first, static_cast<typename _C::size_type>(__last - __first)); - return __find_bool_false(__first, static_cast<typename _C::size_type>(__last - __first)); + return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); } // count -template <class _C> -typename __bit_iterator<_C, false>::difference_type -__count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +template <class _Cp> +typename __bit_iterator<_Cp, false>::difference_type +__count_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_C, false> _It; + typedef __bit_iterator<_Cp, false> _It; typedef typename _It::__storage_type __storage_type; typedef typename _It::difference_type difference_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -260,11 +260,11 @@ __count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) return __r; } -template <class _C> -typename __bit_iterator<_C, false>::difference_type -__count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +template <class _Cp> +typename __bit_iterator<_Cp, false>::difference_type +__count_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_C, false> _It; + typedef __bit_iterator<_Cp, false> _It; typedef typename _It::__storage_type __storage_type; typedef typename _It::difference_type difference_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -291,23 +291,23 @@ __count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n return __r; } -template <class _C, class _Tp> +template <class _Cp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -typename __bit_iterator<_C, false>::difference_type -count(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) +typename __bit_iterator<_Cp, false>::difference_type +count(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_) { if (static_cast<bool>(__value_)) - return __count_bool_true(__first, static_cast<typename _C::size_type>(__last - __first)); - return __count_bool_false(__first, static_cast<typename _C::size_type>(__last - __first)); + return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); } // fill_n -template <class _C> +template <class _Cp> void -__fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +__fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_C, false> _It; + typedef __bit_iterator<_Cp, false> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -333,11 +333,11 @@ __fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) } } -template <class _C> +template <class _Cp> void -__fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +__fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_C, false> _It; + typedef __bit_iterator<_Cp, false> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -363,10 +363,10 @@ __fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) } } -template <class _C> +template <class _Cp> _LIBCPP_INLINE_VISIBILITY inline void -fill_n(__bit_iterator<_C, false> __first, typename _C::size_type __n, bool __value_) +fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __value_) { if (__n > 0) { @@ -379,22 +379,22 @@ fill_n(__bit_iterator<_C, false> __first, typename _C::size_type __n, bool __val // fill -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY void -fill(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, bool __value_) +fill(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, bool __value_) { - _VSTD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value_); + _VSTD::fill_n(__first, static_cast<typename _Cp::size_type>(__last - __first), __value_); } // copy -template <class _C, bool _IsConst> -__bit_iterator<_C, false> -__copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, - __bit_iterator<_C, false> __result) +template <class _Cp, bool _IsConst> +__bit_iterator<_Cp, false> +__copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, + __bit_iterator<_Cp, false> __result) { - typedef __bit_iterator<_C, _IsConst> _In; + typedef __bit_iterator<_Cp, _IsConst> _In; typedef typename _In::difference_type difference_type; typedef typename _In::__storage_type __storage_type; static const unsigned __bits_per_word = _In::__bits_per_word; @@ -436,12 +436,12 @@ __copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst return __result; } -template <class _C, bool _IsConst> -__bit_iterator<_C, false> -__copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, - __bit_iterator<_C, false> __result) +template <class _Cp, bool _IsConst> +__bit_iterator<_Cp, false> +__copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, + __bit_iterator<_Cp, false> __result) { - typedef __bit_iterator<_C, _IsConst> _In; + typedef __bit_iterator<_Cp, _IsConst> _In; typedef typename _In::difference_type difference_type; typedef typename _In::__storage_type __storage_type; static const unsigned __bits_per_word = _In::__bits_per_word; @@ -514,10 +514,10 @@ __copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsCon return __result; } -template <class _C, bool _IsConst> +template <class _Cp, bool _IsConst> inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_C, false> -copy(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +__bit_iterator<_Cp, false> +copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { if (__first.__ctz_ == __result.__ctz_) return __copy_aligned(__first, __last, __result); @@ -526,12 +526,12 @@ copy(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, // copy_backward -template <class _C, bool _IsConst> -__bit_iterator<_C, false> -__copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, - __bit_iterator<_C, false> __result) +template <class _Cp, bool _IsConst> +__bit_iterator<_Cp, false> +__copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, + __bit_iterator<_Cp, false> __result) { - typedef __bit_iterator<_C, _IsConst> _In; + typedef __bit_iterator<_Cp, _IsConst> _In; typedef typename _In::difference_type difference_type; typedef typename _In::__storage_type __storage_type; static const unsigned __bits_per_word = _In::__bits_per_word; @@ -573,12 +573,12 @@ __copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, return __result; } -template <class _C, bool _IsConst> -__bit_iterator<_C, false> -__copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, - __bit_iterator<_C, false> __result) +template <class _Cp, bool _IsConst> +__bit_iterator<_Cp, false> +__copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, + __bit_iterator<_Cp, false> __result) { - typedef __bit_iterator<_C, _IsConst> _In; + typedef __bit_iterator<_Cp, _IsConst> _In; typedef typename _In::difference_type difference_type; typedef typename _In::__storage_type __storage_type; static const unsigned __bits_per_word = _In::__bits_per_word; @@ -659,10 +659,10 @@ __copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_ return __result; } -template <class _C, bool _IsConst> +template <class _Cp, bool _IsConst> inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_C, false> -copy_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +__bit_iterator<_Cp, false> +copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { if (__last.__ctz_ == __result.__ctz_) return __copy_backward_aligned(__first, __last, __result); @@ -671,20 +671,20 @@ copy_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> // move -template <class _C, bool _IsConst> +template <class _Cp, bool _IsConst> inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_C, false> -move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +__bit_iterator<_Cp, false> +move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { return _VSTD::copy(__first, __last, __result); } // move_backward -template <class _C, bool _IsConst> +template <class _Cp, bool _IsConst> inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_C, false> -move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +__bit_iterator<_Cp, false> +move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { return _VSTD::copy(__first, __last, __result); } @@ -854,31 +854,31 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __ // rotate -template <class _C> +template <class _Cp> struct __bit_array { - typedef typename _C::difference_type difference_type; - typedef typename _C::__storage_type __storage_type; - typedef typename _C::iterator iterator; - static const unsigned __bits_per_word = _C::__bits_per_word; - static const unsigned _N = 4; + typedef typename _Cp::difference_type difference_type; + typedef typename _Cp::__storage_type __storage_type; + typedef typename _Cp::iterator iterator; + static const unsigned __bits_per_word = _Cp::__bits_per_word; + static const unsigned _Np = 4; difference_type __size_; - __storage_type __word_[_N]; + __storage_type __word_[_Np]; _LIBCPP_INLINE_VISIBILITY static difference_type capacity() - {return static_cast<difference_type>(_N * __bits_per_word);} + {return static_cast<difference_type>(_Np * __bits_per_word);} _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {} _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);} _LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__word_ + __size_ / __bits_per_word, static_cast<unsigned>(__size_ % __bits_per_word));} }; -template <class _C> -__bit_iterator<_C, false> -rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __bit_iterator<_C, false> __last) +template <class _Cp> +__bit_iterator<_Cp, false> +rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle, __bit_iterator<_Cp, false> __last) { - typedef __bit_iterator<_C, false> _I1; + typedef __bit_iterator<_Cp, false> _I1; typedef typename _I1::difference_type difference_type; typedef typename _I1::__storage_type __storage_type; static const unsigned __bits_per_word = _I1::__bits_per_word; @@ -889,16 +889,16 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __ { if (__d1 <= __d2) { - if (__d1 <= __bit_array<_C>::capacity()) + if (__d1 <= __bit_array<_Cp>::capacity()) { - __bit_array<_C> __b(__d1); + __bit_array<_Cp> __b(__d1); _VSTD::copy(__first, __middle, __b.begin()); _VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first)); break; } else { - __bit_iterator<_C, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle); + __bit_iterator<_Cp, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle); __first = __middle; __middle = __mp; __d2 -= __d1; @@ -906,16 +906,16 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __ } else { - if (__d2 <= __bit_array<_C>::capacity()) + if (__d2 <= __bit_array<_Cp>::capacity()) { - __bit_array<_C> __b(__d2); + __bit_array<_Cp> __b(__d2); _VSTD::copy(__middle, __last, __b.begin()); _VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last)); break; } else { - __bit_iterator<_C, false> __mp = __first + __d2; + __bit_iterator<_Cp, false> __mp = __first + __d2; _VSTD::swap_ranges(__first, __mp, __middle); __first = __mp; __d1 -= __d2; @@ -927,12 +927,12 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __ // equal -template <class _C> +template <class _Cp> bool -__equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __last1, - __bit_iterator<_C, true> __first2) +__equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1, + __bit_iterator<_Cp, true> __first2) { - typedef __bit_iterator<_C, true> _It; + typedef __bit_iterator<_Cp, true> _It; typedef typename _It::difference_type difference_type; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -1005,12 +1005,12 @@ __equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __ return true; } -template <class _C> +template <class _Cp> bool -__equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __last1, - __bit_iterator<_C, true> __first2) +__equal_aligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1, + __bit_iterator<_Cp, true> __first2) { - typedef __bit_iterator<_C, true> _It; + typedef __bit_iterator<_Cp, true> _It; typedef typename _It::difference_type difference_type; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -1048,31 +1048,31 @@ __equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __la return true; } -template <class _C, bool _IC1, bool _IC2> +template <class _Cp, bool _IC1, bool _IC2> inline _LIBCPP_INLINE_VISIBILITY bool -equal(__bit_iterator<_C, _IC1> __first1, __bit_iterator<_C, _IC1> __last1, __bit_iterator<_C, _IC2> __first2) +equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2) { if (__first1.__ctz_ == __first2.__ctz_) return __equal_aligned(__first1, __last1, __first2); return __equal_unaligned(__first1, __last1, __first2); } -template <class _C, bool _IsConst> +template <class _Cp, bool _IsConst> class __bit_iterator { public: - typedef typename _C::difference_type difference_type; + typedef typename _Cp::difference_type difference_type; typedef bool value_type; typedef __bit_iterator pointer; - typedef typename conditional<_IsConst, __bit_const_reference<_C>, __bit_reference<_C> >::type reference; + typedef typename conditional<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >::type reference; typedef random_access_iterator_tag iterator_category; private: - typedef typename _C::__storage_type __storage_type; - typedef typename conditional<_IsConst, typename _C::__const_storage_pointer, - typename _C::__storage_pointer>::type __storage_pointer; - static const unsigned __bits_per_word = _C::__bits_per_word; + typedef typename _Cp::__storage_type __storage_type; + typedef typename conditional<_IsConst, typename _Cp::__const_storage_pointer, + typename _Cp::__storage_pointer>::type __storage_pointer; + static const unsigned __bits_per_word = _Cp::__bits_per_word; __storage_pointer __seg_; unsigned __ctz_; @@ -1081,7 +1081,7 @@ public: _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {} _LIBCPP_INLINE_VISIBILITY - __bit_iterator(const __bit_iterator<_C, false>& __it) _NOEXCEPT + __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {} _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT @@ -1189,34 +1189,34 @@ private: : __seg_(__s), __ctz_(__ctz) {} #if defined(__clang__) - friend typename _C::__self; + friend typename _Cp::__self; #else - friend class _C::__self; + friend class _Cp::__self; #endif - friend class __bit_reference<_C>; - friend class __bit_const_reference<_C>; - friend class __bit_iterator<_C, true>; - template <class _D> friend struct __bit_array; - template <class _D> friend void __fill_n_false(__bit_iterator<_D, false> __first, typename _D::size_type __n); - template <class _D> friend void __fill_n_true(__bit_iterator<_D, false> __first, typename _D::size_type __n); - template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_aligned(__bit_iterator<_D, _IC> __first, - __bit_iterator<_D, _IC> __last, - __bit_iterator<_D, false> __result); - template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_unaligned(__bit_iterator<_D, _IC> __first, - __bit_iterator<_D, _IC> __last, - __bit_iterator<_D, false> __result); - template <class _D, bool _IC> friend __bit_iterator<_D, false> copy(__bit_iterator<_D, _IC> __first, - __bit_iterator<_D, _IC> __last, - __bit_iterator<_D, false> __result); - template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_backward_aligned(__bit_iterator<_D, _IC> __first, - __bit_iterator<_D, _IC> __last, - __bit_iterator<_D, false> __result); - template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_backward_unaligned(__bit_iterator<_D, _IC> __first, - __bit_iterator<_D, _IC> __last, - __bit_iterator<_D, false> __result); - template <class _D, bool _IC> friend __bit_iterator<_D, false> copy_backward(__bit_iterator<_D, _IC> __first, - __bit_iterator<_D, _IC> __last, - __bit_iterator<_D, false> __result); + friend class __bit_reference<_Cp>; + friend class __bit_const_reference<_Cp>; + friend class __bit_iterator<_Cp, true>; + template <class _Dp> friend struct __bit_array; + template <class _Dp> friend void __fill_n_false(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n); + template <class _Dp> friend void __fill_n_true(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n); + template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_aligned(__bit_iterator<_Dp, _IC> __first, + __bit_iterator<_Dp, _IC> __last, + __bit_iterator<_Dp, false> __result); + template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_unaligned(__bit_iterator<_Dp, _IC> __first, + __bit_iterator<_Dp, _IC> __last, + __bit_iterator<_Dp, false> __result); + template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy(__bit_iterator<_Dp, _IC> __first, + __bit_iterator<_Dp, _IC> __last, + __bit_iterator<_Dp, false> __result); + template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_aligned(__bit_iterator<_Dp, _IC> __first, + __bit_iterator<_Dp, _IC> __last, + __bit_iterator<_Dp, false> __result); + template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_unaligned(__bit_iterator<_Dp, _IC> __first, + __bit_iterator<_Dp, _IC> __last, + __bit_iterator<_Dp, false> __result); + template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first, + __bit_iterator<_Dp, _IC> __last, + __bit_iterator<_Dp, false> __result); template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>, __bit_iterator<__C1, false>, __bit_iterator<__C2, false>); @@ -1226,22 +1226,22 @@ private: template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>, __bit_iterator<__C1, false>, __bit_iterator<__C2, false>); - template <class _D> friend __bit_iterator<_D, false> rotate(__bit_iterator<_D, false>, - __bit_iterator<_D, false>, - __bit_iterator<_D, false>); - template <class _D> friend bool __equal_aligned(__bit_iterator<_D, true>, - __bit_iterator<_D, true>, - __bit_iterator<_D, true>); - template <class _D> friend bool __equal_unaligned(__bit_iterator<_D, true>, - __bit_iterator<_D, true>, - __bit_iterator<_D, true>); - template <class _D, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_D, _IC1>, - __bit_iterator<_D, _IC1>, - __bit_iterator<_D, _IC2>); - template <class _D> friend __bit_iterator<_D, false> __find_bool_true(__bit_iterator<_D, false>, - typename _D::size_type); - template <class _D> friend __bit_iterator<_D, false> __find_bool_false(__bit_iterator<_D, false>, - typename _D::size_type); + template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>, + __bit_iterator<_Dp, false>, + __bit_iterator<_Dp, false>); + template <class _Dp> friend bool __equal_aligned(__bit_iterator<_Dp, true>, + __bit_iterator<_Dp, true>, + __bit_iterator<_Dp, true>); + template <class _Dp> friend bool __equal_unaligned(__bit_iterator<_Dp, true>, + __bit_iterator<_Dp, true>, + __bit_iterator<_Dp, true>); + template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC2>); + template <class _Dp> friend __bit_iterator<_Dp, false> __find_bool_true(__bit_iterator<_Dp, false>, + typename _Dp::size_type); + template <class _Dp> friend __bit_iterator<_Dp, false> __find_bool_false(__bit_iterator<_Dp, false>, + typename _Dp::size_type); }; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__debug b/libcxx/include/__debug index cd3bd3a98d9..4a0e3cecbb6 100644 --- a/libcxx/include/__debug +++ b/libcxx/include/__debug @@ -83,8 +83,8 @@ _C_node<_Cont>::__dereferenceable(const void* __i) const { typedef typename _Cont::const_iterator iterator; const iterator* __j = static_cast<const iterator*>(__i); - _Cont* _C = static_cast<_Cont*>(__c_); - return _C->__dereferenceable(__j); + _Cont* _Cp = static_cast<_Cont*>(__c_); + return _Cp->__dereferenceable(__j); } template <class _Cont> @@ -93,8 +93,8 @@ _C_node<_Cont>::__decrementable(const void* __i) const { typedef typename _Cont::const_iterator iterator; const iterator* __j = static_cast<const iterator*>(__i); - _Cont* _C = static_cast<_Cont*>(__c_); - return _C->__decrementable(__j); + _Cont* _Cp = static_cast<_Cont*>(__c_); + return _Cp->__decrementable(__j); } template <class _Cont> @@ -103,8 +103,8 @@ _C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const { typedef typename _Cont::const_iterator iterator; const iterator* __j = static_cast<const iterator*>(__i); - _Cont* _C = static_cast<_Cont*>(__c_); - return _C->__addable(__j, __n); + _Cont* _Cp = static_cast<_Cont*>(__c_); + return _Cp->__addable(__j, __n); } template <class _Cont> @@ -113,8 +113,8 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const { typedef typename _Cont::const_iterator iterator; const iterator* __j = static_cast<const iterator*>(__i); - _Cont* _C = static_cast<_Cont*>(__c_); - return _C->__subscriptable(__j, __n); + _Cont* _Cp = static_cast<_Cont*>(__c_); + return _Cp->__subscriptable(__j, __n); } class _LIBCPP_VISIBLE __libcpp_db diff --git a/libcxx/include/__functional_03 b/libcxx/include/__functional_03 index 5d30ce2b750..3a5397d809d 100644 --- a/libcxx/include/__functional_03 +++ b/libcxx/include/__functional_03 @@ -60,140 +60,140 @@ public: } }; -template<class _R, class _T> +template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R _T::*> -mem_fn(_R _T::* __pm) +__mem_fn<_Rp _Tp::*> +mem_fn(_Rp _Tp::* __pm) { - return __mem_fn<_R _T::*>(__pm); + return __mem_fn<_Rp _Tp::*>(__pm); } -template<class _R, class _T> +template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)()> -mem_fn(_R (_T::* __pm)()) +__mem_fn<_Rp (_Tp::*)()> +mem_fn(_Rp (_Tp::* __pm)()) { - return __mem_fn<_R (_T::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)()>(__pm); } -template<class _R, class _T, class _A0> +template<class _Rp, class _Tp, class _A0> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0)> -mem_fn(_R (_T::* __pm)(_A0)) +__mem_fn<_Rp (_Tp::*)(_A0)> +mem_fn(_Rp (_Tp::* __pm)(_A0)) { - return __mem_fn<_R (_T::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); } -template<class _R, class _T, class _A0, class _A1> +template<class _Rp, class _Tp, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1)> -mem_fn(_R (_T::* __pm)(_A0, _A1)) +__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1)) { - return __mem_fn<_R (_T::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); } -template<class _R, class _T, class _A0, class _A1, class _A2> +template<class _Rp, class _Tp, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1, _A2)> -mem_fn(_R (_T::* __pm)(_A0, _A1, _A2)) +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2)) { - return __mem_fn<_R (_T::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); } -template<class _R, class _T> +template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)()> -mem_fn(_R (_T::* __pm)() const) +__mem_fn<_Rp (_Tp::*)()> +mem_fn(_Rp (_Tp::* __pm)() const) { - return __mem_fn<_R (_T::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)()>(__pm); } -template<class _R, class _T, class _A0> +template<class _Rp, class _Tp, class _A0> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0)> -mem_fn(_R (_T::* __pm)(_A0) const) +__mem_fn<_Rp (_Tp::*)(_A0)> +mem_fn(_Rp (_Tp::* __pm)(_A0) const) { - return __mem_fn<_R (_T::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); } -template<class _R, class _T, class _A0, class _A1> +template<class _Rp, class _Tp, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1)> -mem_fn(_R (_T::* __pm)(_A0, _A1) const) +__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const) { - return __mem_fn<_R (_T::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); } -template<class _R, class _T, class _A0, class _A1, class _A2> +template<class _Rp, class _Tp, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1, _A2)> -mem_fn(_R (_T::* __pm)(_A0, _A1, _A2) const) +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const) { - return __mem_fn<_R (_T::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); } -template<class _R, class _T> +template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)()> -mem_fn(_R (_T::* __pm)() volatile) +__mem_fn<_Rp (_Tp::*)()> +mem_fn(_Rp (_Tp::* __pm)() volatile) { - return __mem_fn<_R (_T::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)()>(__pm); } -template<class _R, class _T, class _A0> +template<class _Rp, class _Tp, class _A0> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0)> -mem_fn(_R (_T::* __pm)(_A0) volatile) +__mem_fn<_Rp (_Tp::*)(_A0)> +mem_fn(_Rp (_Tp::* __pm)(_A0) volatile) { - return __mem_fn<_R (_T::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); } -template<class _R, class _T, class _A0, class _A1> +template<class _Rp, class _Tp, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1)> -mem_fn(_R (_T::* __pm)(_A0, _A1) volatile) +__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) volatile) { - return __mem_fn<_R (_T::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); } -template<class _R, class _T, class _A0, class _A1, class _A2> +template<class _Rp, class _Tp, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1, _A2)> -mem_fn(_R (_T::* __pm)(_A0, _A1, _A2) volatile) +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) volatile) { - return __mem_fn<_R (_T::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); } -template<class _R, class _T> +template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)()> -mem_fn(_R (_T::* __pm)() const volatile) +__mem_fn<_Rp (_Tp::*)()> +mem_fn(_Rp (_Tp::* __pm)() const volatile) { - return __mem_fn<_R (_T::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)()>(__pm); } -template<class _R, class _T, class _A0> +template<class _Rp, class _Tp, class _A0> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0)> -mem_fn(_R (_T::* __pm)(_A0) const volatile) +__mem_fn<_Rp (_Tp::*)(_A0)> +mem_fn(_Rp (_Tp::* __pm)(_A0) const volatile) { - return __mem_fn<_R (_T::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); } -template<class _R, class _T, class _A0, class _A1> +template<class _Rp, class _Tp, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1)> -mem_fn(_R (_T::* __pm)(_A0, _A1) const volatile) +__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const volatile) { - return __mem_fn<_R (_T::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); } -template<class _R, class _T, class _A0, class _A1, class _A2> +template<class _Rp, class _Tp, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_A0, _A1, _A2)> -mem_fn(_R (_T::* __pm)(_A0, _A1, _A2) const volatile) +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const volatile) { - return __mem_fn<_R (_T::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); } // bad_function_call @@ -208,32 +208,32 @@ template<class _Fp> class _LIBCPP_VISIBLE function; // undefined namespace __function { -template<class _F> +template<class _Fp> struct __maybe_derive_from_unary_function { }; -template<class _R, class _A1> -struct __maybe_derive_from_unary_function<_R(_A1)> - : public unary_function<_A1, _R> +template<class _Rp, class _A1> +struct __maybe_derive_from_unary_function<_Rp(_A1)> + : public unary_function<_A1, _Rp> { }; -template<class _F> +template<class _Fp> struct __maybe_derive_from_binary_function { }; -template<class _R, class _A1, class _A2> -struct __maybe_derive_from_binary_function<_R(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template<class _Rp, class _A1, class _A2> +struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; template<class _Fp> class __base; -template<class _R> -class __base<_R()> +template<class _Rp> +class __base<_Rp()> { __base(const __base&); __base& operator=(const __base&); @@ -244,15 +244,15 @@ public: virtual void __clone(__base*) const = 0; virtual void destroy() = 0; virtual void destroy_deallocate() = 0; - virtual _R operator()() = 0; + virtual _Rp operator()() = 0; #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const = 0; virtual const std::type_info& target_type() const = 0; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class _A0> -class __base<_R(_A0)> +template<class _Rp, class _A0> +class __base<_Rp(_A0)> { __base(const __base&); __base& operator=(const __base&); @@ -263,15 +263,15 @@ public: virtual void __clone(__base*) const = 0; virtual void destroy() = 0; virtual void destroy_deallocate() = 0; - virtual _R operator()(_A0) = 0; + virtual _Rp operator()(_A0) = 0; #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const = 0; virtual const std::type_info& target_type() const = 0; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class _A0, class _A1> -class __base<_R(_A0, _A1)> +template<class _Rp, class _A0, class _A1> +class __base<_Rp(_A0, _A1)> { __base(const __base&); __base& operator=(const __base&); @@ -282,15 +282,15 @@ public: virtual void __clone(__base*) const = 0; virtual void destroy() = 0; virtual void destroy_deallocate() = 0; - virtual _R operator()(_A0, _A1) = 0; + virtual _Rp operator()(_A0, _A1) = 0; #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const = 0; virtual const std::type_info& target_type() const = 0; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class _A0, class _A1, class _A2> -class __base<_R(_A0, _A1, _A2)> +template<class _Rp, class _A0, class _A1, class _A2> +class __base<_Rp(_A0, _A1, _A2)> { __base(const __base&); __base& operator=(const __base&); @@ -301,7 +301,7 @@ public: virtual void __clone(__base*) const = 0; virtual void destroy() = 0; virtual void destroy_deallocate() = 0; - virtual _R operator()(_A0, _A1, _A2) = 0; + virtual _Rp operator()(_A0, _A1, _A2) = 0; #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const = 0; virtual const std::type_info& target_type() const = 0; @@ -310,360 +310,360 @@ public: template<class _FD, class _Alloc, class _FB> class __func; -template<class _F, class _Alloc, class _R> -class __func<_F, _Alloc, _R()> - : public __base<_R()> +template<class _Fp, class _Alloc, class _Rp> +class __func<_Fp, _Alloc, _Rp()> + : public __base<_Rp()> { - __compressed_pair<_F, _Alloc> __f_; + __compressed_pair<_Fp, _Alloc> __f_; public: - explicit __func(_F __f) : __f_(_VSTD::move(__f)) {} - explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_R()>* __clone() const; - virtual void __clone(__base<_R()>*) const; + explicit __func(_Fp __f) : __f_(_VSTD::move(__f)) {} + explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + virtual __base<_Rp()>* __clone() const; + virtual void __clone(__base<_Rp()>*) const; virtual void destroy(); virtual void destroy_deallocate(); - virtual _R operator()(); + virtual _Rp operator()(); #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const; virtual const std::type_info& target_type() const; #endif // _LIBCPP_NO_RTTI }; -template<class _F, class _Alloc, class _R> -__base<_R()>* -__func<_F, _Alloc, _R()>::__clone() const +template<class _Fp, class _Alloc, class _Rp> +__base<_Rp()>* +__func<_Fp, _Alloc, _Rp()>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - typedef __allocator_destructor<_A> _D; - unique_ptr<__func, _D> __hold(__a.allocate(1), _D(__a, 1)); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); return __hold.release(); } -template<class _F, class _Alloc, class _R> +template<class _Fp, class _Alloc, class _Rp> void -__func<_F, _Alloc, _R()>::__clone(__base<_R()>* __p) const +__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const { ::new (__p) __func(__f_.first(), __f_.second()); } -template<class _F, class _Alloc, class _R> +template<class _Fp, class _Alloc, class _Rp> void -__func<_F, _Alloc, _R()>::destroy() +__func<_Fp, _Alloc, _Rp()>::destroy() { - __f_.~__compressed_pair<_F, _Alloc>(); + __f_.~__compressed_pair<_Fp, _Alloc>(); } -template<class _F, class _Alloc, class _R> +template<class _Fp, class _Alloc, class _Rp> void -__func<_F, _Alloc, _R()>::destroy_deallocate() +__func<_Fp, _Alloc, _Rp()>::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - __f_.~__compressed_pair<_F, _Alloc>(); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); } -template<class _F, class _Alloc, class _R> -_R -__func<_F, _Alloc, _R()>::operator()() +template<class _Fp, class _Alloc, class _Rp> +_Rp +__func<_Fp, _Alloc, _Rp()>::operator()() { return __invoke(__f_.first()); } #ifndef _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R> +template<class _Fp, class _Alloc, class _Rp> const void* -__func<_F, _Alloc, _R()>::target(const type_info& __ti) const +__func<_Fp, _Alloc, _Rp()>::target(const type_info& __ti) const { - if (__ti == typeid(_F)) + if (__ti == typeid(_Fp)) return &__f_.first(); return (const void*)0; } -template<class _F, class _Alloc, class _R> +template<class _Fp, class _Alloc, class _Rp> const std::type_info& -__func<_F, _Alloc, _R()>::target_type() const +__func<_Fp, _Alloc, _Rp()>::target_type() const { - return typeid(_F); + return typeid(_Fp); } #endif // _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class _A0> -class __func<_F, _Alloc, _R(_A0)> - : public __base<_R(_A0)> +template<class _Fp, class _Alloc, class _Rp, class _A0> +class __func<_Fp, _Alloc, _Rp(_A0)> + : public __base<_Rp(_A0)> { - __compressed_pair<_F, _Alloc> __f_; + __compressed_pair<_Fp, _Alloc> __f_; public: - _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {} - _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a) + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f)) {} + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_R(_A0)>* __clone() const; - virtual void __clone(__base<_R(_A0)>*) const; + virtual __base<_Rp(_A0)>* __clone() const; + virtual void __clone(__base<_Rp(_A0)>*) const; virtual void destroy(); virtual void destroy_deallocate(); - virtual _R operator()(_A0); + virtual _Rp operator()(_A0); #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const; virtual const std::type_info& target_type() const; #endif // _LIBCPP_NO_RTTI }; -template<class _F, class _Alloc, class _R, class _A0> -__base<_R(_A0)>* -__func<_F, _Alloc, _R(_A0)>::__clone() const +template<class _Fp, class _Alloc, class _Rp, class _A0> +__base<_Rp(_A0)>* +__func<_Fp, _Alloc, _Rp(_A0)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - typedef __allocator_destructor<_A> _D; - unique_ptr<__func, _D> __hold(__a.allocate(1), _D(__a, 1)); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); return __hold.release(); } -template<class _F, class _Alloc, class _R, class _A0> +template<class _Fp, class _Alloc, class _Rp, class _A0> void -__func<_F, _Alloc, _R(_A0)>::__clone(__base<_R(_A0)>* __p) const +__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const { ::new (__p) __func(__f_.first(), __f_.second()); } -template<class _F, class _Alloc, class _R, class _A0> +template<class _Fp, class _Alloc, class _Rp, class _A0> void -__func<_F, _Alloc, _R(_A0)>::destroy() +__func<_Fp, _Alloc, _Rp(_A0)>::destroy() { - __f_.~__compressed_pair<_F, _Alloc>(); + __f_.~__compressed_pair<_Fp, _Alloc>(); } -template<class _F, class _Alloc, class _R, class _A0> +template<class _Fp, class _Alloc, class _Rp, class _A0> void -__func<_F, _Alloc, _R(_A0)>::destroy_deallocate() +__func<_Fp, _Alloc, _Rp(_A0)>::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - __f_.~__compressed_pair<_F, _Alloc>(); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); } -template<class _F, class _Alloc, class _R, class _A0> -_R -__func<_F, _Alloc, _R(_A0)>::operator()(_A0 __a0) +template<class _Fp, class _Alloc, class _Rp, class _A0> +_Rp +__func<_Fp, _Alloc, _Rp(_A0)>::operator()(_A0 __a0) { return __invoke(__f_.first(), __a0); } #ifndef _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class _A0> +template<class _Fp, class _Alloc, class _Rp, class _A0> const void* -__func<_F, _Alloc, _R(_A0)>::target(const type_info& __ti) const +__func<_Fp, _Alloc, _Rp(_A0)>::target(const type_info& __ti) const { - if (__ti == typeid(_F)) + if (__ti == typeid(_Fp)) return &__f_.first(); return (const void*)0; } -template<class _F, class _Alloc, class _R, class _A0> +template<class _Fp, class _Alloc, class _Rp, class _A0> const std::type_info& -__func<_F, _Alloc, _R(_A0)>::target_type() const +__func<_Fp, _Alloc, _Rp(_A0)>::target_type() const { - return typeid(_F); + return typeid(_Fp); } #endif // _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class _A0, class _A1> -class __func<_F, _Alloc, _R(_A0, _A1)> - : public __base<_R(_A0, _A1)> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +class __func<_Fp, _Alloc, _Rp(_A0, _A1)> + : public __base<_Rp(_A0, _A1)> { - __compressed_pair<_F, _Alloc> __f_; + __compressed_pair<_Fp, _Alloc> __f_; public: - _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {} - _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a) + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f)) {} + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_R(_A0, _A1)>* __clone() const; - virtual void __clone(__base<_R(_A0, _A1)>*) const; + virtual __base<_Rp(_A0, _A1)>* __clone() const; + virtual void __clone(__base<_Rp(_A0, _A1)>*) const; virtual void destroy(); virtual void destroy_deallocate(); - virtual _R operator()(_A0, _A1); + virtual _Rp operator()(_A0, _A1); #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const; virtual const std::type_info& target_type() const; #endif // _LIBCPP_NO_RTTI }; -template<class _F, class _Alloc, class _R, class _A0, class _A1> -__base<_R(_A0, _A1)>* -__func<_F, _Alloc, _R(_A0, _A1)>::__clone() const +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +__base<_Rp(_A0, _A1)>* +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - typedef __allocator_destructor<_A> _D; - unique_ptr<__func, _D> __hold(__a.allocate(1), _D(__a, 1)); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); return __hold.release(); } -template<class _F, class _Alloc, class _R, class _A0, class _A1> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> void -__func<_F, _Alloc, _R(_A0, _A1)>::__clone(__base<_R(_A0, _A1)>* __p) const +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const { ::new (__p) __func(__f_.first(), __f_.second()); } -template<class _F, class _Alloc, class _R, class _A0, class _A1> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> void -__func<_F, _Alloc, _R(_A0, _A1)>::destroy() +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy() { - __f_.~__compressed_pair<_F, _Alloc>(); + __f_.~__compressed_pair<_Fp, _Alloc>(); } -template<class _F, class _Alloc, class _R, class _A0, class _A1> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> void -__func<_F, _Alloc, _R(_A0, _A1)>::destroy_deallocate() +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - __f_.~__compressed_pair<_F, _Alloc>(); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); } -template<class _F, class _Alloc, class _R, class _A0, class _A1> -_R -__func<_F, _Alloc, _R(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +_Rp +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) { return __invoke(__f_.first(), __a0, __a1); } #ifndef _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class _A0, class _A1> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> const void* -__func<_F, _Alloc, _R(_A0, _A1)>::target(const type_info& __ti) const +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target(const type_info& __ti) const { - if (__ti == typeid(_F)) + if (__ti == typeid(_Fp)) return &__f_.first(); return (const void*)0; } -template<class _F, class _Alloc, class _R, class _A0, class _A1> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> const std::type_info& -__func<_F, _Alloc, _R(_A0, _A1)>::target_type() const +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target_type() const { - return typeid(_F); + return typeid(_Fp); } #endif // _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> -class __func<_F, _Alloc, _R(_A0, _A1, _A2)> - : public __base<_R(_A0, _A1, _A2)> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +class __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> + : public __base<_Rp(_A0, _A1, _A2)> { - __compressed_pair<_F, _Alloc> __f_; + __compressed_pair<_Fp, _Alloc> __f_; public: - _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {} - _LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a) + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f)) {} + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_R(_A0, _A1, _A2)>* __clone() const; - virtual void __clone(__base<_R(_A0, _A1, _A2)>*) const; + virtual __base<_Rp(_A0, _A1, _A2)>* __clone() const; + virtual void __clone(__base<_Rp(_A0, _A1, _A2)>*) const; virtual void destroy(); virtual void destroy_deallocate(); - virtual _R operator()(_A0, _A1, _A2); + virtual _Rp operator()(_A0, _A1, _A2); #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const; virtual const std::type_info& target_type() const; #endif // _LIBCPP_NO_RTTI }; -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> -__base<_R(_A0, _A1, _A2)>* -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::__clone() const +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +__base<_Rp(_A0, _A1, _A2)>* +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - typedef __allocator_destructor<_A> _D; - unique_ptr<__func, _D> __hold(__a.allocate(1), _D(__a, 1)); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); return __hold.release(); } -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> void -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::__clone(__base<_R(_A0, _A1, _A2)>* __p) const +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const { ::new (__p) __func(__f_.first(), __f_.second()); } -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> void -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::destroy() +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy() { - __f_.~__compressed_pair<_F, _Alloc>(); + __f_.~__compressed_pair<_Fp, _Alloc>(); } -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> void -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::destroy_deallocate() +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - __f_.~__compressed_pair<_F, _Alloc>(); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); } -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> -_R -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +_Rp +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) { return __invoke(__f_.first(), __a0, __a1, __a2); } #ifndef _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> const void* -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::target(const type_info& __ti) const +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target(const type_info& __ti) const { - if (__ti == typeid(_F)) + if (__ti == typeid(_Fp)) return &__f_.first(); return (const void*)0; } -template<class _F, class _Alloc, class _R, class _A0, class _A1, class _A2> +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> const std::type_info& -__func<_F, _Alloc, _R(_A0, _A1, _A2)>::target_type() const +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const { - return typeid(_F); + return typeid(_Fp); } #endif // _LIBCPP_NO_RTTI } // __function -template<class _R> -class _LIBCPP_VISIBLE function<_R()> +template<class _Rp> +class _LIBCPP_VISIBLE function<_Rp()> { - typedef __function::__base<_R()> __base; + typedef __function::__base<_Rp()> __base; aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template <class _F> - static bool __not_null(const _F&) {return true;} + template <class _Fp> + static bool __not_null(const _Fp&) {return true;} template <class _R2> - static bool __not_null(const function<_R()>& __p) {return __p;} + static bool __not_null(const function<_Rp()>& __p) {return __p;} public: - typedef _R result_type; + typedef _Rp result_type; // 20.7.16.2.1, construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} function(const function&); - template<class _F> - function(_F, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); template<class _Alloc> _LIBCPP_INLINE_VISIBILITY @@ -673,27 +673,27 @@ public: function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} template<class _Alloc> function(allocator_arg_t, const _Alloc&, const function&); - template<class _F, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _F __f, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); function& operator=(const function&); function& operator=(nullptr_t); - template<class _F> + template<class _Fp> typename enable_if < - !is_integral<_F>::value, + !is_integral<_Fp>::value, function& >::type - operator=(_F); + operator=(_Fp); ~function(); // 20.7.16.2.2, function modifiers: void swap(function&); - template<class _F, class _Alloc> + template<class _Fp, class _Alloc> _LIBCPP_INLINE_VISIBILITY - void assign(_F __f, const _Alloc& __a) + void assign(_Fp __f, const _Alloc& __a) {function(allocator_arg, __a, __f).swap(*this);} // 20.7.16.2.3, function capacity: @@ -707,18 +707,18 @@ private: bool operator!=(const function<_R2()>&) const;// = delete; public: // 20.7.16.2.4, function invocation: - _R operator()() const; + _Rp operator()() const; #ifndef _LIBCPP_NO_RTTI // 20.7.16.2.5, function target access: const std::type_info& target_type() const; - template <typename _T> _T* target(); - template <typename _T> const _T* target() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; #endif // _LIBCPP_NO_RTTI }; -template<class _R> -function<_R()>::function(const function& __f) +template<class _Rp> +function<_Rp()>::function(const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -731,9 +731,9 @@ function<_R()>::function(const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R> +template<class _Rp> template<class _Alloc> -function<_R()>::function(allocator_arg_t, const _Alloc&, const function& __f) +function<_Rp()>::function(allocator_arg_t, const _Alloc&, const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -746,15 +746,15 @@ function<_R()>::function(allocator_arg_t, const _Alloc&, const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R> -template <class _F> -function<_R()>::function(_F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp> +template <class _Fp> +function<_Rp()>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { if (__not_null(__f)) { - typedef __function::__func<_F, allocator<_F>, _R()> _FF; + typedef __function::__func<_Fp, allocator<_Fp>, _Rp()> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -762,26 +762,26 @@ function<_R()>::function(_F __f, } else { - typedef allocator<_FF> _A; - _A __a; - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_F>(__a)); + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); __f_ = __hold.release(); } } } -template<class _R> -template <class _F, class _Alloc> -function<_R()>::function(allocator_arg_t, const _Alloc& __a0, _F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp> +template <class _Fp, class _Alloc> +function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; if (__not_null(__f)) { - typedef __function::__func<_F, _Alloc, _R()> _FF; + typedef __function::__func<_Fp, _Alloc, _Rp()> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -795,27 +795,27 @@ function<_R()>::function(allocator_arg_t, const _Alloc& __a0, _F __f, #else rebind_alloc<_FF>::other #endif - _A; - _A __a(__a0); - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); + _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) _FF(__f, _Alloc(__a)); __f_ = __hold.release(); } } } -template<class _R> -function<_R()>& -function<_R()>::operator=(const function& __f) +template<class _Rp> +function<_Rp()>& +function<_Rp()>::operator=(const function& __f) { function(__f).swap(*this); return *this; } -template<class _R> -function<_R()>& -function<_R()>::operator=(nullptr_t) +template<class _Rp> +function<_Rp()>& +function<_Rp()>::operator=(nullptr_t) { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -824,21 +824,21 @@ function<_R()>::operator=(nullptr_t) __f_ = 0; } -template<class _R> -template <class _F> +template<class _Rp> +template <class _Fp> typename enable_if < - !is_integral<_F>::value, - function<_R()>& + !is_integral<_Fp>::value, + function<_Rp()>& >::type -function<_R()>::operator=(_F __f) +function<_Rp()>::operator=(_Fp __f) { function(_VSTD::move(__f)).swap(*this); return *this; } -template<class _R> -function<_R()>::~function() +template<class _Rp> +function<_Rp()>::~function() { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -846,9 +846,9 @@ function<_R()>::~function() __f_->destroy_deallocate(); } -template<class _R> +template<class _Rp> void -function<_R()>::swap(function& __f) +function<_Rp()>::swap(function& __f) { if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) { @@ -883,9 +883,9 @@ function<_R()>::swap(function& __f) _VSTD::swap(__f_, __f.__f_); } -template<class _R> -_R -function<_R()>::operator()() const +template<class _Rp> +_Rp +function<_Rp()>::operator()() const { #ifndef _LIBCPP_NO_EXCEPTIONS if (__f_ == 0) @@ -896,76 +896,76 @@ function<_R()>::operator()() const #ifndef _LIBCPP_NO_RTTI -template<class _R> +template<class _Rp> const std::type_info& -function<_R()>::target_type() const +function<_Rp()>::target_type() const { if (__f_ == 0) return typeid(void); return __f_->target_type(); } -template<class _R> -template <typename _T> -_T* -function<_R()>::target() +template<class _Rp> +template <typename _Tp> +_Tp* +function<_Rp()>::target() { if (__f_ == 0) - return (_T*)0; - return (_T*)__f_->target(typeid(_T)); + return (_Tp*)0; + return (_Tp*)__f_->target(typeid(_Tp)); } -template<class _R> -template <typename _T> -const _T* -function<_R()>::target() const +template<class _Rp> +template <typename _Tp> +const _Tp* +function<_Rp()>::target() const { if (__f_ == 0) - return (const _T*)0; - return (const _T*)__f_->target(typeid(_T)); + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); } #endif // _LIBCPP_NO_RTTI -template<class _R, class _A0> -class _LIBCPP_VISIBLE function<_R(_A0)> - : public unary_function<_A0, _R> +template<class _Rp, class _A0> +class _LIBCPP_VISIBLE function<_Rp(_A0)> + : public unary_function<_A0, _Rp> { - typedef __function::__base<_R(_A0)> __base; + typedef __function::__base<_Rp(_A0)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template <class _F> + template <class _Fp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _F&) {return true;} + static bool __not_null(const _Fp&) {return true;} template <class _R2, class _B0> _LIBCPP_INLINE_VISIBILITY static bool __not_null(_R2 (*__p)(_B0)) {return __p;} - template <class _R2, class _C> + template <class _R2, class _Cp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)()) {return __p;} - template <class _R2, class _C> + static bool __not_null(_R2 (_Cp::*__p)()) {return __p;} + template <class _R2, class _Cp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)() const) {return __p;} - template <class _R2, class _C> + static bool __not_null(_R2 (_Cp::*__p)() const) {return __p;} + template <class _R2, class _Cp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)() volatile) {return __p;} - template <class _R2, class _C> + static bool __not_null(_R2 (_Cp::*__p)() volatile) {return __p;} + template <class _R2, class _Cp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)() const volatile) {return __p;} + static bool __not_null(_R2 (_Cp::*__p)() const volatile) {return __p;} template <class _R2, class _B0> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R(_B0)>& __p) {return __p;} + static bool __not_null(const function<_Rp(_B0)>& __p) {return __p;} public: - typedef _R result_type; + typedef _Rp result_type; // 20.7.16.2.1, construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} function(const function&); - template<class _F> - function(_F, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); template<class _Alloc> _LIBCPP_INLINE_VISIBILITY @@ -975,27 +975,27 @@ public: function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} template<class _Alloc> function(allocator_arg_t, const _Alloc&, const function&); - template<class _F, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _F __f, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); function& operator=(const function&); function& operator=(nullptr_t); - template<class _F> + template<class _Fp> typename enable_if < - !is_integral<_F>::value, + !is_integral<_Fp>::value, function& >::type - operator=(_F); + operator=(_Fp); ~function(); // 20.7.16.2.2, function modifiers: void swap(function&); - template<class _F, class _Alloc> + template<class _Fp, class _Alloc> _LIBCPP_INLINE_VISIBILITY - void assign(_F __f, const _Alloc& __a) + void assign(_Fp __f, const _Alloc& __a) {function(allocator_arg, __a, __f).swap(*this);} // 20.7.16.2.3, function capacity: @@ -1009,18 +1009,18 @@ private: bool operator!=(const function<_R2(_B0)>&) const;// = delete; public: // 20.7.16.2.4, function invocation: - _R operator()(_A0) const; + _Rp operator()(_A0) const; #ifndef _LIBCPP_NO_RTTI // 20.7.16.2.5, function target access: const std::type_info& target_type() const; - template <typename _T> _T* target(); - template <typename _T> const _T* target() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class _A0> -function<_R(_A0)>::function(const function& __f) +template<class _Rp, class _A0> +function<_Rp(_A0)>::function(const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -1033,9 +1033,9 @@ function<_R(_A0)>::function(const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R, class _A0> +template<class _Rp, class _A0> template<class _Alloc> -function<_R(_A0)>::function(allocator_arg_t, const _Alloc&, const function& __f) +function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc&, const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -1048,15 +1048,15 @@ function<_R(_A0)>::function(allocator_arg_t, const _Alloc&, const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R, class _A0> -template <class _F> -function<_R(_A0)>::function(_F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp, class _A0> +template <class _Fp> +function<_Rp(_A0)>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { if (__not_null(__f)) { - typedef __function::__func<_F, allocator<_F>, _R(_A0)> _FF; + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -1064,26 +1064,26 @@ function<_R(_A0)>::function(_F __f, } else { - typedef allocator<_FF> _A; - _A __a; - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_F>(__a)); + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); __f_ = __hold.release(); } } } -template<class _R, class _A0> -template <class _F, class _Alloc> -function<_R(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp, class _A0> +template <class _Fp, class _Alloc> +function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; if (__not_null(__f)) { - typedef __function::__func<_F, _Alloc, _R(_A0)> _FF; + typedef __function::__func<_Fp, _Alloc, _Rp(_A0)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -1097,27 +1097,27 @@ function<_R(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, #else rebind_alloc<_FF>::other #endif - _A; - _A __a(__a0); - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); + _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) _FF(__f, _Alloc(__a)); __f_ = __hold.release(); } } } -template<class _R, class _A0> -function<_R(_A0)>& -function<_R(_A0)>::operator=(const function& __f) +template<class _Rp, class _A0> +function<_Rp(_A0)>& +function<_Rp(_A0)>::operator=(const function& __f) { function(__f).swap(*this); return *this; } -template<class _R, class _A0> -function<_R(_A0)>& -function<_R(_A0)>::operator=(nullptr_t) +template<class _Rp, class _A0> +function<_Rp(_A0)>& +function<_Rp(_A0)>::operator=(nullptr_t) { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1126,21 +1126,21 @@ function<_R(_A0)>::operator=(nullptr_t) __f_ = 0; } -template<class _R, class _A0> -template <class _F> +template<class _Rp, class _A0> +template <class _Fp> typename enable_if < - !is_integral<_F>::value, - function<_R(_A0)>& + !is_integral<_Fp>::value, + function<_Rp(_A0)>& >::type -function<_R(_A0)>::operator=(_F __f) +function<_Rp(_A0)>::operator=(_Fp __f) { function(_VSTD::move(__f)).swap(*this); return *this; } -template<class _R, class _A0> -function<_R(_A0)>::~function() +template<class _Rp, class _A0> +function<_Rp(_A0)>::~function() { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1148,9 +1148,9 @@ function<_R(_A0)>::~function() __f_->destroy_deallocate(); } -template<class _R, class _A0> +template<class _Rp, class _A0> void -function<_R(_A0)>::swap(function& __f) +function<_Rp(_A0)>::swap(function& __f) { if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) { @@ -1185,9 +1185,9 @@ function<_R(_A0)>::swap(function& __f) _VSTD::swap(__f_, __f.__f_); } -template<class _R, class _A0> -_R -function<_R(_A0)>::operator()(_A0 __a0) const +template<class _Rp, class _A0> +_Rp +function<_Rp(_A0)>::operator()(_A0 __a0) const { #ifndef _LIBCPP_NO_EXCEPTIONS if (__f_ == 0) @@ -1198,76 +1198,76 @@ function<_R(_A0)>::operator()(_A0 __a0) const #ifndef _LIBCPP_NO_RTTI -template<class _R, class _A0> +template<class _Rp, class _A0> const std::type_info& -function<_R(_A0)>::target_type() const +function<_Rp(_A0)>::target_type() const { if (__f_ == 0) return typeid(void); return __f_->target_type(); } -template<class _R, class _A0> -template <typename _T> -_T* -function<_R(_A0)>::target() +template<class _Rp, class _A0> +template <typename _Tp> +_Tp* +function<_Rp(_A0)>::target() { if (__f_ == 0) - return (_T*)0; - return (_T*)__f_->target(typeid(_T)); + return (_Tp*)0; + return (_Tp*)__f_->target(typeid(_Tp)); } -template<class _R, class _A0> -template <typename _T> -const _T* -function<_R(_A0)>::target() const +template<class _Rp, class _A0> +template <typename _Tp> +const _Tp* +function<_Rp(_A0)>::target() const { if (__f_ == 0) - return (const _T*)0; - return (const _T*)__f_->target(typeid(_T)); + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); } #endif // _LIBCPP_NO_RTTI -template<class _R, class _A0, class _A1> -class _LIBCPP_VISIBLE function<_R(_A0, _A1)> - : public binary_function<_A0, _A1, _R> +template<class _Rp, class _A0, class _A1> +class _LIBCPP_VISIBLE function<_Rp(_A0, _A1)> + : public binary_function<_A0, _A1, _Rp> { - typedef __function::__base<_R(_A0, _A1)> __base; + typedef __function::__base<_Rp(_A0, _A1)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template <class _F> + template <class _Fp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _F&) {return true;} + static bool __not_null(const _Fp&) {return true;} template <class _R2, class _B0, class _B1> _LIBCPP_INLINE_VISIBILITY static bool __not_null(_R2 (*__p)(_B0, _B1)) {return __p;} - template <class _R2, class _C, class _B1> + template <class _R2, class _Cp, class _B1> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1)) {return __p;} - template <class _R2, class _C, class _B1> + static bool __not_null(_R2 (_Cp::*__p)(_B1)) {return __p;} + template <class _R2, class _Cp, class _B1> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1) const) {return __p;} - template <class _R2, class _C, class _B1> + static bool __not_null(_R2 (_Cp::*__p)(_B1) const) {return __p;} + template <class _R2, class _Cp, class _B1> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1) volatile) {return __p;} - template <class _R2, class _C, class _B1> + static bool __not_null(_R2 (_Cp::*__p)(_B1) volatile) {return __p;} + template <class _R2, class _Cp, class _B1> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1) const volatile) {return __p;} + static bool __not_null(_R2 (_Cp::*__p)(_B1) const volatile) {return __p;} template <class _R2, class _B0, class _B1> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R(_B0, _B1)>& __p) {return __p;} + static bool __not_null(const function<_Rp(_B0, _B1)>& __p) {return __p;} public: - typedef _R result_type; + typedef _Rp result_type; // 20.7.16.2.1, construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} function(const function&); - template<class _F> - function(_F, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); template<class _Alloc> _LIBCPP_INLINE_VISIBILITY @@ -1277,27 +1277,27 @@ public: function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} template<class _Alloc> function(allocator_arg_t, const _Alloc&, const function&); - template<class _F, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _F __f, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); function& operator=(const function&); function& operator=(nullptr_t); - template<class _F> + template<class _Fp> typename enable_if < - !is_integral<_F>::value, + !is_integral<_Fp>::value, function& >::type - operator=(_F); + operator=(_Fp); ~function(); // 20.7.16.2.2, function modifiers: void swap(function&); - template<class _F, class _Alloc> + template<class _Fp, class _Alloc> _LIBCPP_INLINE_VISIBILITY - void assign(_F __f, const _Alloc& __a) + void assign(_Fp __f, const _Alloc& __a) {function(allocator_arg, __a, __f).swap(*this);} // 20.7.16.2.3, function capacity: @@ -1311,18 +1311,18 @@ private: bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete; public: // 20.7.16.2.4, function invocation: - _R operator()(_A0, _A1) const; + _Rp operator()(_A0, _A1) const; #ifndef _LIBCPP_NO_RTTI // 20.7.16.2.5, function target access: const std::type_info& target_type() const; - template <typename _T> _T* target(); - template <typename _T> const _T* target() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class _A0, class _A1> -function<_R(_A0, _A1)>::function(const function& __f) +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>::function(const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -1335,9 +1335,9 @@ function<_R(_A0, _A1)>::function(const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R, class _A0, class _A1> +template<class _Rp, class _A0, class _A1> template<class _Alloc> -function<_R(_A0, _A1)>::function(allocator_arg_t, const _Alloc&, const function& __f) +function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc&, const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -1350,15 +1350,15 @@ function<_R(_A0, _A1)>::function(allocator_arg_t, const _Alloc&, const function& __f_ = __f.__f_->__clone(); } -template<class _R, class _A0, class _A1> -template <class _F> -function<_R(_A0, _A1)>::function(_F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp, class _A0, class _A1> +template <class _Fp> +function<_Rp(_A0, _A1)>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { if (__not_null(__f)) { - typedef __function::__func<_F, allocator<_F>, _R(_A0, _A1)> _FF; + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -1366,26 +1366,26 @@ function<_R(_A0, _A1)>::function(_F __f, } else { - typedef allocator<_FF> _A; - _A __a; - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_F>(__a)); + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); __f_ = __hold.release(); } } } -template<class _R, class _A0, class _A1> -template <class _F, class _Alloc> -function<_R(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp, class _A0, class _A1> +template <class _Fp, class _Alloc> +function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; if (__not_null(__f)) { - typedef __function::__func<_F, _Alloc, _R(_A0, _A1)> _FF; + typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -1399,27 +1399,27 @@ function<_R(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, #else rebind_alloc<_FF>::other #endif - _A; - _A __a(__a0); - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); + _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) _FF(__f, _Alloc(__a)); __f_ = __hold.release(); } } } -template<class _R, class _A0, class _A1> -function<_R(_A0, _A1)>& -function<_R(_A0, _A1)>::operator=(const function& __f) +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>& +function<_Rp(_A0, _A1)>::operator=(const function& __f) { function(__f).swap(*this); return *this; } -template<class _R, class _A0, class _A1> -function<_R(_A0, _A1)>& -function<_R(_A0, _A1)>::operator=(nullptr_t) +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>& +function<_Rp(_A0, _A1)>::operator=(nullptr_t) { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1428,21 +1428,21 @@ function<_R(_A0, _A1)>::operator=(nullptr_t) __f_ = 0; } -template<class _R, class _A0, class _A1> -template <class _F> +template<class _Rp, class _A0, class _A1> +template <class _Fp> typename enable_if < - !is_integral<_F>::value, - function<_R(_A0, _A1)>& + !is_integral<_Fp>::value, + function<_Rp(_A0, _A1)>& >::type -function<_R(_A0, _A1)>::operator=(_F __f) +function<_Rp(_A0, _A1)>::operator=(_Fp __f) { function(_VSTD::move(__f)).swap(*this); return *this; } -template<class _R, class _A0, class _A1> -function<_R(_A0, _A1)>::~function() +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>::~function() { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1450,9 +1450,9 @@ function<_R(_A0, _A1)>::~function() __f_->destroy_deallocate(); } -template<class _R, class _A0, class _A1> +template<class _Rp, class _A0, class _A1> void -function<_R(_A0, _A1)>::swap(function& __f) +function<_Rp(_A0, _A1)>::swap(function& __f) { if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) { @@ -1487,9 +1487,9 @@ function<_R(_A0, _A1)>::swap(function& __f) _VSTD::swap(__f_, __f.__f_); } -template<class _R, class _A0, class _A1> -_R -function<_R(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const +template<class _Rp, class _A0, class _A1> +_Rp +function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const { #ifndef _LIBCPP_NO_EXCEPTIONS if (__f_ == 0) @@ -1500,75 +1500,75 @@ function<_R(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const #ifndef _LIBCPP_NO_RTTI -template<class _R, class _A0, class _A1> +template<class _Rp, class _A0, class _A1> const std::type_info& -function<_R(_A0, _A1)>::target_type() const +function<_Rp(_A0, _A1)>::target_type() const { if (__f_ == 0) return typeid(void); return __f_->target_type(); } -template<class _R, class _A0, class _A1> -template <typename _T> -_T* -function<_R(_A0, _A1)>::target() +template<class _Rp, class _A0, class _A1> +template <typename _Tp> +_Tp* +function<_Rp(_A0, _A1)>::target() { if (__f_ == 0) - return (_T*)0; - return (_T*)__f_->target(typeid(_T)); + return (_Tp*)0; + return (_Tp*)__f_->target(typeid(_Tp)); } -template<class _R, class _A0, class _A1> -template <typename _T> -const _T* -function<_R(_A0, _A1)>::target() const +template<class _Rp, class _A0, class _A1> +template <typename _Tp> +const _Tp* +function<_Rp(_A0, _A1)>::target() const { if (__f_ == 0) - return (const _T*)0; - return (const _T*)__f_->target(typeid(_T)); + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); } #endif // _LIBCPP_NO_RTTI -template<class _R, class _A0, class _A1, class _A2> -class _LIBCPP_VISIBLE function<_R(_A0, _A1, _A2)> +template<class _Rp, class _A0, class _A1, class _A2> +class _LIBCPP_VISIBLE function<_Rp(_A0, _A1, _A2)> { - typedef __function::__base<_R(_A0, _A1, _A2)> __base; + typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template <class _F> + template <class _Fp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _F&) {return true;} + static bool __not_null(const _Fp&) {return true;} template <class _R2, class _B0, class _B1, class _B2> _LIBCPP_INLINE_VISIBILITY static bool __not_null(_R2 (*__p)(_B0, _B1, _B2)) {return __p;} - template <class _R2, class _C, class _B1, class _B2> + template <class _R2, class _Cp, class _B1, class _B2> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1, _B2)) {return __p;} - template <class _R2, class _C, class _B1, class _B2> + static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2)) {return __p;} + template <class _R2, class _Cp, class _B1, class _B2> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1, _B2) const) {return __p;} - template <class _R2, class _C, class _B1, class _B2> + static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) const) {return __p;} + template <class _R2, class _Cp, class _B1, class _B2> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1, _B2) volatile) {return __p;} - template <class _R2, class _C, class _B1, class _B2> + static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) volatile) {return __p;} + template <class _R2, class _Cp, class _B1, class _B2> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_B1, _B2) const volatile) {return __p;} + static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) const volatile) {return __p;} template <class _R2, class _B0, class _B1, class _B2> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R(_B0, _B1, _B2)>& __p) {return __p;} + static bool __not_null(const function<_Rp(_B0, _B1, _B2)>& __p) {return __p;} public: - typedef _R result_type; + typedef _Rp result_type; // 20.7.16.2.1, construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} function(const function&); - template<class _F> - function(_F, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); template<class _Alloc> _LIBCPP_INLINE_VISIBILITY @@ -1578,27 +1578,27 @@ public: function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} template<class _Alloc> function(allocator_arg_t, const _Alloc&, const function&); - template<class _F, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _F __f, - typename enable_if<!is_integral<_F>::value>::type* = 0); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); function& operator=(const function&); function& operator=(nullptr_t); - template<class _F> + template<class _Fp> typename enable_if < - !is_integral<_F>::value, + !is_integral<_Fp>::value, function& >::type - operator=(_F); + operator=(_Fp); ~function(); // 20.7.16.2.2, function modifiers: void swap(function&); - template<class _F, class _Alloc> + template<class _Fp, class _Alloc> _LIBCPP_INLINE_VISIBILITY - void assign(_F __f, const _Alloc& __a) + void assign(_Fp __f, const _Alloc& __a) {function(allocator_arg, __a, __f).swap(*this);} // 20.7.16.2.3, function capacity: @@ -1612,18 +1612,18 @@ private: bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; public: // 20.7.16.2.4, function invocation: - _R operator()(_A0, _A1, _A2) const; + _Rp operator()(_A0, _A1, _A2) const; #ifndef _LIBCPP_NO_RTTI // 20.7.16.2.5, function target access: const std::type_info& target_type() const; - template <typename _T> _T* target(); - template <typename _T> const _T* target() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class _A0, class _A1, class _A2> -function<_R(_A0, _A1, _A2)>::function(const function& __f) +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>::function(const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -1636,9 +1636,9 @@ function<_R(_A0, _A1, _A2)>::function(const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R, class _A0, class _A1, class _A2> +template<class _Rp, class _A0, class _A1, class _A2> template<class _Alloc> -function<_R(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc&, +function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc&, const function& __f) { if (__f.__f_ == 0) @@ -1652,15 +1652,15 @@ function<_R(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc&, __f_ = __f.__f_->__clone(); } -template<class _R, class _A0, class _A1, class _A2> -template <class _F> -function<_R(_A0, _A1, _A2)>::function(_F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp, class _A0, class _A1, class _A2> +template <class _Fp> +function<_Rp(_A0, _A1, _A2)>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { if (__not_null(__f)) { - typedef __function::__func<_F, allocator<_F>, _R(_A0, _A1, _A2)> _FF; + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1, _A2)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -1668,26 +1668,26 @@ function<_R(_A0, _A1, _A2)>::function(_F __f, } else { - typedef allocator<_FF> _A; - _A __a; - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_F>(__a)); + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); __f_ = __hold.release(); } } } -template<class _R, class _A0, class _A1, class _A2> -template <class _F, class _Alloc> -function<_R(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, - typename enable_if<!is_integral<_F>::value>::type*) +template<class _Rp, class _A0, class _A1, class _A2> +template <class _Fp, class _Alloc> +function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; if (__not_null(__f)) { - typedef __function::__func<_F, _Alloc, _R(_A0, _A1, _A2)> _FF; + typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; @@ -1701,27 +1701,27 @@ function<_R(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _F __ #else rebind_alloc<_FF>::other #endif - _A; - _A __a(__a0); - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); + _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) _FF(__f, _Alloc(__a)); __f_ = __hold.release(); } } } -template<class _R, class _A0, class _A1, class _A2> -function<_R(_A0, _A1, _A2)>& -function<_R(_A0, _A1, _A2)>::operator=(const function& __f) +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>& +function<_Rp(_A0, _A1, _A2)>::operator=(const function& __f) { function(__f).swap(*this); return *this; } -template<class _R, class _A0, class _A1, class _A2> -function<_R(_A0, _A1, _A2)>& -function<_R(_A0, _A1, _A2)>::operator=(nullptr_t) +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>& +function<_Rp(_A0, _A1, _A2)>::operator=(nullptr_t) { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1730,21 +1730,21 @@ function<_R(_A0, _A1, _A2)>::operator=(nullptr_t) __f_ = 0; } -template<class _R, class _A0, class _A1, class _A2> -template <class _F> +template<class _Rp, class _A0, class _A1, class _A2> +template <class _Fp> typename enable_if < - !is_integral<_F>::value, - function<_R(_A0, _A1, _A2)>& + !is_integral<_Fp>::value, + function<_Rp(_A0, _A1, _A2)>& >::type -function<_R(_A0, _A1, _A2)>::operator=(_F __f) +function<_Rp(_A0, _A1, _A2)>::operator=(_Fp __f) { function(_VSTD::move(__f)).swap(*this); return *this; } -template<class _R, class _A0, class _A1, class _A2> -function<_R(_A0, _A1, _A2)>::~function() +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>::~function() { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1752,9 +1752,9 @@ function<_R(_A0, _A1, _A2)>::~function() __f_->destroy_deallocate(); } -template<class _R, class _A0, class _A1, class _A2> +template<class _Rp, class _A0, class _A1, class _A2> void -function<_R(_A0, _A1, _A2)>::swap(function& __f) +function<_Rp(_A0, _A1, _A2)>::swap(function& __f) { if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) { @@ -1789,9 +1789,9 @@ function<_R(_A0, _A1, _A2)>::swap(function& __f) _VSTD::swap(__f_, __f.__f_); } -template<class _R, class _A0, class _A1, class _A2> -_R -function<_R(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const +template<class _Rp, class _A0, class _A1, class _A2> +_Rp +function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const { #ifndef _LIBCPP_NO_EXCEPTIONS if (__f_ == 0) @@ -1802,61 +1802,61 @@ function<_R(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const #ifndef _LIBCPP_NO_RTTI -template<class _R, class _A0, class _A1, class _A2> +template<class _Rp, class _A0, class _A1, class _A2> const std::type_info& -function<_R(_A0, _A1, _A2)>::target_type() const +function<_Rp(_A0, _A1, _A2)>::target_type() const { if (__f_ == 0) return typeid(void); return __f_->target_type(); } -template<class _R, class _A0, class _A1, class _A2> -template <typename _T> -_T* -function<_R(_A0, _A1, _A2)>::target() +template<class _Rp, class _A0, class _A1, class _A2> +template <typename _Tp> +_Tp* +function<_Rp(_A0, _A1, _A2)>::target() { if (__f_ == 0) - return (_T*)0; - return (_T*)__f_->target(typeid(_T)); + return (_Tp*)0; + return (_Tp*)__f_->target(typeid(_Tp)); } -template<class _R, class _A0, class _A1, class _A2> -template <typename _T> -const _T* -function<_R(_A0, _A1, _A2)>::target() const +template<class _Rp, class _A0, class _A1, class _A2> +template <typename _Tp> +const _Tp* +function<_Rp(_A0, _A1, _A2)>::target() const { if (__f_ == 0) - return (const _T*)0; - return (const _T*)__f_->target(typeid(_T)); + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); } #endif // _LIBCPP_NO_RTTI -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY bool -operator==(const function<_F>& __f, nullptr_t) {return !__f;} +operator==(const function<_Fp>& __f, nullptr_t) {return !__f;} -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY bool -operator==(nullptr_t, const function<_F>& __f) {return !__f;} +operator==(nullptr_t, const function<_Fp>& __f) {return !__f;} -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY bool -operator!=(const function<_F>& __f, nullptr_t) {return (bool)__f;} +operator!=(const function<_Fp>& __f, nullptr_t) {return (bool)__f;} -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY bool -operator!=(nullptr_t, const function<_F>& __f) {return (bool)__f;} +operator!=(nullptr_t, const function<_Fp>& __f) {return (bool)__f;} -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY void -swap(function<_F>& __x, function<_F>& __y) +swap(function<_Fp>& __x, function<_Fp>& __y) {return __x.swap(__y);} template<class _Tp> struct __is_bind_expression : public false_type {}; @@ -1870,7 +1870,7 @@ template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder namespace placeholders { -template <int _N> struct __ph {}; +template <int _Np> struct __ph {}; extern __ph<1> _1; extern __ph<2> _2; @@ -1885,9 +1885,9 @@ extern __ph<10> _10; } // placeholders -template<int _N> -struct __is_placeholder<placeholders::__ph<_N> > - : public integral_constant<int, _N> {}; +template<int _Np> +struct __is_placeholder<placeholders::__ph<_Np> > + : public integral_constant<int, _Np> {}; template <class _Tp, class _Uj> inline _LIBCPP_INLINE_VISIBILITY @@ -2003,15 +2003,15 @@ struct __mu_return<reference_wrapper<_Ti>, _TupleUj> typedef _Ti& type; }; -template <class _F, class _BoundArgs, class _TupleUj> +template <class _Fp, class _BoundArgs, class _TupleUj> struct __bind_return; -template <class _F, class ..._BoundArgs, class _TupleUj> -struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj> +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> { typedef typename __ref_return < - _F&, + _Fp&, typename __mu_return < _BoundArgs, @@ -2020,12 +2020,12 @@ struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj> >::type type; }; -template <class _F, class ..._BoundArgs, class _TupleUj> -struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj> +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> { typedef typename __ref_return < - _F&, + _Fp&, typename __mu_return < const _BoundArgs, @@ -2034,30 +2034,30 @@ struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj> >::type type; }; -template <class _F, class _BoundArgs, size_t ..._Indx, class _Args> +template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args> inline _LIBCPP_INLINE_VISIBILITY -typename __bind_return<_F, _BoundArgs, _Args>::type -__apply_functor(_F& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, +typename __bind_return<_Fp, _BoundArgs, _Args>::type +__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, _Args&& __args) { return __invoke(__f, __mu(get<_Indx>(__bound_args), __args)...); } -template<class _F, class ..._BoundArgs> +template<class _Fp, class ..._BoundArgs> class __bind { - _F __f_; + _Fp __f_; tuple<_BoundArgs...> __bound_args_; typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices; public: - template <class _G, class ..._BA> - explicit __bind(_G&& __f, _BA&& ...__bound_args) - : __f_(_VSTD::forward<_G>(__f)), + template <class _Gp, class ..._BA> + explicit __bind(_Gp&& __f, _BA&& ...__bound_args) + : __f_(_VSTD::forward<_Gp>(__f)), __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} template <class ..._Args> - typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type + typename __bind_return<_Fp, tuple<_BoundArgs...>, tuple<_Args&&...> >::type operator()(_Args&& ...__args) { // compiler bug workaround @@ -2066,7 +2066,7 @@ public: } template <class ..._Args> - typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type + typename __bind_return<_Fp, tuple<_BoundArgs...>, tuple<_Args&&...> >::type operator()(_Args&& ...__args) const { return __apply_functor(__f_, __bound_args_, __indices(), @@ -2074,20 +2074,20 @@ public: } }; -template<class _F, class ..._BoundArgs> -struct __is_bind_expression<__bind<_F, _BoundArgs...> > : public true_type {}; +template<class _Fp, class ..._BoundArgs> +struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {}; -template<class _R, class _F, class ..._BoundArgs> +template<class _Rp, class _Fp, class ..._BoundArgs> class __bind_r - : public __bind<_F, _BoundArgs...> + : public __bind<_Fp, _BoundArgs...> { - typedef __bind<_F, _BoundArgs...> base; + typedef __bind<_Fp, _BoundArgs...> base; public: - typedef _R result_type; + typedef _Rp result_type; - template <class _G, class ..._BA> - explicit __bind_r(_G&& __f, _BA&& ...__bound_args) - : base(_VSTD::forward<_G>(__f), + template <class _Gp, class ..._BA> + explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args) + : base(_VSTD::forward<_Gp>(__f), _VSTD::forward<_BA>(__bound_args)...) {} template <class ..._Args> @@ -2105,25 +2105,25 @@ public: } }; -template<class _R, class _F, class ..._BoundArgs> -struct __is_bind_expression<__bind_r<_R, _F, _BoundArgs...> > : public true_type {}; +template<class _Rp, class _Fp, class ..._BoundArgs> +struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {}; -template<class _F, class ..._BoundArgs> +template<class _Fp, class ..._BoundArgs> inline _LIBCPP_INLINE_VISIBILITY -__bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> -bind(_F&& __f, _BoundArgs&&... __bound_args) +__bind<typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> +bind(_Fp&& __f, _BoundArgs&&... __bound_args) { - typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> type; - return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); + typedef __bind<typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> type; + return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); } -template<class _R, class _F, class ..._BoundArgs> +template<class _Rp, class _Fp, class ..._BoundArgs> inline _LIBCPP_INLINE_VISIBILITY -__bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> -bind(_F&& __f, _BoundArgs&&... __bound_args) +__bind_r<_Rp, typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> +bind(_Fp&& __f, _BoundArgs&&... __bound_args) { - typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type; - return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); + typedef __bind_r<_Rp, typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> type; + return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); } */ diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base index 8d8e4b5e6e9..2ec3e49596c 100644 --- a/libcxx/include/__functional_base +++ b/libcxx/include/__functional_base @@ -64,9 +64,9 @@ struct __derives_from_unary_function private: struct __two {char _; char __;}; static __two __test(...); - template <class _A, class _R> - static unary_function<_A, _R> - __test(const volatile unary_function<_A, _R>*); + template <class _Ap, class _Rp> + static unary_function<_Ap, _Rp> + __test(const volatile unary_function<_Ap, _Rp>*); public: static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; typedef decltype(__test((_Tp*)0)) type; @@ -78,9 +78,9 @@ struct __derives_from_binary_function private: struct __two {char _; char __;}; static __two __test(...); - template <class _A1, class _A2, class _R> - static binary_function<_A1, _A2, _R> - __test(const volatile binary_function<_A1, _A2, _R>*); + template <class _A1, class _A2, class _Rp> + static binary_function<_A1, _A2, _Rp> + __test(const volatile binary_function<_A1, _A2, _Rp>*); public: static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; typedef decltype(__test((_Tp*)0)) type; @@ -131,173 +131,173 @@ struct __weak_result_type // 0 argument case -template <class _R> -struct __weak_result_type<_R ()> +template <class _Rp> +struct __weak_result_type<_Rp ()> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R> -struct __weak_result_type<_R (&)()> +template <class _Rp> +struct __weak_result_type<_Rp (&)()> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R> -struct __weak_result_type<_R (*)()> +template <class _Rp> +struct __weak_result_type<_Rp (*)()> { - typedef _R result_type; + typedef _Rp result_type; }; // 1 argument case -template <class _R, class _A1> -struct __weak_result_type<_R (_A1)> - : public unary_function<_A1, _R> +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (_A1)> + : public unary_function<_A1, _Rp> { }; -template <class _R, class _A1> -struct __weak_result_type<_R (&)(_A1)> - : public unary_function<_A1, _R> +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (&)(_A1)> + : public unary_function<_A1, _Rp> { }; -template <class _R, class _A1> -struct __weak_result_type<_R (*)(_A1)> - : public unary_function<_A1, _R> +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (*)(_A1)> + : public unary_function<_A1, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)()> - : public unary_function<_C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)()> + : public unary_function<_Cp*, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)() const> - : public unary_function<const _C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() const> + : public unary_function<const _Cp*, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)() volatile> - : public unary_function<volatile _C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() volatile> + : public unary_function<volatile _Cp*, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)() const volatile> - : public unary_function<const volatile _C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() const volatile> + : public unary_function<const volatile _Cp*, _Rp> { }; // 2 argument case -template <class _R, class _A1, class _A2> -struct __weak_result_type<_R (_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template <class _R, class _A1, class _A2> -struct __weak_result_type<_R (*)(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (*)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template <class _R, class _A1, class _A2> -struct __weak_result_type<_R (&)(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (&)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1)> - : public binary_function<_C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1)> + : public binary_function<_Cp*, _A1, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1) const> - : public binary_function<const _C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) const> + : public binary_function<const _Cp*, _A1, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1) volatile> - : public binary_function<volatile _C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> + : public binary_function<volatile _Cp*, _A1, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1) const volatile> - : public binary_function<const volatile _C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> + : public binary_function<const volatile _Cp*, _A1, _Rp> { }; // 3 or more arguments -template <class _R, class _A1, class _A2, class _A3, class ..._A4> -struct __weak_result_type<_R (_A1, _A2, _A3, _A4...)> +template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> +struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _A1, class _A2, class _A3, class ..._A4> -struct __weak_result_type<_R (&)(_A1, _A2, _A3, _A4...)> +template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> +struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _A1, class _A2, class _A3, class ..._A4> -struct __weak_result_type<_R (*)(_A1, _A2, _A3, _A4...)> +template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> +struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...)> +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const> +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) volatile> +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile> +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> { - typedef _R result_type; + typedef _Rp result_type; }; // __invoke // bullets 1 and 2 -template <class _F, class _A0, class ..._Args> +template <class _Fp, class _A0, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)) { return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...); } -template <class _F, class _A0, class ..._Args> +template <class _Fp, class _A0, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)) { return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...); @@ -305,19 +305,19 @@ __invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) // bullets 3 and 4 -template <class _F, class _A0> +template <class _Fp, class _A0> inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0) +__invoke(_Fp&& __f, _A0&& __a0) -> decltype(_VSTD::forward<_A0>(__a0).*__f) { return _VSTD::forward<_A0>(__a0).*__f; } -template <class _F, class _A0> +template <class _Fp, class _A0> inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0) +__invoke(_Fp&& __f, _A0&& __a0) -> decltype((*_VSTD::forward<_A0>(__a0)).*__f) { return (*_VSTD::forward<_A0>(__a0)).*__f; @@ -325,13 +325,13 @@ __invoke(_F&& __f, _A0&& __a0) // bullet 5 -template <class _F, class ..._Args> +template <class _Fp, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _Args&& ...__args) - -> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...)) +__invoke(_Fp&& __f, _Args&& ...__args) + -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)) { - return _VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...); + return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...); } template <class _Tp, class ..._Args> diff --git a/libcxx/include/__functional_base_03 b/libcxx/include/__functional_base_03 index fabda5bc3d4..6c6ce53e6d2 100644 --- a/libcxx/include/__functional_base_03 +++ b/libcxx/include/__functional_base_03 @@ -21,9 +21,9 @@ struct __derives_from_unary_function private: struct __two {char _; char __;}; static __two __test(...); - template <class _A, class _R> - static unary_function<_A, _R> - __test(const volatile unary_function<_A, _R>*); + template <class _Ap, class _Rp> + static unary_function<_Ap, _Rp> + __test(const volatile unary_function<_Ap, _Rp>*); public: static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; typedef decltype(__test((_Tp*)0)) type; @@ -35,9 +35,9 @@ struct __derives_from_binary_function private: struct __two {char _; char __;}; static __two __test(...); - template <class _A1, class _A2, class _R> - static binary_function<_A1, _A2, _R> - __test(const volatile binary_function<_A1, _A2, _R>*); + template <class _A1, class _A2, class _Rp> + static binary_function<_A1, _A2, _Rp> + __test(const volatile binary_function<_A1, _A2, _Rp>*); public: static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; typedef decltype(__test((_Tp*)0)) type; @@ -88,148 +88,148 @@ struct __weak_result_type // 0 argument case -template <class _R> -struct __weak_result_type<_R ()> +template <class _Rp> +struct __weak_result_type<_Rp ()> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R> -struct __weak_result_type<_R (&)()> +template <class _Rp> +struct __weak_result_type<_Rp (&)()> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R> -struct __weak_result_type<_R (*)()> +template <class _Rp> +struct __weak_result_type<_Rp (*)()> { - typedef _R result_type; + typedef _Rp result_type; }; // 1 argument case -template <class _R, class _A1> -struct __weak_result_type<_R (_A1)> - : public unary_function<_A1, _R> +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (_A1)> + : public unary_function<_A1, _Rp> { }; -template <class _R, class _A1> -struct __weak_result_type<_R (&)(_A1)> - : public unary_function<_A1, _R> +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (&)(_A1)> + : public unary_function<_A1, _Rp> { }; -template <class _R, class _A1> -struct __weak_result_type<_R (*)(_A1)> - : public unary_function<_A1, _R> +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (*)(_A1)> + : public unary_function<_A1, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)()> - : public unary_function<_C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)()> + : public unary_function<_Cp*, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)() const> - : public unary_function<const _C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() const> + : public unary_function<const _Cp*, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)() volatile> - : public unary_function<volatile _C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() volatile> + : public unary_function<volatile _Cp*, _Rp> { }; -template <class _R, class _C> -struct __weak_result_type<_R (_C::*)() const volatile> - : public unary_function<const volatile _C*, _R> +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() const volatile> + : public unary_function<const volatile _Cp*, _Rp> { }; // 2 argument case -template <class _R, class _A1, class _A2> -struct __weak_result_type<_R (_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template <class _R, class _A1, class _A2> -struct __weak_result_type<_R (*)(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (*)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template <class _R, class _A1, class _A2> -struct __weak_result_type<_R (&)(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (&)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1)> - : public binary_function<_C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1)> + : public binary_function<_Cp*, _A1, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1) const> - : public binary_function<const _C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) const> + : public binary_function<const _Cp*, _A1, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1) volatile> - : public binary_function<volatile _C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> + : public binary_function<volatile _Cp*, _A1, _Rp> { }; -template <class _R, class _C, class _A1> -struct __weak_result_type<_R (_C::*)(_A1) const volatile> - : public binary_function<const volatile _C*, _A1, _R> +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> + : public binary_function<const volatile _Cp*, _A1, _Rp> { }; // 3 or more arguments -template <class _R, class _A1, class _A2, class _A3> -struct __weak_result_type<_R (_A1, _A2, _A3)> +template <class _Rp, class _A1, class _A2, class _A3> +struct __weak_result_type<_Rp (_A1, _A2, _A3)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _A1, class _A2, class _A3> -struct __weak_result_type<_R (&)(_A1, _A2, _A3)> +template <class _Rp, class _A1, class _A2, class _A3> +struct __weak_result_type<_Rp (&)(_A1, _A2, _A3)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _A1, class _A2, class _A3> -struct __weak_result_type<_R (*)(_A1, _A2, _A3)> +template <class _Rp, class _A1, class _A2, class _A3> +struct __weak_result_type<_Rp (*)(_A1, _A2, _A3)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2> -struct __weak_result_type<_R (_C::*)(_A1, _A2)> +template <class _Rp, class _Cp, class _A1, class _A2> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2)> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2> -struct __weak_result_type<_R (_C::*)(_A1, _A2) const> +template <class _Rp, class _Cp, class _A1, class _A2> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2) const> { - typedef _R result_type; + typedef _Rp result_type; }; -template <class _R, class _C, class _A1, class _A2> -struct __weak_result_type<_R (_C::*)(_A1, _A2) volatile> +template <class _Rp, class _Cp, class _A1, class _A2> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2) volatile> { - typedef _R result_type; + typedef _Rp result_type; }; // __invoke @@ -297,26 +297,26 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2) volatile> // template <class _Tp, class _A0, bool> // struct __ref_return1_member_data1; // -// template <class _R, class _C, class _A0> -// struct __ref_return1_member_data1<_R _C::*, _A0, true> +// template <class _Rp, class _Cp, class _A0> +// struct __ref_return1_member_data1<_Rp _Cp::*, _A0, true> // { -// typedef typename __apply_cv<_A0, _R>::type& type; +// typedef typename __apply_cv<_A0, _Rp>::type& type; // }; // -// template <class _R, class _C, class _A0> -// struct __ref_return1_member_data1<_R _C::*, _A0, false> +// template <class _Rp, class _Cp, class _A0> +// struct __ref_return1_member_data1<_Rp _Cp::*, _A0, false> // { // static _A0 __a; -// typedef typename __apply_cv<decltype(*__a), _R>::type& type; +// typedef typename __apply_cv<decltype(*__a), _Rp>::type& type; // }; // // template <class _Tp, class _A0> // struct __ref_return1_member_data; // -// template <class _R, class _C, class _A0> -// struct __ref_return1_member_data<_R _C::*, _A0> -// : public __ref_return1_member_data1<_R _C::*, _A0, -// is_same<typename remove_cv<_C>::type, +// template <class _Rp, class _Cp, class _A0> +// struct __ref_return1_member_data<_Rp _Cp::*, _A0> +// : public __ref_return1_member_data1<_Rp _Cp::*, _A0, +// is_same<typename remove_cv<_Cp>::type, // typename remove_cv<typename remove_reference<_A0>::type>::type>::value> // { // }; @@ -413,528 +413,528 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2) volatile> // first bullet -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(), _T1& __t1) +__invoke(_Rp (_Tp::*__f)(), _T1& __t1) { return (__t1.*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0), _T1& __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0), _T1& __t1, _A0& __a0) { return (__t1.*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1), _T1& __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1), _T1& __t1, _A0& __a0, _A1& __a1) { return (__t1.*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2), _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2), _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return (__t1.*__f)(__a0, __a1, __a2); } -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)() const, _T1& __t1) +__invoke(_Rp (_Tp::*__f)() const, _T1& __t1) { return (__t1.*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0) const, _T1& __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0) const, _T1& __t1, _A0& __a0) { return (__t1.*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1) const, _T1& __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1) const, _T1& __t1, _A0& __a0, _A1& __a1) { return (__t1.*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2) const, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return (__t1.*__f)(__a0, __a1, __a2); } -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)() volatile, _T1& __t1) +__invoke(_Rp (_Tp::*__f)() volatile, _T1& __t1) { return (__t1.*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0) volatile, _T1& __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0) volatile, _T1& __t1, _A0& __a0) { return (__t1.*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1) volatile, _T1& __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1) volatile, _T1& __t1, _A0& __a0, _A1& __a1) { return (__t1.*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2) volatile, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) volatile, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return (__t1.*__f)(__a0, __a1, __a2); } -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)() const volatile, _T1& __t1) +__invoke(_Rp (_Tp::*__f)() const volatile, _T1& __t1) { return (__t1.*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0) const volatile, _T1& __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0) const volatile, _T1& __t1, _A0& __a0) { return (__t1.*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1) const volatile, _T1& __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1) const volatile, _T1& __t1, _A0& __a0, _A1& __a1) { return (__t1.*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2) const volatile, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const volatile, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return (__t1.*__f)(__a0, __a1, __a2); } // second bullet -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(), _T1 __t1) +__invoke(_Rp (_Tp::*__f)(), _T1 __t1) { return ((*__t1).*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0), _T1 __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0), _T1 __t1, _A0& __a0) { return ((*__t1).*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1), _T1 __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1), _T1 __t1, _A0& __a0, _A1& __a1) { return ((*__t1).*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2), _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2), _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return ((*__t1).*__f)(__a0, __a1, __a2); } -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)() const, _T1 __t1) +__invoke(_Rp (_Tp::*__f)() const, _T1 __t1) { return ((*__t1).*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0) const, _T1 __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0) const, _T1 __t1, _A0& __a0) { return ((*__t1).*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1) const, _T1 __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1) const, _T1 __t1, _A0& __a0, _A1& __a1) { return ((*__t1).*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2) const, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return ((*__t1).*__f)(__a0, __a1, __a2); } -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)() volatile, _T1 __t1) +__invoke(_Rp (_Tp::*__f)() volatile, _T1 __t1) { return ((*__t1).*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0) volatile, _T1 __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0) volatile, _T1 __t1, _A0& __a0) { return ((*__t1).*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1) volatile, _T1 __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1) volatile, _T1 __t1, _A0& __a0, _A1& __a1) { return ((*__t1).*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2) volatile, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) volatile, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return ((*__t1).*__f)(__a0, __a1, __a2); } -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)() const volatile, _T1 __t1) +__invoke(_Rp (_Tp::*__f)() const volatile, _T1 __t1) { return ((*__t1).*__f)(); } -template <class _R, class _T, class _T1, class _A0> +template <class _Rp, class _Tp, class _T1, class _A0> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0) const volatile, _T1 __t1, _A0& __a0) +__invoke(_Rp (_Tp::*__f)(_A0) const volatile, _T1 __t1, _A0& __a0) { return ((*__t1).*__f)(__a0); } -template <class _R, class _T, class _T1, class _A0, class _A1> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1) const volatile, _T1 __t1, _A0& __a0, _A1& __a1) +__invoke(_Rp (_Tp::*__f)(_A0, _A1) const volatile, _T1 __t1, _A0& __a0, _A1& __a1) { return ((*__t1).*__f)(__a0, __a1); } -template <class _R, class _T, class _T1, class _A0, class _A1, class _A2> +template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - !is_base_of<_T, typename remove_reference<_T1>::type>::value, - _R + !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + _Rp >::type -__invoke(_R (_T::*__f)(_A0, _A1, _A2) const volatile, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) +__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const volatile, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2) { return ((*__t1).*__f)(__a0, __a1, __a2); } // third bullet -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_base_of<_T, typename remove_reference<_T1>::type>::value, - typename __apply_cv<_T1, _R>::type& + is_base_of<_Tp, typename remove_reference<_T1>::type>::value, + typename __apply_cv<_T1, _Rp>::type& >::type -__invoke(_R _T::* __f, _T1& __t1) +__invoke(_Rp _Tp::* __f, _T1& __t1) { return __t1.*__f; } -template <class _R, class _T> +template <class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY void -__invoke(_R _T::*) +__invoke(_Rp _Tp::*) { } -// template <class _D, class _R, class _T, class _T1> +// template <class _Dp, class _Rp, class _Tp, class _T1> // inline _LIBCPP_INLINE_VISIBILITY // typename enable_if // < -// is_base_of<_T, typename remove_reference<_T1>::type>::value, -// typename __ref_return1<_R _T::*, _T1>::type +// is_base_of<_Tp, typename remove_reference<_T1>::type>::value, +// typename __ref_return1<_Rp _Tp::*, _T1>::type // >::type -// __invoke(_R _T::* __f, _T1& __t1) +// __invoke(_Rp _Tp::* __f, _T1& __t1) // { // return __t1.*__f; // } // forth bullet -template <class _T1, class _R, bool> +template <class _T1, class _Rp, bool> struct __4th_helper { }; -template <class _T1, class _R> -struct __4th_helper<_T1, _R, true> +template <class _T1, class _Rp> +struct __4th_helper<_T1, _Rp, true> { - typedef typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _R>::type type; + typedef typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Rp>::type type; }; -template <class _R, class _T, class _T1> +template <class _Rp, class _Tp, class _T1> inline _LIBCPP_INLINE_VISIBILITY -typename __4th_helper<_T1, _R, - !is_base_of<_T, +typename __4th_helper<_T1, _Rp, + !is_base_of<_Tp, typename remove_reference<_T1>::type >::value >::type& -__invoke(_R _T::* __f, _T1& __t1) +__invoke(_Rp _Tp::* __f, _T1& __t1) { return (*__t1).*__f; } -// template <class _D, class _R, class _T, class _T1> +// template <class _Dp, class _Rp, class _Tp, class _T1> // inline _LIBCPP_INLINE_VISIBILITY // typename enable_if // < -// !is_base_of<_T, typename remove_reference<_T1>::type>::value, -// typename __ref_return1<_R _T::*, _T1>::type +// !is_base_of<_Tp, typename remove_reference<_T1>::type>::value, +// typename __ref_return1<_Rp _Tp::*, _T1>::type // >::type -// __invoke(_R _T::* __f, _T1 __t1) +// __invoke(_Rp _Tp::* __f, _T1 __t1) // { // return (*__t1).*__f; // } // fifth bullet -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY -decltype(declval<_F>()()) -__invoke(_F __f) +decltype(declval<_Fp>()()) +__invoke(_Fp __f) { return __f(); } -template <class _F, class _A0> +template <class _Fp, class _A0> inline _LIBCPP_INLINE_VISIBILITY -decltype(declval<_F>()(declval<_A0&>())) -__invoke(_F __f, _A0& __a0) +decltype(declval<_Fp>()(declval<_A0&>())) +__invoke(_Fp __f, _A0& __a0) { return __f(__a0); } -template <class _F, class _A0, class _A1> +template <class _Fp, class _A0, class _A1> inline _LIBCPP_INLINE_VISIBILITY -decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>())) -__invoke(_F __f, _A0& __a0, _A1& __a1) +decltype(declval<_Fp>()(declval<_A0&>(), declval<_A1&>())) +__invoke(_Fp __f, _A0& __a0, _A1& __a1) { return __f(__a0, __a1); } -template <class _F, class _A0, class _A1, class _A2> +template <class _Fp, class _A0, class _A1, class _A2> inline _LIBCPP_INLINE_VISIBILITY -decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>())) -__invoke(_F __f, _A0& __a0, _A1& __a1, _A2& __a2) +decltype(declval<_Fp>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>())) +__invoke(_Fp __f, _A0& __a0, _A1& __a1, _A2& __a2) { return __f(__a0, __a1, __a2); } -// template <class _R, class _F> +// template <class _Rp, class _Fp> // inline _LIBCPP_INLINE_VISIBILITY -// _R -// __invoke(_F& __f) +// _Rp +// __invoke(_Fp& __f) // { // return __f(); // } // -// template <class _R, class _F, class _A0> +// template <class _Rp, class _Fp, class _A0> // inline _LIBCPP_INLINE_VISIBILITY // typename enable_if // < -// !is_member_pointer<_F>::value, -// _R +// !is_member_pointer<_Fp>::value, +// _Rp // >::type -// __invoke(_F& __f, _A0& __a0) +// __invoke(_Fp& __f, _A0& __a0) // { // return __f(__a0); // } // -// template <class _R, class _F, class _A0, class _A1> +// template <class _Rp, class _Fp, class _A0, class _A1> // inline _LIBCPP_INLINE_VISIBILITY -// _R -// __invoke(_F& __f, _A0& __a0, _A1& __a1) +// _Rp +// __invoke(_Fp& __f, _A0& __a0, _A1& __a1) // { // return __f(__a0, __a1); // } // -// template <class _R, class _F, class _A0, class _A1, class _A2> +// template <class _Rp, class _Fp, class _A0, class _A1, class _A2> // inline _LIBCPP_INLINE_VISIBILITY -// _R -// __invoke(_F& __f, _A0& __a0, _A1& __a1, _A2& __a2) +// _Rp +// __invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2) // { // return __f(__a0, __a1, __a2); // } @@ -950,16 +950,16 @@ public: static const bool value = sizeof(__test<_Tp>(0)) == 1; }; -template <class _F, bool = __has_result_type<__weak_result_type<_F> >::value> +template <class _Fp, bool = __has_result_type<__weak_result_type<_Fp> >::value> struct __invoke_return { - typedef typename __weak_result_type<_F>::result_type type; + typedef typename __weak_result_type<_Fp>::result_type type; }; -template <class _F> -struct __invoke_return<_F, false> +template <class _Fp> +struct __invoke_return<_Fp, false> { - typedef decltype(__invoke(_VSTD::declval<_F>())) type; + typedef decltype(__invoke(_VSTD::declval<_Fp>())) type; }; template <class _Tp, class _A0> @@ -968,16 +968,16 @@ struct __invoke_return0 typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>())) type; }; -template <class _R, class _T, class _A0> -struct __invoke_return0<_R _T::*, _A0> +template <class _Rp, class _Tp, class _A0> +struct __invoke_return0<_Rp _Tp::*, _A0> { - typedef typename __apply_cv<_A0, _R>::type& type; + typedef typename __apply_cv<_A0, _Rp>::type& type; }; -template <class _R, class _T, class _A0> -struct __invoke_return0<_R _T::*, _A0*> +template <class _Rp, class _Tp, class _A0> +struct __invoke_return0<_Rp _Tp::*, _A0*> { - typedef typename __apply_cv<_A0, _R>::type& type; + typedef typename __apply_cv<_A0, _Rp>::type& type; }; template <class _Tp, class _A0, class _A1> diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index 39de62acd03..23f4bd3a26d 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -604,15 +604,15 @@ public: pair<iterator, bool> __insert_unique(const value_type& __x); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P> - pair<iterator, bool> __insert_unique(_P&& __x); + template <class _Pp> + pair<iterator, bool> __insert_unique(_Pp&& __x); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P> - iterator __insert_multi(_P&& __x); - template <class _P> - iterator __insert_multi(const_iterator __p, _P&& __x); + template <class _Pp> + iterator __insert_multi(_Pp&& __x); + template <class _Pp> + iterator __insert_multi(const_iterator __p, _Pp&& __x); #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES iterator __insert_multi(const value_type& __x); iterator __insert_multi(const_iterator __p, const value_type& __x); @@ -644,8 +644,8 @@ public: template <class _Key> const_iterator find(const _Key& __x) const; - typedef __hash_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __hash_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; iterator erase(const_iterator __p); iterator erase(const_iterator __first, const_iterator __last); @@ -752,37 +752,37 @@ private: _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} - template <class _A> + template <class _Ap> _LIBCPP_INLINE_VISIBILITY static void - __swap_alloc(_A& __x, _A& __y) + __swap_alloc(_Ap& __x, _Ap& __y) _NOEXCEPT_( - !allocator_traits<_A>::propagate_on_container_swap::value || - __is_nothrow_swappable<_A>::value) + !allocator_traits<_Ap>::propagate_on_container_swap::value || + __is_nothrow_swappable<_Ap>::value) { __swap_alloc(__x, __y, integral_constant<bool, - allocator_traits<_A>::propagate_on_container_swap::value + allocator_traits<_Ap>::propagate_on_container_swap::value >()); } - template <class _A> + template <class _Ap> _LIBCPP_INLINE_VISIBILITY static void - __swap_alloc(_A& __x, _A& __y, true_type) - _NOEXCEPT_(__is_nothrow_swappable<_A>::value) + __swap_alloc(_Ap& __x, _Ap& __y, true_type) + _NOEXCEPT_(__is_nothrow_swappable<_Ap>::value) { using _VSTD::swap; swap(__x, __y); } - template <class _A> + template <class _Ap> _LIBCPP_INLINE_VISIBILITY static void - __swap_alloc(_A& __x, _A& __y, false_type) _NOEXCEPT {} + __swap_alloc(_Ap& __x, _Ap& __y, false_type) _NOEXCEPT {} void __deallocate(__node_pointer __np) _NOEXCEPT; __node_pointer __detach() _NOEXCEPT; @@ -1422,11 +1422,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi( #endif // _LIBCPP_HAS_NO_VARIADICS template <class _Tp, class _Hash, class _Equal, class _Alloc> -template <class _P> +template <class _Pp> pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_P&& __x) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_Pp&& __x) { - __node_holder __h = __construct_node(_VSTD::forward<_P>(__x)); + __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x)); pair<iterator, bool> __r = __node_insert_unique(__h.get()); if (__r.second) __h.release(); @@ -1438,23 +1438,23 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_P&& __x) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Tp, class _Hash, class _Equal, class _Alloc> -template <class _P> +template <class _Pp> typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_P&& __x) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_Pp&& __x) { - __node_holder __h = __construct_node(_VSTD::forward<_P>(__x)); + __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x)); iterator __r = __node_insert_multi(__h.get()); __h.release(); return __r; } template <class _Tp, class _Hash, class _Equal, class _Alloc> -template <class _P> +template <class _Pp> typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p, - _P&& __x) + _Pp&& __x) { - __node_holder __h = __construct_node(_VSTD::forward<_P>(__x)); + __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x)); iterator __r = __node_insert_multi(__p, __h.get()); __h.release(); return __r; @@ -1616,7 +1616,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args) { __node_allocator& __na = __node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); __h.get_deleter().__value_constructed = true; __h->__hash_ = hash_function()(__h->__value_); @@ -1632,7 +1632,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v, size_t __hash) { __node_allocator& __na = __node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __h.get_deleter().__value_constructed = true; __h->__hash_ = __hash; @@ -1647,7 +1647,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v) { __node_allocator& __na = __node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v); __h.get_deleter().__value_constructed = true; __h->__hash_ = hash_function()(__h->__value_); @@ -1663,7 +1663,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v size_t __hash) { __node_allocator& __na = __node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v); __h.get_deleter().__value_constructed = true; __h->__hash_ = __hash; @@ -1758,7 +1758,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT __pn->__next_ = __cn->__next_; __cn->__next_ = nullptr; --size(); - return __node_holder(__cn, _D(__node_alloc(), true)); + return __node_holder(__cn, _Dp(__node_alloc(), true)); } template <class _Tp, class _Hash, class _Equal, class _Alloc> diff --git a/libcxx/include/__locale b/libcxx/include/__locale index 28cb3ef6529..bb1fb1b4097 100644 --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -1123,7 +1123,7 @@ extern template class codecvt_byname<char32_t, char, mbstate_t>; _LIBCPP_VISIBLE void __throw_runtime_error(const char*); -template <size_t _N> +template <size_t _Np> struct __narrow_to_utf8 { template <class _OutputIterator, class _CharT> @@ -1213,7 +1213,7 @@ struct __narrow_to_utf8<32> } }; -template <size_t _N> +template <size_t _Np> struct __widen_from_utf8 { template <class _OutputIterator> diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer index 581f1596cca..b63a6c7f197 100644 --- a/libcxx/include/__split_buffer +++ b/libcxx/include/__split_buffer @@ -392,8 +392,8 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al __first_ = __alloc_traits::allocate(__alloc(), __cap); __begin_ = __end_ = __first_; __end_cap() = __first_ + __cap; - typedef move_iterator<iterator> _I; - __construct_at_end(_I(__c.begin()), _I(__c.end())); + typedef move_iterator<iterator> _Ip; + __construct_at_end(_Ip(__c.begin()), _Ip(__c.end())); } } diff --git a/libcxx/include/__sso_allocator b/libcxx/include/__sso_allocator index 16354d83cc5..7240072cafd 100644 --- a/libcxx/include/__sso_allocator +++ b/libcxx/include/__sso_allocator @@ -21,20 +21,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template <class _Tp, size_t _N> class _LIBCPP_HIDDEN __sso_allocator; +template <class _Tp, size_t _Np> class _LIBCPP_HIDDEN __sso_allocator; -template <size_t _N> -class _LIBCPP_HIDDEN __sso_allocator<void, _N> +template <size_t _Np> +class _LIBCPP_HIDDEN __sso_allocator<void, _Np> { public: typedef const void* const_pointer; typedef void value_type; }; -template <class _Tp, size_t _N> +template <class _Tp, size_t _Np> class _LIBCPP_HIDDEN __sso_allocator { - typename aligned_storage<sizeof(_Tp) * _N>::type buf_; + typename aligned_storage<sizeof(_Tp) * _Np>::type buf_; bool __allocated_; public: typedef size_t size_type; @@ -43,14 +43,14 @@ public: _LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {} _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator&) throw() : __allocated_(false) {} - template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _N>&) throw() + template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _Np>&) throw() : __allocated_(false) {} private: __sso_allocator& operator=(const __sso_allocator&); public: - _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _N>::const_pointer = 0) + _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = 0) { - if (!__allocated_ && __n <= _N) + if (!__allocated_ && __n <= _Np) { __allocated_ = true; return (pointer)&buf_; diff --git a/libcxx/include/__tree b/libcxx/include/__tree index ad5d2f4b8ea..f57c80c850e 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -932,14 +932,14 @@ public: __emplace_hint_multi(const_iterator __p, _Args&&... __args); #endif // _LIBCPP_HAS_NO_VARIADICS - template <class _V> - pair<iterator, bool> __insert_unique(_V&& __v); - template <class _V> - iterator __insert_unique(const_iterator __p, _V&& __v); - template <class _V> - iterator __insert_multi(_V&& __v); - template <class _V> - iterator __insert_multi(const_iterator __p, _V&& __v); + template <class _Vp> + pair<iterator, bool> __insert_unique(_Vp&& __v); + template <class _Vp> + iterator __insert_unique(const_iterator __p, _Vp&& __v); + template <class _Vp> + iterator __insert_multi(_Vp&& __v); + template <class _Vp> + iterator __insert_multi(const_iterator __p, _Vp&& __v); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES pair<iterator, bool> __insert_unique(const value_type& __v); @@ -1021,8 +1021,8 @@ public: pair<const_iterator, const_iterator> __equal_range_multi(const _Key& __k) const; - typedef __tree_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __tree_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; __node_holder remove(const_iterator __p) _NOEXCEPT; private: @@ -1711,7 +1711,7 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_holder __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args) { __node_allocator& __na = __node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); __h.get_deleter().__value_constructed = true; return __h; @@ -1781,11 +1781,11 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p, #endif // _LIBCPP_HAS_NO_VARIADICS template <class _Tp, class _Compare, class _Allocator> -template <class _V> +template <class _Vp> pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool> -__tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v) +__tree<_Tp, _Compare, _Allocator>::__insert_unique(_Vp&& __v) { - __node_holder __h = __construct_node(_VSTD::forward<_V>(__v)); + __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); pair<iterator, bool> __r = __node_insert_unique(__h.get()); if (__r.second) __h.release(); @@ -1793,11 +1793,11 @@ __tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v) } template <class _Tp, class _Compare, class _Allocator> -template <class _V> +template <class _Vp> typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _V&& __v) +__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _Vp&& __v) { - __node_holder __h = __construct_node(_VSTD::forward<_V>(__v)); + __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); iterator __r = __node_insert_unique(__p, __h.get()); if (__r.__ptr_ == __h.get()) __h.release(); @@ -1805,11 +1805,11 @@ __tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _V&& __v) } template <class _Tp, class _Compare, class _Allocator> -template <class _V> +template <class _Vp> typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(_V&& __v) +__tree<_Tp, _Compare, _Allocator>::__insert_multi(_Vp&& __v) { - __node_holder __h = __construct_node(_VSTD::forward<_V>(__v)); + __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); __node_base_pointer __parent; __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_); __insert_node_at(__parent, __child, __h.get()); @@ -1817,11 +1817,11 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(_V&& __v) } template <class _Tp, class _Compare, class _Allocator> -template <class _V> +template <class _Vp> typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _V&& __v) +__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _Vp&& __v) { - __node_holder __h = __construct_node(_VSTD::forward<_V>(__v)); + __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); __node_base_pointer __parent; __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_); __insert_node_at(__parent, __child, __h.get()); @@ -1835,7 +1835,7 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_holder __tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v) { __node_allocator& __na = __node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v); __h.get_deleter().__value_constructed = true; return _VSTD::move(__h); @@ -2053,7 +2053,7 @@ template <class _Key> typename __tree<_Tp, _Compare, _Allocator>::size_type __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const { - typedef pair<const_iterator, const_iterator> _P; + typedef pair<const_iterator, const_iterator> _Pp; __node_const_pointer __result = __end_node(); __node_const_pointer __rt = __root(); while (__rt != nullptr) @@ -2160,7 +2160,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator> __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) { - typedef pair<iterator, iterator> _P; + typedef pair<iterator, iterator> _Pp; __node_pointer __result = __end_node(); __node_pointer __rt = __root(); while (__rt != nullptr) @@ -2173,13 +2173,13 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) else if (value_comp()(__rt->__value_, __k)) __rt = static_cast<__node_pointer>(__rt->__right_); else - return _P(iterator(__rt), + return _Pp(iterator(__rt), iterator( __rt->__right_ != nullptr ? static_cast<__node_pointer>(__tree_min(__rt->__right_)) : __result)); } - return _P(iterator(__result), iterator(__result)); + return _Pp(iterator(__result), iterator(__result)); } template <class _Tp, class _Compare, class _Allocator> @@ -2188,7 +2188,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator, typename __tree<_Tp, _Compare, _Allocator>::const_iterator> __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const { - typedef pair<const_iterator, const_iterator> _P; + typedef pair<const_iterator, const_iterator> _Pp; __node_const_pointer __result = __end_node(); __node_const_pointer __rt = __root(); while (__rt != nullptr) @@ -2201,13 +2201,13 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const else if (value_comp()(__rt->__value_, __k)) __rt = static_cast<__node_const_pointer>(__rt->__right_); else - return _P(const_iterator(__rt), + return _Pp(const_iterator(__rt), const_iterator( __rt->__right_ != nullptr ? static_cast<__node_const_pointer>(__tree_min(__rt->__right_)) : __result)); } - return _P(const_iterator(__result), const_iterator(__result)); + return _Pp(const_iterator(__result), const_iterator(__result)); } template <class _Tp, class _Compare, class _Allocator> @@ -2216,7 +2216,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, typename __tree<_Tp, _Compare, _Allocator>::iterator> __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) { - typedef pair<iterator, iterator> _P; + typedef pair<iterator, iterator> _Pp; __node_pointer __result = __end_node(); __node_pointer __rt = __root(); while (__rt != nullptr) @@ -2229,10 +2229,10 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) else if (value_comp()(__rt->__value_, __k)) __rt = static_cast<__node_pointer>(__rt->__right_); else - return _P(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), __rt), + return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), __rt), __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result)); } - return _P(iterator(__result), iterator(__result)); + return _Pp(iterator(__result), iterator(__result)); } template <class _Tp, class _Compare, class _Allocator> @@ -2241,7 +2241,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator, typename __tree<_Tp, _Compare, _Allocator>::const_iterator> __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const { - typedef pair<const_iterator, const_iterator> _P; + typedef pair<const_iterator, const_iterator> _Pp; __node_const_pointer __result = __end_node(); __node_const_pointer __rt = __root(); while (__rt != nullptr) @@ -2254,10 +2254,10 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const else if (value_comp()(__rt->__value_, __k)) __rt = static_cast<__node_const_pointer>(__rt->__right_); else - return _P(__lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt), + return _Pp(__lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt), __upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result)); } - return _P(const_iterator(__result), const_iterator(__result)); + return _Pp(const_iterator(__result), const_iterator(__result)); } template <class _Tp, class _Compare, class _Allocator> @@ -2275,7 +2275,7 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT --size(); __tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__np)); - return __node_holder(__np, _D(__node_alloc())); + return __node_holder(__np, _Dp(__node_alloc())); } template <class _Tp, class _Compare, class _Allocator> diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 6255c52f30d..7c250a9beb8 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -2422,29 +2422,29 @@ minmax(initializer_list<_Tp> __t, _Compare __comp) // __independent_bits_engine -template <unsigned long long _X, size_t _R> +template <unsigned long long _Xp, size_t _Rp> struct __log2_imp { - static const size_t value = _X & ((unsigned long long)(1) << _R) ? _R - : __log2_imp<_X, _R - 1>::value; + static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp + : __log2_imp<_Xp, _Rp - 1>::value; }; -template <unsigned long long _X> -struct __log2_imp<_X, 0> +template <unsigned long long _Xp> +struct __log2_imp<_Xp, 0> { static const size_t value = 0; }; -template <size_t _R> -struct __log2_imp<0, _R> +template <size_t _Rp> +struct __log2_imp<0, _Rp> { - static const size_t value = _R + 1; + static const size_t value = _Rp + 1; }; -template <class _UI, _UI _X> +template <class _UI, _UI _Xp> struct __log2 { - static const size_t value = __log2_imp<_X, + static const size_t value = __log2_imp<_Xp, sizeof(_UI) * __CHAR_BIT__ - 1>::value; }; @@ -2474,9 +2474,9 @@ private: _Engine_result_type __mask0_; _Engine_result_type __mask1_; - static const _Working_result_type _R = _Engine::_Max - _Engine::_Min + static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + _Working_result_type(1); - static const size_t __m = __log2<_Working_result_type, _R>::value; + static const size_t __m = __log2<_Working_result_type, _Rp>::value; static const size_t _WDt = numeric_limits<_Working_result_type>::digits; static const size_t _EDt = numeric_limits<_Engine_result_type>::digits; @@ -2485,7 +2485,7 @@ public: __independent_bits_engine(_Engine& __e, size_t __w); // generating functions - result_type operator()() {return __eval(integral_constant<bool, _R != 0>());} + result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} private: result_type __eval(false_type); @@ -2500,24 +2500,24 @@ __independent_bits_engine<_Engine, _UIntType> { __n_ = __w_ / __m + (__w_ % __m != 0); __w0_ = __w_ / __n_; - if (_R == 0) - __y0_ = _R; + if (_Rp == 0) + __y0_ = _Rp; else if (__w0_ < _WDt) - __y0_ = (_R >> __w0_) << __w0_; + __y0_ = (_Rp >> __w0_) << __w0_; else __y0_ = 0; - if (_R - __y0_ > __y0_ / __n_) + if (_Rp - __y0_ > __y0_ / __n_) { ++__n_; __w0_ = __w_ / __n_; if (__w0_ < _WDt) - __y0_ = (_R >> __w0_) << __w0_; + __y0_ = (_Rp >> __w0_) << __w0_; else __y0_ = 0; } __n0_ = __n_ - __w_ % __n_; if (__w0_ < _WDt - 1) - __y1_ = (_R >> (__w0_ + 1)) << (__w0_ + 1); + __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1); else __y1_ = 0; __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) : @@ -2539,7 +2539,7 @@ template<class _Engine, class _UIntType> _UIntType __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) { - result_type _S = 0; + result_type _Sp = 0; for (size_t __k = 0; __k < __n0_; ++__k) { _Engine_result_type __u; @@ -2548,10 +2548,10 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) __u = __e_() - _Engine::min(); } while (__u >= __y0_); if (__w0_ < _WDt) - _S <<= __w0_; + _Sp <<= __w0_; else - _S = 0; - _S += __u & __mask0_; + _Sp = 0; + _Sp += __u & __mask0_; } for (size_t __k = __n0_; __k < __n_; ++__k) { @@ -2561,12 +2561,12 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) __u = __e_() - _Engine::min(); } while (__u >= __y1_); if (__w0_ < _WDt - 1) - _S <<= __w0_ + 1; + _Sp <<= __w0_ + 1; else - _S = 0; - _S += __u & __mask1_; + _Sp = 0; + _Sp += __u & __mask1_; } - return _S; + return _Sp; } // uniform_int_distribution @@ -2639,22 +2639,22 @@ uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p { typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), uint32_t, uint64_t>::type _UIntType; - const _UIntType _R = __p.b() - __p.a() + _UIntType(1); - if (_R == 1) + const _UIntType _Rp = __p.b() - __p.a() + _UIntType(1); + if (_Rp == 1) return __p.a(); const size_t _Dt = numeric_limits<_UIntType>::digits; typedef __independent_bits_engine<_URNG, _UIntType> _Eng; - if (_R == 0) + if (_Rp == 0) return static_cast<result_type>(_Eng(__g, _Dt)()); - size_t __w = _Dt - __clz(_R) - 1; - if ((_R & (_UIntType(~0) >> (_Dt - __w))) != 0) + size_t __w = _Dt - __clz(_Rp) - 1; + if ((_Rp & (_UIntType(~0) >> (_Dt - __w))) != 0) ++__w; _Eng __e(__g, __w); _UIntType __u; do { __u = __e(); - } while (__u >= _R); + } while (__u >= _Rp); return static_cast<result_type>(__u + __p.a()); } @@ -2691,16 +2691,16 @@ void random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef uniform_int_distribution<ptrdiff_t> _D; - typedef typename _D::param_type _P; + typedef uniform_int_distribution<ptrdiff_t> _Dp; + typedef typename _Dp::param_type _Pp; difference_type __d = __last - __first; if (__d > 1) { - _D __uid; + _Dp __uid; __rs_default __g = __rs_get(); for (--__last, --__d; __first < __last; ++__first, --__d) { - difference_type __i = __uid(__g, _P(0, __d)); + difference_type __i = __uid(__g, _Pp(0, __d)); if (__i != difference_type(0)) swap(*__first, *(__first + __i)); } @@ -2737,15 +2737,15 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> #endif { typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef uniform_int_distribution<ptrdiff_t> _D; - typedef typename _D::param_type _P; + typedef uniform_int_distribution<ptrdiff_t> _Dp; + typedef typename _Dp::param_type _Pp; difference_type __d = __last - __first; if (__d > 1) { - _D __uid; + _Dp __uid; for (--__last, --__d; __first < __last; ++__first, --__d) { - difference_type __i = __uid(__g, _P(0, __d)); + difference_type __i = __uid(__g, _Pp(0, __d)); if (__i != difference_type(0)) swap(*__first, *(__first + __i)); } diff --git a/libcxx/include/bitset b/libcxx/include/bitset index 4735754c6f9..37f9fee7601 100644 --- a/libcxx/include/bitset +++ b/libcxx/include/bitset @@ -695,11 +695,11 @@ bitset<_Size>::bitset(const _CharT* __str, #else assert(!"bitset string ctor has invalid argument"); #endif - size_t _M = _VSTD::min(__rlen, _Size); + size_t _Mp = _VSTD::min(__rlen, _Size); size_t __i = 0; - for (; __i < _M; ++__i) + for (; __i < _Mp; ++__i) { - _CharT __c = __str[_M - 1 - __i]; + _CharT __c = __str[_Mp - 1 - __i]; if (__c == __zero) (*this)[__i] = false; else @@ -729,11 +729,11 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str, #else assert(!"bitset string ctor has invalid argument"); #endif - size_t _M = _VSTD::min(__rlen, _Size); + size_t _Mp = _VSTD::min(__rlen, _Size); size_t __i = 0; - for (; __i < _M; ++__i) + for (; __i < _Mp; ++__i) { - _CharT __c = __str[__pos + _M - 1 - __i]; + _CharT __c = __str[__pos + _Mp - 1 - __i]; if (_Traits::eq(__c, __zero)) (*this)[__i] = false; else diff --git a/libcxx/include/deque b/libcxx/include/deque index f304f569086..27bc33e6ad0 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -280,10 +280,10 @@ public: _LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT {} - template <class _P, class _R, class _MP> + template <class _Pp, class _Rp, class _MP> _LIBCPP_INLINE_VISIBILITY - __deque_iterator(const __deque_iterator<value_type, _P, _R, _MP, difference_type, __block_size>& __it, - typename enable_if<is_convertible<_P, pointer>::value>::type* = 0) _NOEXCEPT + __deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, __block_size>& __it, + typename enable_if<is_convertible<_Pp, pointer>::value>::type* = 0) _NOEXCEPT : __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {} _LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__ptr_;} @@ -409,9 +409,9 @@ private: _LIBCPP_INLINE_VISIBILITY __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT : __m_iter_(__m), __ptr_(__p) {} - template <class _Tp, class _A> friend class __deque_base; - template <class _Tp, class _A> friend class _LIBCPP_VISIBLE deque; - template <class _V, class _P, class _R, class _MP, class _D, _D> + template <class _Tp, class _Ap> friend class __deque_base; + template <class _Tp, class _Ap> friend class _LIBCPP_VISIBLE deque; + template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp> friend class _LIBCPP_VISIBLE __deque_iterator; template <class _RAIter, @@ -1510,8 +1510,8 @@ deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a) { if (__a != __c.__alloc()) { - typedef move_iterator<iterator> _I; - assign(_I(__c.begin()), _I(__c.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); } } @@ -1533,8 +1533,8 @@ deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) { if (__base::__alloc() != __c.__alloc()) { - typedef move_iterator<iterator> _I; - assign(_I(__c.begin()), _I(__c.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); } else __move_assign(__c, true_type()); diff --git a/libcxx/include/exception b/libcxx/include/exception index 0a747f50fb3..ae78f891e70 100644 --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -146,9 +146,9 @@ public: _ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr); }; -template<class _E> +template<class _Ep> exception_ptr -make_exception_ptr(_E __e) _NOEXCEPT +make_exception_ptr(_Ep __e) _NOEXCEPT { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -224,11 +224,11 @@ throw_with_nested (_Tp& __t, typename enable_if< #endif } -template <class _E> +template <class _Ep> inline _LIBCPP_INLINE_VISIBILITY void -rethrow_if_nested(const _E& __e, typename enable_if< - is_polymorphic<_E>::value +rethrow_if_nested(const _Ep& __e, typename enable_if< + is_polymorphic<_Ep>::value >::type* = 0) { const nested_exception* __nep = dynamic_cast<const nested_exception*>(&__e); @@ -236,11 +236,11 @@ rethrow_if_nested(const _E& __e, typename enable_if< __nep->rethrow_nested(); } -template <class _E> +template <class _Ep> inline _LIBCPP_INLINE_VISIBILITY void -rethrow_if_nested(const _E& __e, typename enable_if< - !is_polymorphic<_E>::value +rethrow_if_nested(const _Ep& __e, typename enable_if< + !is_polymorphic<_Ep>::value >::type* = 0) { } diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map index 9e62e7a777d..f6a11f07f9c 100644 --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -499,8 +499,8 @@ private: typedef typename __table::__node_traits __node_traits; typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node __node; - typedef __hash_map_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __hash_map_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; typedef allocator_traits<allocator_type> __alloc_traits; public: typedef typename __alloc_traits::pointer pointer; @@ -671,7 +671,7 @@ typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k) { __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); @@ -776,8 +776,8 @@ private: typedef typename __table::__node_traits __node_traits; typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node __node; - typedef __hash_map_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __hash_map_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; typedef allocator_traits<allocator_type> __alloc_traits; public: typedef typename __alloc_traits::pointer pointer; diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list index ffd44a595d0..19f748478f5 100644 --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -772,8 +772,8 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n) if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1)); for (__node_pointer __p = base::__before_begin(); __n > 0; --__n, __p = __p->__next_) { @@ -848,8 +848,8 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x, { if (base::__alloc() != __x.__alloc()) { - typedef move_iterator<iterator> _I; - insert_after(cbefore_begin(), _I(__x.begin()), _I(__x.end())); + typedef move_iterator<iterator> _Ip; + insert_after(cbefore_begin(), _Ip(__x.begin()), _Ip(__x.end())); } } @@ -906,8 +906,8 @@ forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, false_type) __move_assign(__x, true_type()); else { - typedef move_iterator<iterator> _I; - assign(_I(__x.begin()), _I(__x.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__x.begin()), _Ip(__x.end())); } } @@ -995,8 +995,8 @@ void forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); __h->__next_ = base::__before_begin()->__next_; @@ -1010,8 +1010,8 @@ void forward_list<_Tp, _Alloc>::push_front(value_type&& __v) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __h->__next_ = base::__before_begin()->__next_; base::__before_begin()->__next_ = __h.release(); @@ -1024,8 +1024,8 @@ void forward_list<_Tp, _Alloc>::push_front(const value_type& __v) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __h->__next_ = base::__before_begin()->__next_; base::__before_begin()->__next_ = __h.release(); @@ -1052,8 +1052,8 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args) { __node_pointer const __r = const_cast<__node_pointer>(__p.__ptr_); __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); __h->__next_ = __r->__next_; @@ -1069,8 +1069,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v) { __node_pointer const __r = const_cast<__node_pointer>(__p.__ptr_); __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __h->__next_ = __r->__next_; __r->__next_ = __h.release(); @@ -1085,8 +1085,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, const value_type& __ { __node_pointer const __r = const_cast<__node_pointer>(__p.__ptr_); __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __h->__next_ = __r->__next_; __r->__next_ = __h.release(); @@ -1102,8 +1102,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n, if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __node_pointer __first = __h.release(); __node_pointer __last = __first; @@ -1152,8 +1152,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, if (__f != __l) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f); __node_pointer __first = __h.release(); __node_pointer __last = __first; @@ -1244,8 +1244,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n) if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1)); for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n, __ptr = __ptr->__next_) { @@ -1276,8 +1276,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v) if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1)); for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n, __ptr = __ptr->__next_) { @@ -1569,12 +1569,12 @@ template <class _Tp, class _Alloc> bool operator==(const forward_list<_Tp, _Alloc>& __x, const forward_list<_Tp, _Alloc>& __y) { - typedef forward_list<_Tp, _Alloc> _C; - typedef typename _C::const_iterator _I; - _I __ix = __x.begin(); - _I __ex = __x.end(); - _I __iy = __y.begin(); - _I __ey = __y.end(); + typedef forward_list<_Tp, _Alloc> _Cp; + typedef typename _Cp::const_iterator _Ip; + _Ip __ix = __x.begin(); + _Ip __ex = __x.end(); + _Ip __iy = __y.begin(); + _Ip __ey = __y.end(); for (; __ix != __ex && __iy != __ey; ++__ix, ++__iy) if (!(*__ix == *__iy)) return false; diff --git a/libcxx/include/functional b/libcxx/include/functional index 59b132c4515..1ade26fa503 100644 --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -198,7 +198,7 @@ namespace placeholders { . . . - extern unspecified _M; + extern unspecified _Mp; } template <class Operation> @@ -890,44 +890,44 @@ public: } }; -template<class _R, class _T> +template<class _Rp, class _Tp> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R _T::*> -mem_fn(_R _T::* __pm) +__mem_fn<_Rp _Tp::*> +mem_fn(_Rp _Tp::* __pm) { - return __mem_fn<_R _T::*>(__pm); + return __mem_fn<_Rp _Tp::*>(__pm); } -template<class _R, class _T, class ..._Args> +template<class _Rp, class _Tp, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_Args...)> -mem_fn(_R (_T::* __pm)(_Args...)) +__mem_fn<_Rp (_Tp::*)(_Args...)> +mem_fn(_Rp (_Tp::* __pm)(_Args...)) { - return __mem_fn<_R (_T::*)(_Args...)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_Args...)>(__pm); } -template<class _R, class _T, class ..._Args> +template<class _Rp, class _Tp, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_Args...) const> -mem_fn(_R (_T::* __pm)(_Args...) const) +__mem_fn<_Rp (_Tp::*)(_Args...) const> +mem_fn(_Rp (_Tp::* __pm)(_Args...) const) { - return __mem_fn<_R (_T::*)(_Args...) const>(__pm); + return __mem_fn<_Rp (_Tp::*)(_Args...) const>(__pm); } -template<class _R, class _T, class ..._Args> +template<class _Rp, class _Tp, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_Args...) volatile> -mem_fn(_R (_T::* __pm)(_Args...) volatile) +__mem_fn<_Rp (_Tp::*)(_Args...) volatile> +mem_fn(_Rp (_Tp::* __pm)(_Args...) volatile) { - return __mem_fn<_R (_T::*)(_Args...) volatile>(__pm); + return __mem_fn<_Rp (_Tp::*)(_Args...) volatile>(__pm); } -template<class _R, class _T, class ..._Args> +template<class _Rp, class _Tp, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_R (_T::*)(_Args...) const volatile> -mem_fn(_R (_T::* __pm)(_Args...) const volatile) +__mem_fn<_Rp (_Tp::*)(_Args...) const volatile> +mem_fn(_Rp (_Tp::* __pm)(_Args...) const volatile) { - return __mem_fn<_R (_T::*)(_Args...) const volatile>(__pm); + return __mem_fn<_Rp (_Tp::*)(_Args...) const volatile>(__pm); } // bad_function_call @@ -942,32 +942,32 @@ template<class _Fp> class _LIBCPP_VISIBLE function; // undefined namespace __function { -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> struct __maybe_derive_from_unary_function { }; -template<class _R, class _A1> -struct __maybe_derive_from_unary_function<_R(_A1)> - : public unary_function<_A1, _R> +template<class _Rp, class _A1> +struct __maybe_derive_from_unary_function<_Rp(_A1)> + : public unary_function<_A1, _Rp> { }; -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> struct __maybe_derive_from_binary_function { }; -template<class _R, class _A1, class _A2> -struct __maybe_derive_from_binary_function<_R(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template<class _Rp, class _A1, class _A2> +struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; template<class _Fp> class __base; -template<class _R, class ..._ArgTypes> -class __base<_R(_ArgTypes...)> +template<class _Rp, class ..._ArgTypes> +class __base<_Rp(_ArgTypes...)> { __base(const __base&); __base& operator=(const __base&); @@ -978,7 +978,7 @@ public: virtual void __clone(__base*) const = 0; virtual void destroy() _NOEXCEPT = 0; virtual void destroy_deallocate() _NOEXCEPT = 0; - virtual _R operator()(_ArgTypes&& ...) = 0; + virtual _Rp operator()(_ArgTypes&& ...) = 0; #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const _NOEXCEPT = 0; virtual const std::type_info& target_type() const _NOEXCEPT = 0; @@ -987,139 +987,139 @@ public: template<class _FD, class _Alloc, class _FB> class __func; -template<class _F, class _Alloc, class _R, class ..._ArgTypes> -class __func<_F, _Alloc, _R(_ArgTypes...)> - : public __base<_R(_ArgTypes...)> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +class __func<_Fp, _Alloc, _Rp(_ArgTypes...)> + : public __base<_Rp(_ArgTypes...)> { - __compressed_pair<_F, _Alloc> __f_; + __compressed_pair<_Fp, _Alloc> __f_; public: _LIBCPP_INLINE_VISIBILITY - explicit __func(_F __f) : __f_(_VSTD::move(__f)) {} + explicit __func(_Fp __f) : __f_(_VSTD::move(__f)) {} _LIBCPP_INLINE_VISIBILITY - explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_R(_ArgTypes...)>* __clone() const; - virtual void __clone(__base<_R(_ArgTypes...)>*) const; + explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + virtual __base<_Rp(_ArgTypes...)>* __clone() const; + virtual void __clone(__base<_Rp(_ArgTypes...)>*) const; virtual void destroy() _NOEXCEPT; virtual void destroy_deallocate() _NOEXCEPT; - virtual _R operator()(_ArgTypes&& ... __arg); + virtual _Rp operator()(_ArgTypes&& ... __arg); #ifndef _LIBCPP_NO_RTTI virtual const void* target(const type_info&) const _NOEXCEPT; virtual const std::type_info& target_type() const _NOEXCEPT; #endif // _LIBCPP_NO_RTTI }; -template<class _F, class _Alloc, class _R, class ..._ArgTypes> -__base<_R(_ArgTypes...)>* -__func<_F, _Alloc, _R(_ArgTypes...)>::__clone() const +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +__base<_Rp(_ArgTypes...)>* +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - typedef __allocator_destructor<_A> _D; - unique_ptr<__func, _D> __hold(__a.allocate(1), _D(__a, 1)); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); return __hold.release(); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> void -__func<_F, _Alloc, _R(_ArgTypes...)>::__clone(__base<_R(_ArgTypes...)>* __p) const +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const { ::new (__p) __func(__f_.first(), __f_.second()); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> void -__func<_F, _Alloc, _R(_ArgTypes...)>::destroy() _NOEXCEPT +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() _NOEXCEPT { - __f_.~__compressed_pair<_F, _Alloc>(); + __f_.~__compressed_pair<_Fp, _Alloc>(); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> void -__func<_F, _Alloc, _R(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT { - typedef typename _Alloc::template rebind<__func>::other _A; - _A __a(__f_.second()); - __f_.~__compressed_pair<_F, _Alloc>(); + typedef typename _Alloc::template rebind<__func>::other _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> -_R -__func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +_Rp +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) { return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...); } #ifndef _LIBCPP_NO_RTTI -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> const void* -__func<_F, _Alloc, _R(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT { - if (__ti == typeid(_F)) + if (__ti == typeid(_Fp)) return &__f_.first(); return (const void*)0; } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> const std::type_info& -__func<_F, _Alloc, _R(_ArgTypes...)>::target_type() const _NOEXCEPT +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT { - return typeid(_F); + return typeid(_Fp); } #endif // _LIBCPP_NO_RTTI } // __function -template<class _R, class ..._ArgTypes> -class _LIBCPP_VISIBLE function<_R(_ArgTypes...)> - : public __function::__maybe_derive_from_unary_function<_R(_ArgTypes...)>, - public __function::__maybe_derive_from_binary_function<_R(_ArgTypes...)> +template<class _Rp, class ..._ArgTypes> +class _LIBCPP_VISIBLE function<_Rp(_ArgTypes...)> + : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>, + public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)> { - typedef __function::__base<_R(_ArgTypes...)> __base; + typedef __function::__base<_Rp(_ArgTypes...)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template <class _F> + template <class _Fp> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _F&) {return true;} - template <class _R2, class ..._A> + static bool __not_null(const _Fp&) {return true;} + template <class _R2, class ..._Ap> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (*__p)(_A...)) {return __p;} - template <class _R2, class _C, class ..._A> + static bool __not_null(_R2 (*__p)(_Ap...)) {return __p;} + template <class _R2, class _Cp, class ..._Ap> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_A...)) {return __p;} - template <class _R2, class _C, class ..._A> + static bool __not_null(_R2 (_Cp::*__p)(_Ap...)) {return __p;} + template <class _R2, class _Cp, class ..._Ap> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_A...) const) {return __p;} - template <class _R2, class _C, class ..._A> + static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const) {return __p;} + template <class _R2, class _Cp, class ..._Ap> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_A...) volatile) {return __p;} - template <class _R2, class _C, class ..._A> + static bool __not_null(_R2 (_Cp::*__p)(_Ap...) volatile) {return __p;} + template <class _R2, class _Cp, class ..._Ap> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_C::*__p)(_A...) const volatile) {return __p;} - template <class _R2, class ..._A> + static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const volatile) {return __p;} + template <class _R2, class ..._Ap> _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R(_A...)>& __p) {return __p;} + static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;} - template <class _F, bool = __invokable<_F&, _ArgTypes...>::value> + template <class _Fp, bool = __invokable<_Fp&, _ArgTypes...>::value> struct __callable; - template <class _F> - struct __callable<_F, true> + template <class _Fp> + struct __callable<_Fp, true> { static const bool value = - is_convertible<typename __invoke_of<_F&, _ArgTypes...>::type, - _R>::value; + is_convertible<typename __invoke_of<_Fp&, _ArgTypes...>::type, + _Rp>::value; }; - template <class _F> - struct __callable<_F, false> + template <class _Fp> + struct __callable<_Fp, false> { static const bool value = false; }; public: - typedef _R result_type; + typedef _Rp result_type; // construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY @@ -1128,9 +1128,9 @@ public: function(nullptr_t) _NOEXCEPT : __f_(0) {} function(const function&); function(function&&) _NOEXCEPT; - template<class _F> - function(_F, - typename enable_if<__callable<_F>::value>::type* = 0); + template<class _Fp> + function(_Fp, + typename enable_if<__callable<_Fp>::value>::type* = 0); template<class _Alloc> _LIBCPP_INLINE_VISIBILITY @@ -1142,29 +1142,29 @@ public: function(allocator_arg_t, const _Alloc&, const function&); template<class _Alloc> function(allocator_arg_t, const _Alloc&, function&&); - template<class _F, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _F __f, - typename enable_if<__callable<_F>::value>::type* = 0); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<__callable<_Fp>::value>::type* = 0); function& operator=(const function&); function& operator=(function&&) _NOEXCEPT; function& operator=(nullptr_t) _NOEXCEPT; - template<class _F> + template<class _Fp> typename enable_if < - __callable<typename decay<_F>::type>::value, + __callable<typename decay<_Fp>::type>::value, function& >::type - operator=(_F&&); + operator=(_Fp&&); ~function(); // function modifiers: void swap(function&) _NOEXCEPT; - template<class _F, class _Alloc> + template<class _Fp, class _Alloc> _LIBCPP_INLINE_VISIBILITY - void assign(_F&& __f, const _Alloc& __a) - {function(allocator_arg, __a, _VSTD::forward<_F>(__f)).swap(*this);} + void assign(_Fp&& __f, const _Alloc& __a) + {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);} // function capacity: _LIBCPP_INLINE_VISIBILITY @@ -1177,18 +1177,18 @@ public: bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete; public: // function invocation: - _R operator()(_ArgTypes...) const; + _Rp operator()(_ArgTypes...) const; #ifndef _LIBCPP_NO_RTTI // function target access: const std::type_info& target_type() const _NOEXCEPT; - template <typename _T> _T* target() _NOEXCEPT; - template <typename _T> const _T* target() const _NOEXCEPT; + template <typename _Tp> _Tp* target() _NOEXCEPT; + template <typename _Tp> const _Tp* target() const _NOEXCEPT; #endif // _LIBCPP_NO_RTTI }; -template<class _R, class ..._ArgTypes> -function<_R(_ArgTypes...)>::function(const function& __f) +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>::function(const function& __f) { if (__f.__f_ == 0) __f_ = 0; @@ -1201,9 +1201,9 @@ function<_R(_ArgTypes...)>::function(const function& __f) __f_ = __f.__f_->__clone(); } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> template <class _Alloc> -function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, +function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, const function& __f) { if (__f.__f_ == 0) @@ -1217,8 +1217,8 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, __f_ = __f.__f_->__clone(); } -template<class _R, class ..._ArgTypes> -function<_R(_ArgTypes...)>::function(function&& __f) _NOEXCEPT +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT { if (__f.__f_ == 0) __f_ = 0; @@ -1234,9 +1234,9 @@ function<_R(_ArgTypes...)>::function(function&& __f) _NOEXCEPT } } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> template <class _Alloc> -function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, +function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, function&& __f) { if (__f.__f_ == 0) @@ -1253,43 +1253,43 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, } } -template<class _R, class ..._ArgTypes> -template <class _F> -function<_R(_ArgTypes...)>::function(_F __f, - typename enable_if<__callable<_F>::value>::type*) +template<class _Rp, class ..._ArgTypes> +template <class _Fp> +function<_Rp(_ArgTypes...)>::function(_Fp __f, + typename enable_if<__callable<_Fp>::value>::type*) : __f_(0) { if (__not_null(__f)) { - typedef __function::__func<_F, allocator<_F>, _R(_ArgTypes...)> _FF; - if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value) + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_ArgTypes...)> _FF; + if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value) { __f_ = (__base*)&__buf_; ::new (__f_) _FF(_VSTD::move(__f)); } else { - typedef allocator<_FF> _A; - _A __a; - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_F>(__a)); + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a)); __f_ = __hold.release(); } } } -template<class _R, class ..._ArgTypes> -template <class _F, class _Alloc> -function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, - typename enable_if<__callable<_F>::value>::type*) +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*) : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; if (__not_null(__f)) { - typedef __function::__func<_F, _Alloc, _R(_ArgTypes...)> _FF; - if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value) + typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _FF; + if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value) { __f_ = (__base*)&__buf_; ::new (__f_) _FF(_VSTD::move(__f)); @@ -1302,27 +1302,27 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f #else rebind_alloc<_FF>::other #endif - _A; - _A __a(__a0); - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); + _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); ::new (__hold.get()) _FF(_VSTD::move(__f), _Alloc(__a)); __f_ = __hold.release(); } } } -template<class _R, class ..._ArgTypes> -function<_R(_ArgTypes...)>& -function<_R(_ArgTypes...)>::operator=(const function& __f) +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(const function& __f) { function(__f).swap(*this); return *this; } -template<class _R, class ..._ArgTypes> -function<_R(_ArgTypes...)>& -function<_R(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1343,9 +1343,9 @@ function<_R(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT } } -template<class _R, class ..._ArgTypes> -function<_R(_ArgTypes...)>& -function<_R(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1354,21 +1354,21 @@ function<_R(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT __f_ = 0; } -template<class _R, class ..._ArgTypes> -template <class _F> +template<class _Rp, class ..._ArgTypes> +template <class _Fp> typename enable_if < - function<_R(_ArgTypes...)>::template __callable<typename decay<_F>::type>::value, - function<_R(_ArgTypes...)>& + function<_Rp(_ArgTypes...)>::template __callable<typename decay<_Fp>::type>::value, + function<_Rp(_ArgTypes...)>& >::type -function<_R(_ArgTypes...)>::operator=(_F&& __f) +function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) { - function(_VSTD::forward<_F>(__f)).swap(*this); + function(_VSTD::forward<_Fp>(__f)).swap(*this); return *this; } -template<class _R, class ..._ArgTypes> -function<_R(_ArgTypes...)>::~function() +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>::~function() { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1376,9 +1376,9 @@ function<_R(_ArgTypes...)>::~function() __f_->destroy_deallocate(); } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> void -function<_R(_ArgTypes...)>::swap(function& __f) _NOEXCEPT +function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT { if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) { @@ -1413,9 +1413,9 @@ function<_R(_ArgTypes...)>::swap(function& __f) _NOEXCEPT _VSTD::swap(__f_, __f.__f_); } -template<class _R, class ..._ArgTypes> -_R -function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const +template<class _Rp, class ..._ArgTypes> +_Rp +function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const { #ifndef _LIBCPP_NO_EXCEPTIONS if (__f_ == 0) @@ -1426,61 +1426,61 @@ function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const #ifndef _LIBCPP_NO_RTTI -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> const std::type_info& -function<_R(_ArgTypes...)>::target_type() const _NOEXCEPT +function<_Rp(_ArgTypes...)>::target_type() const _NOEXCEPT { if (__f_ == 0) return typeid(void); return __f_->target_type(); } -template<class _R, class ..._ArgTypes> -template <typename _T> -_T* -function<_R(_ArgTypes...)>::target() _NOEXCEPT +template<class _Rp, class ..._ArgTypes> +template <typename _Tp> +_Tp* +function<_Rp(_ArgTypes...)>::target() _NOEXCEPT { if (__f_ == 0) - return (_T*)0; - return (_T*)__f_->target(typeid(_T)); + return (_Tp*)0; + return (_Tp*)__f_->target(typeid(_Tp)); } -template<class _R, class ..._ArgTypes> -template <typename _T> -const _T* -function<_R(_ArgTypes...)>::target() const _NOEXCEPT +template<class _Rp, class ..._ArgTypes> +template <typename _Tp> +const _Tp* +function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT { if (__f_ == 0) - return (const _T*)0; - return (const _T*)__f_->target(typeid(_T)); + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); } #endif // _LIBCPP_NO_RTTI -template <class _R, class... _ArgTypes> +template <class _Rp, class... _ArgTypes> inline _LIBCPP_INLINE_VISIBILITY bool -operator==(const function<_R(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;} +operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;} -template <class _R, class... _ArgTypes> +template <class _Rp, class... _ArgTypes> inline _LIBCPP_INLINE_VISIBILITY bool -operator==(nullptr_t, const function<_R(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;} +operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;} -template <class _R, class... _ArgTypes> +template <class _Rp, class... _ArgTypes> inline _LIBCPP_INLINE_VISIBILITY bool -operator!=(const function<_R(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;} +operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;} -template <class _R, class... _ArgTypes> +template <class _Rp, class... _ArgTypes> inline _LIBCPP_INLINE_VISIBILITY bool -operator!=(nullptr_t, const function<_R(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;} +operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;} -template <class _R, class... _ArgTypes> +template <class _Rp, class... _ArgTypes> inline _LIBCPP_INLINE_VISIBILITY void -swap(function<_R(_ArgTypes...)>& __x, function<_R(_ArgTypes...)>& __y) _NOEXCEPT +swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT {return __x.swap(__y);} template<class _Tp> struct __is_bind_expression : public false_type {}; @@ -1494,7 +1494,7 @@ template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder namespace placeholders { -template <int _N> struct __ph {}; +template <int _Np> struct __ph {}; extern __ph<1> _1; extern __ph<2> _2; @@ -1509,9 +1509,9 @@ extern __ph<10> _10; } // placeholders -template<int _N> -struct __is_placeholder<placeholders::__ph<_N> > - : public integral_constant<int, _N> {}; +template<int _Np> +struct __is_placeholder<placeholders::__ph<_Np> > + : public integral_constant<int, _Np> {}; template <class _Tp, class _Uj> inline _LIBCPP_INLINE_VISIBILITY @@ -1617,15 +1617,15 @@ struct __mu_return { }; -template <class _F, class _BoundArgs, class _TupleUj> +template <class _Fp, class _BoundArgs, class _TupleUj> struct __bind_return; -template <class _F, class ..._BoundArgs, class _TupleUj> -struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj> +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> { typedef typename __invoke_of < - _F&, + _Fp&, typename __mu_return < _BoundArgs, @@ -1634,12 +1634,12 @@ struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj> >::type type; }; -template <class _F, class ..._BoundArgs, class _TupleUj> -struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj> +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> { typedef typename __invoke_of < - _F&, + _Fp&, typename __mu_return < const _BoundArgs, @@ -1648,20 +1648,20 @@ struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj> >::type type; }; -template <class _F, class _BoundArgs, size_t ..._Indx, class _Args> +template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args> inline _LIBCPP_INLINE_VISIBILITY -typename __bind_return<_F, _BoundArgs, _Args>::type -__apply_functor(_F& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, +typename __bind_return<_Fp, _BoundArgs, _Args>::type +__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, _Args&& __args) { return __invoke(__f, __mu(get<_Indx>(__bound_args), __args)...); } -template<class _F, class ..._BoundArgs> +template<class _Fp, class ..._BoundArgs> class __bind - : public __weak_result_type<typename decay<_F>::type> + : public __weak_result_type<typename decay<_Fp>::type> { - typedef typename decay<_F>::type _Fd; + typedef typename decay<_Fp>::type _Fd; typedef tuple<typename decay<_BoundArgs>::type...> _Td; _Fd __f_; _Td __bound_args_; @@ -1698,10 +1698,10 @@ public: #endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS - template <class _G, class ..._BA> + template <class _Gp, class ..._BA> _LIBCPP_INLINE_VISIBILITY - explicit __bind(_G&& __f, _BA&& ...__bound_args) - : __f_(_VSTD::forward<_G>(__f)), + explicit __bind(_Gp&& __f, _BA&& ...__bound_args) + : __f_(_VSTD::forward<_Gp>(__f)), __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} template <class ..._Args> @@ -1723,16 +1723,16 @@ public: } }; -template<class _F, class ..._BoundArgs> -struct __is_bind_expression<__bind<_F, _BoundArgs...> > : public true_type {}; +template<class _Fp, class ..._BoundArgs> +struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {}; -template<class _R, class _F, class ..._BoundArgs> +template<class _Rp, class _Fp, class ..._BoundArgs> class __bind_r - : public __bind<_F, _BoundArgs...> + : public __bind<_Fp, _BoundArgs...> { - typedef __bind<_F, _BoundArgs...> base; + typedef __bind<_Fp, _BoundArgs...> base; public: - typedef _R result_type; + typedef _Rp result_type; #ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS @@ -1760,10 +1760,10 @@ public: #endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS - template <class _G, class ..._BA> + template <class _Gp, class ..._BA> _LIBCPP_INLINE_VISIBILITY - explicit __bind_r(_G&& __f, _BA&& ...__bound_args) - : base(_VSTD::forward<_G>(__f), + explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args) + : base(_VSTD::forward<_Gp>(__f), _VSTD::forward<_BA>(__bound_args)...) {} template <class ..._Args> @@ -1783,25 +1783,25 @@ public: } }; -template<class _R, class _F, class ..._BoundArgs> -struct __is_bind_expression<__bind_r<_R, _F, _BoundArgs...> > : public true_type {}; +template<class _Rp, class _Fp, class ..._BoundArgs> +struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {}; -template<class _F, class ..._BoundArgs> +template<class _Fp, class ..._BoundArgs> inline _LIBCPP_INLINE_VISIBILITY -__bind<_F, _BoundArgs...> -bind(_F&& __f, _BoundArgs&&... __bound_args) +__bind<_Fp, _BoundArgs...> +bind(_Fp&& __f, _BoundArgs&&... __bound_args) { - typedef __bind<_F, _BoundArgs...> type; - return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); + typedef __bind<_Fp, _BoundArgs...> type; + return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); } -template<class _R, class _F, class ..._BoundArgs> +template<class _Rp, class _Fp, class ..._BoundArgs> inline _LIBCPP_INLINE_VISIBILITY -__bind_r<_R, _F, _BoundArgs...> -bind(_F&& __f, _BoundArgs&&... __bound_args) +__bind_r<_Rp, _Fp, _BoundArgs...> +bind(_Fp&& __f, _BoundArgs&&... __bound_args) { - typedef __bind_r<_R, _F, _BoundArgs...> type; - return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); + typedef __bind_r<_Rp, _Fp, _BoundArgs...> type; + return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); } #endif // _LIBCPP_HAS_NO_VARIADICS diff --git a/libcxx/include/future b/libcxx/include/future index f6896a3a0fc..0e61869f278 100644 --- a/libcxx/include/future +++ b/libcxx/include/future @@ -538,14 +538,14 @@ __assoc_sub_state::wait_for(const chrono::duration<_Rep, _Period>& __rel_time) c return wait_until(chrono::steady_clock::now() + __rel_time); } -template <class _R> +template <class _Rp> class __assoc_state : public __assoc_sub_state { typedef __assoc_sub_state base; - typedef typename aligned_storage<sizeof(_R), alignment_of<_R>::value>::type _U; + typedef typename aligned_storage<sizeof(_Rp), alignment_of<_Rp>::value>::type _Up; protected: - _U __value_; + _Up __value_; virtual void __on_zero_shared() _NOEXCEPT; public: @@ -564,26 +564,26 @@ public: void set_value_at_thread_exit(_Arg& __arg); #endif - _R move(); - typename add_lvalue_reference<_R>::type copy(); + _Rp move(); + typename add_lvalue_reference<_Rp>::type copy(); }; -template <class _R> +template <class _Rp> void -__assoc_state<_R>::__on_zero_shared() _NOEXCEPT +__assoc_state<_Rp>::__on_zero_shared() _NOEXCEPT { if (this->__state_ & base::__constructed) - reinterpret_cast<_R*>(&__value_)->~_R(); + reinterpret_cast<_Rp*>(&__value_)->~_Rp(); delete this; } -template <class _R> +template <class _Rp> template <class _Arg> void #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__assoc_state<_R>::set_value(_Arg&& __arg) +__assoc_state<_Rp>::set_value(_Arg&& __arg) #else -__assoc_state<_R>::set_value(_Arg& __arg) +__assoc_state<_Rp>::set_value(_Arg& __arg) #endif { unique_lock<mutex> __lk(this->__mut_); @@ -591,19 +591,19 @@ __assoc_state<_R>::set_value(_Arg& __arg) if (this->__has_value()) throw future_error(make_error_code(future_errc::promise_already_satisfied)); #endif - ::new(&__value_) _R(_VSTD::forward<_Arg>(__arg)); + ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg)); this->__state_ |= base::__constructed | base::ready; __lk.unlock(); __cv_.notify_all(); } -template <class _R> +template <class _Rp> template <class _Arg> void #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__assoc_state<_R>::set_value_at_thread_exit(_Arg&& __arg) +__assoc_state<_Rp>::set_value_at_thread_exit(_Arg&& __arg) #else -__assoc_state<_R>::set_value_at_thread_exit(_Arg& __arg) +__assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg) #endif { unique_lock<mutex> __lk(this->__mut_); @@ -611,62 +611,62 @@ __assoc_state<_R>::set_value_at_thread_exit(_Arg& __arg) if (this->__has_value()) throw future_error(make_error_code(future_errc::promise_already_satisfied)); #endif - ::new(&__value_) _R(_VSTD::forward<_Arg>(__arg)); + ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg)); this->__state_ |= base::__constructed; __thread_local_data()->__make_ready_at_thread_exit(this); __lk.unlock(); } -template <class _R> -_R -__assoc_state<_R>::move() +template <class _Rp> +_Rp +__assoc_state<_Rp>::move() { unique_lock<mutex> __lk(this->__mut_); this->__sub_wait(__lk); if (this->__exception_ != nullptr) rethrow_exception(this->__exception_); - return _VSTD::move(*reinterpret_cast<_R*>(&__value_)); + return _VSTD::move(*reinterpret_cast<_Rp*>(&__value_)); } -template <class _R> -typename add_lvalue_reference<_R>::type -__assoc_state<_R>::copy() +template <class _Rp> +typename add_lvalue_reference<_Rp>::type +__assoc_state<_Rp>::copy() { unique_lock<mutex> __lk(this->__mut_); this->__sub_wait(__lk); if (this->__exception_ != nullptr) rethrow_exception(this->__exception_); - return *reinterpret_cast<_R*>(&__value_); + return *reinterpret_cast<_Rp*>(&__value_); } -template <class _R> -class __assoc_state<_R&> +template <class _Rp> +class __assoc_state<_Rp&> : public __assoc_sub_state { typedef __assoc_sub_state base; - typedef _R* _U; + typedef _Rp* _Up; protected: - _U __value_; + _Up __value_; virtual void __on_zero_shared() _NOEXCEPT; public: - void set_value(_R& __arg); - void set_value_at_thread_exit(_R& __arg); + void set_value(_Rp& __arg); + void set_value_at_thread_exit(_Rp& __arg); - _R& copy(); + _Rp& copy(); }; -template <class _R> +template <class _Rp> void -__assoc_state<_R&>::__on_zero_shared() _NOEXCEPT +__assoc_state<_Rp&>::__on_zero_shared() _NOEXCEPT { delete this; } -template <class _R> +template <class _Rp> void -__assoc_state<_R&>::set_value(_R& __arg) +__assoc_state<_Rp&>::set_value(_Rp& __arg) { unique_lock<mutex> __lk(this->__mut_); #ifndef _LIBCPP_NO_EXCEPTIONS @@ -679,9 +679,9 @@ __assoc_state<_R&>::set_value(_R& __arg) __cv_.notify_all(); } -template <class _R> +template <class _Rp> void -__assoc_state<_R&>::set_value_at_thread_exit(_R& __arg) +__assoc_state<_Rp&>::set_value_at_thread_exit(_Rp& __arg) { unique_lock<mutex> __lk(this->__mut_); #ifndef _LIBCPP_NO_EXCEPTIONS @@ -694,9 +694,9 @@ __assoc_state<_R&>::set_value_at_thread_exit(_R& __arg) __lk.unlock(); } -template <class _R> -_R& -__assoc_state<_R&>::copy() +template <class _Rp> +_Rp& +__assoc_state<_Rp&>::copy() { unique_lock<mutex> __lk(this->__mut_); this->__sub_wait(__lk); @@ -705,11 +705,11 @@ __assoc_state<_R&>::copy() return *__value_; } -template <class _R, class _Alloc> +template <class _Rp, class _Alloc> class __assoc_state_alloc - : public __assoc_state<_R> + : public __assoc_state<_Rp> { - typedef __assoc_state<_R> base; + typedef __assoc_state<_Rp> base; _Alloc __alloc_; virtual void __on_zero_shared() _NOEXCEPT; @@ -719,22 +719,22 @@ public: : __alloc_(__a) {} }; -template <class _R, class _Alloc> +template <class _Rp, class _Alloc> void -__assoc_state_alloc<_R, _Alloc>::__on_zero_shared() _NOEXCEPT +__assoc_state_alloc<_Rp, _Alloc>::__on_zero_shared() _NOEXCEPT { if (this->__state_ & base::__constructed) - reinterpret_cast<_R*>(&this->__value_)->~_R(); + reinterpret_cast<_Rp*>(&this->__value_)->~_Rp(); typename _Alloc::template rebind<__assoc_state_alloc>::other __a(__alloc_); this->~__assoc_state_alloc(); __a.deallocate(this, 1); } -template <class _R, class _Alloc> -class __assoc_state_alloc<_R&, _Alloc> - : public __assoc_state<_R&> +template <class _Rp, class _Alloc> +class __assoc_state_alloc<_Rp&, _Alloc> + : public __assoc_state<_Rp&> { - typedef __assoc_state<_R&> base; + typedef __assoc_state<_Rp&> base; _Alloc __alloc_; virtual void __on_zero_shared() _NOEXCEPT; @@ -744,9 +744,9 @@ public: : __alloc_(__a) {} }; -template <class _R, class _Alloc> +template <class _Rp, class _Alloc> void -__assoc_state_alloc<_R&, _Alloc>::__on_zero_shared() _NOEXCEPT +__assoc_state_alloc<_Rp&, _Alloc>::__on_zero_shared() _NOEXCEPT { typename _Alloc::template rebind<__assoc_state_alloc>::other __a(__alloc_); this->~__assoc_state_alloc(); @@ -777,17 +777,17 @@ __assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT __a.deallocate(this, 1); } -template <class _R, class _F> +template <class _Rp, class _Fp> class __deferred_assoc_state - : public __assoc_state<_R> + : public __assoc_state<_Rp> { - typedef __assoc_state<_R> base; + typedef __assoc_state<_Rp> base; - _F __func_; + _Fp __func_; public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - explicit __deferred_assoc_state(_F&& __f); + explicit __deferred_assoc_state(_Fp&& __f); #endif virtual void __execute(); @@ -795,19 +795,19 @@ public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R, class _F> +template <class _Rp, class _Fp> inline _LIBCPP_INLINE_VISIBILITY -__deferred_assoc_state<_R, _F>::__deferred_assoc_state(_F&& __f) - : __func_(_VSTD::forward<_F>(__f)) +__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f) + : __func_(_VSTD::forward<_Fp>(__f)) { this->__set_deferred(); } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R, class _F> +template <class _Rp, class _Fp> void -__deferred_assoc_state<_R, _F>::__execute() +__deferred_assoc_state<_Rp, _Fp>::__execute() { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -823,17 +823,17 @@ __deferred_assoc_state<_R, _F>::__execute() #endif // _LIBCPP_NO_EXCEPTIONS } -template <class _F> -class __deferred_assoc_state<void, _F> +template <class _Fp> +class __deferred_assoc_state<void, _Fp> : public __assoc_sub_state { typedef __assoc_sub_state base; - _F __func_; + _Fp __func_; public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - explicit __deferred_assoc_state(_F&& __f); + explicit __deferred_assoc_state(_Fp&& __f); #endif virtual void __execute(); @@ -841,19 +841,19 @@ public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY -__deferred_assoc_state<void, _F>::__deferred_assoc_state(_F&& __f) - : __func_(_VSTD::forward<_F>(__f)) +__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f) + : __func_(_VSTD::forward<_Fp>(__f)) { this->__set_deferred(); } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _F> +template <class _Fp> void -__deferred_assoc_state<void, _F>::__execute() +__deferred_assoc_state<void, _Fp>::__execute() { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -870,18 +870,18 @@ __deferred_assoc_state<void, _F>::__execute() #endif // _LIBCPP_NO_EXCEPTIONS } -template <class _R, class _F> +template <class _Rp, class _Fp> class __async_assoc_state - : public __assoc_state<_R> + : public __assoc_state<_Rp> { - typedef __assoc_state<_R> base; + typedef __assoc_state<_Rp> base; - _F __func_; + _Fp __func_; virtual void __on_zero_shared() _NOEXCEPT; public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - explicit __async_assoc_state(_F&& __f); + explicit __async_assoc_state(_Fp&& __f); #endif virtual void __execute(); @@ -889,18 +889,18 @@ public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R, class _F> +template <class _Rp, class _Fp> inline _LIBCPP_INLINE_VISIBILITY -__async_assoc_state<_R, _F>::__async_assoc_state(_F&& __f) - : __func_(_VSTD::forward<_F>(__f)) +__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f) + : __func_(_VSTD::forward<_Fp>(__f)) { } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R, class _F> +template <class _Rp, class _Fp> void -__async_assoc_state<_R, _F>::__execute() +__async_assoc_state<_Rp, _Fp>::__execute() { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -916,26 +916,26 @@ __async_assoc_state<_R, _F>::__execute() #endif // _LIBCPP_NO_EXCEPTIONS } -template <class _R, class _F> +template <class _Rp, class _Fp> void -__async_assoc_state<_R, _F>::__on_zero_shared() _NOEXCEPT +__async_assoc_state<_Rp, _Fp>::__on_zero_shared() _NOEXCEPT { this->wait(); base::__on_zero_shared(); } -template <class _F> -class __async_assoc_state<void, _F> +template <class _Fp> +class __async_assoc_state<void, _Fp> : public __assoc_sub_state { typedef __assoc_sub_state base; - _F __func_; + _Fp __func_; virtual void __on_zero_shared() _NOEXCEPT; public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - explicit __async_assoc_state(_F&& __f); + explicit __async_assoc_state(_Fp&& __f); #endif virtual void __execute(); @@ -943,18 +943,18 @@ public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _F> +template <class _Fp> inline _LIBCPP_INLINE_VISIBILITY -__async_assoc_state<void, _F>::__async_assoc_state(_F&& __f) - : __func_(_VSTD::forward<_F>(__f)) +__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f) + : __func_(_VSTD::forward<_Fp>(__f)) { } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _F> +template <class _Fp> void -__async_assoc_state<void, _F>::__execute() +__async_assoc_state<void, _Fp>::__execute() { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -971,57 +971,57 @@ __async_assoc_state<void, _F>::__execute() #endif // _LIBCPP_NO_EXCEPTIONS } -template <class _F> +template <class _Fp> void -__async_assoc_state<void, _F>::__on_zero_shared() _NOEXCEPT +__async_assoc_state<void, _Fp>::__on_zero_shared() _NOEXCEPT { this->wait(); base::__on_zero_shared(); } -template <class _R> class promise; -template <class _R> class shared_future; +template <class _Rp> class promise; +template <class _Rp> class shared_future; // future -template <class _R> class future; +template <class _Rp> class future; -template <class _R, class _F> -future<_R> +template <class _Rp, class _Fp> +future<_Rp> #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__make_deferred_assoc_state(_F&& __f); +__make_deferred_assoc_state(_Fp&& __f); #else -__make_deferred_assoc_state(_F __f); +__make_deferred_assoc_state(_Fp __f); #endif -template <class _R, class _F> -future<_R> +template <class _Rp, class _Fp> +future<_Rp> #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__make_async_assoc_state(_F&& __f); +__make_async_assoc_state(_Fp&& __f); #else -__make_async_assoc_state(_F __f); +__make_async_assoc_state(_Fp __f); #endif -template <class _R> +template <class _Rp> class _LIBCPP_VISIBLE future { - __assoc_state<_R>* __state_; + __assoc_state<_Rp>* __state_; - explicit future(__assoc_state<_R>* __state); + explicit future(__assoc_state<_Rp>* __state); template <class> friend class promise; template <class> friend class shared_future; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _R1, class _F> - friend future<_R1> __make_deferred_assoc_state(_F&& __f); - template <class _R1, class _F> - friend future<_R1> __make_async_assoc_state(_F&& __f); + template <class _R1, class _Fp> + friend future<_R1> __make_deferred_assoc_state(_Fp&& __f); + template <class _R1, class _Fp> + friend future<_R1> __make_async_assoc_state(_Fp&& __f); #else - template <class _R1, class _F> - friend future<_R1> __make_deferred_assoc_state(_F __f); - template <class _R1, class _F> - friend future<_R1> __make_async_assoc_state(_F __f); + template <class _R1, class _Fp> + friend future<_R1> __make_deferred_assoc_state(_Fp __f); + template <class _R1, class _Fp> + friend future<_R1> __make_async_assoc_state(_Fp __f); #endif public: @@ -1046,10 +1046,10 @@ private: public: #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~future(); - shared_future<_R> share(); + shared_future<_Rp> share(); // retrieving the value - _R get(); + _Rp get(); _LIBCPP_INLINE_VISIBILITY void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);} @@ -1072,8 +1072,8 @@ public: {return __state_->wait_until(__abs_time);} }; -template <class _R> -future<_R>::future(__assoc_state<_R>* __state) +template <class _Rp> +future<_Rp>::future(__assoc_state<_Rp>* __state) : __state_(__state) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -1089,43 +1089,43 @@ struct __release_shared_count void operator()(__shared_count* p) {p->__release_shared();} }; -template <class _R> -future<_R>::~future() +template <class _Rp> +future<_Rp>::~future() { if (__state_) __state_->__release_shared(); } -template <class _R> -_R -future<_R>::get() +template <class _Rp> +_Rp +future<_Rp>::get() { unique_ptr<__shared_count, __release_shared_count> __(__state_); - __assoc_state<_R>* __s = __state_; + __assoc_state<_Rp>* __s = __state_; __state_ = nullptr; return __s->move(); } -template <class _R> -class _LIBCPP_VISIBLE future<_R&> +template <class _Rp> +class _LIBCPP_VISIBLE future<_Rp&> { - __assoc_state<_R&>* __state_; + __assoc_state<_Rp&>* __state_; - explicit future(__assoc_state<_R&>* __state); + explicit future(__assoc_state<_Rp&>* __state); template <class> friend class promise; template <class> friend class shared_future; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _R1, class _F> - friend future<_R1> __make_deferred_assoc_state(_F&& __f); - template <class _R1, class _F> - friend future<_R1> __make_async_assoc_state(_F&& __f); + template <class _R1, class _Fp> + friend future<_R1> __make_deferred_assoc_state(_Fp&& __f); + template <class _R1, class _Fp> + friend future<_R1> __make_async_assoc_state(_Fp&& __f); #else - template <class _R1, class _F> - friend future<_R1> __make_deferred_assoc_state(_F __f); - template <class _R1, class _F> - friend future<_R1> __make_async_assoc_state(_F __f); + template <class _R1, class _Fp> + friend future<_R1> __make_deferred_assoc_state(_Fp __f); + template <class _R1, class _Fp> + friend future<_R1> __make_async_assoc_state(_Fp __f); #endif public: @@ -1150,10 +1150,10 @@ private: public: #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~future(); - shared_future<_R&> share(); + shared_future<_Rp&> share(); // retrieving the value - _R& get(); + _Rp& get(); _LIBCPP_INLINE_VISIBILITY void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);} @@ -1176,8 +1176,8 @@ public: {return __state_->wait_until(__abs_time);} }; -template <class _R> -future<_R&>::future(__assoc_state<_R&>* __state) +template <class _Rp> +future<_Rp&>::future(__assoc_state<_Rp&>* __state) : __state_(__state) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -1188,19 +1188,19 @@ future<_R&>::future(__assoc_state<_R&>* __state) __state_->__set_future_attached(); } -template <class _R> -future<_R&>::~future() +template <class _Rp> +future<_Rp&>::~future() { if (__state_) __state_->__release_shared(); } -template <class _R> -_R& -future<_R&>::get() +template <class _Rp> +_Rp& +future<_Rp&>::get() { unique_ptr<__shared_count, __release_shared_count> __(__state_); - __assoc_state<_R&>* __s = __state_; + __assoc_state<_Rp&>* __s = __state_; __state_ = nullptr; return __s->copy(); } @@ -1216,15 +1216,15 @@ class _LIBCPP_VISIBLE future<void> template <class> friend class shared_future; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _R1, class _F> - friend future<_R1> __make_deferred_assoc_state(_F&& __f); - template <class _R1, class _F> - friend future<_R1> __make_async_assoc_state(_F&& __f); + template <class _R1, class _Fp> + friend future<_R1> __make_deferred_assoc_state(_Fp&& __f); + template <class _R1, class _Fp> + friend future<_R1> __make_async_assoc_state(_Fp&& __f); #else - template <class _R1, class _F> - friend future<_R1> __make_deferred_assoc_state(_F __f); - template <class _R1, class _F> - friend future<_R1> __make_async_assoc_state(_F __f); + template <class _R1, class _Fp> + friend future<_R1> __make_deferred_assoc_state(_Fp __f); + template <class _R1, class _Fp> + friend future<_R1> __make_async_assoc_state(_Fp __f); #endif public: @@ -1275,10 +1275,10 @@ public: {return __state_->wait_until(__abs_time);} }; -template <class _R> +template <class _Rp> inline _LIBCPP_INLINE_VISIBILITY void -swap(future<_R>& __x, future<_R>& __y) +swap(future<_Rp>& __x, future<_Rp>& __y) { __x.swap(__y); } @@ -1287,10 +1287,10 @@ swap(future<_R>& __x, future<_R>& __y) template <class _Callable> class packaged_task; -template <class _R> +template <class _Rp> class _LIBCPP_VISIBLE promise { - __assoc_state<_R>* __state_; + __assoc_state<_Rp>* __state_; _LIBCPP_INLINE_VISIBILITY explicit promise(nullptr_t) : __state_(nullptr) {} @@ -1330,43 +1330,43 @@ public: void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);} // retrieving the result - future<_R> get_future(); + future<_Rp> get_future(); // setting the result - void set_value(const _R& __r); + void set_value(const _Rp& __r); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - void set_value(_R&& __r); + void set_value(_Rp&& __r); #endif void set_exception(exception_ptr __p); // setting the result with deferred notification - void set_value_at_thread_exit(const _R& __r); + void set_value_at_thread_exit(const _Rp& __r); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - void set_value_at_thread_exit(_R&& __r); + void set_value_at_thread_exit(_Rp&& __r); #endif void set_exception_at_thread_exit(exception_ptr __p); }; -template <class _R> -promise<_R>::promise() - : __state_(new __assoc_state<_R>) +template <class _Rp> +promise<_Rp>::promise() + : __state_(new __assoc_state<_Rp>) { } -template <class _R> +template <class _Rp> template <class _Alloc> -promise<_R>::promise(allocator_arg_t, const _Alloc& __a0) +promise<_Rp>::promise(allocator_arg_t, const _Alloc& __a0) { - typedef typename _Alloc::template rebind<__assoc_state_alloc<_R, _Alloc> >::other _A2; + typedef typename _Alloc::template rebind<__assoc_state_alloc<_Rp, _Alloc> >::other _A2; typedef __allocator_destructor<_A2> _D2; _A2 __a(__a0); - unique_ptr<__assoc_state_alloc<_R, _Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1)); - ::new(__hold.get()) __assoc_state_alloc<_R, _Alloc>(__a0); + unique_ptr<__assoc_state_alloc<_Rp, _Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1)); + ::new(__hold.get()) __assoc_state_alloc<_Rp, _Alloc>(__a0); __state_ = __hold.release(); } -template <class _R> -promise<_R>::~promise() +template <class _Rp> +promise<_Rp>::~promise() { if (__state_) { @@ -1378,20 +1378,20 @@ promise<_R>::~promise() } } -template <class _R> -future<_R> -promise<_R>::get_future() +template <class _Rp> +future<_Rp> +promise<_Rp>::get_future() { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) throw future_error(make_error_code(future_errc::no_state)); #endif - return future<_R>(__state_); + return future<_Rp>(__state_); } -template <class _R> +template <class _Rp> void -promise<_R>::set_value(const _R& __r) +promise<_Rp>::set_value(const _Rp& __r) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1402,9 +1402,9 @@ promise<_R>::set_value(const _R& __r) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R> +template <class _Rp> void -promise<_R>::set_value(_R&& __r) +promise<_Rp>::set_value(_Rp&& __r) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1415,9 +1415,9 @@ promise<_R>::set_value(_R&& __r) #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R> +template <class _Rp> void -promise<_R>::set_exception(exception_ptr __p) +promise<_Rp>::set_exception(exception_ptr __p) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1426,9 +1426,9 @@ promise<_R>::set_exception(exception_ptr __p) __state_->set_exception(__p); } -template <class _R> +template <class _Rp> void -promise<_R>::set_value_at_thread_exit(const _R& __r) +promise<_Rp>::set_value_at_thread_exit(const _Rp& __r) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1439,9 +1439,9 @@ promise<_R>::set_value_at_thread_exit(const _R& __r) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R> +template <class _Rp> void -promise<_R>::set_value_at_thread_exit(_R&& __r) +promise<_Rp>::set_value_at_thread_exit(_Rp&& __r) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1452,9 +1452,9 @@ promise<_R>::set_value_at_thread_exit(_R&& __r) #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -template <class _R> +template <class _Rp> void -promise<_R>::set_exception_at_thread_exit(exception_ptr __p) +promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1465,10 +1465,10 @@ promise<_R>::set_exception_at_thread_exit(exception_ptr __p) // promise<R&> -template <class _R> -class _LIBCPP_VISIBLE promise<_R&> +template <class _Rp> +class _LIBCPP_VISIBLE promise<_Rp&> { - __assoc_state<_R&>* __state_; + __assoc_state<_Rp&>* __state_; _LIBCPP_INLINE_VISIBILITY explicit promise(nullptr_t) : __state_(nullptr) {} @@ -1509,37 +1509,37 @@ public: void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);} // retrieving the result - future<_R&> get_future(); + future<_Rp&> get_future(); // setting the result - void set_value(_R& __r); + void set_value(_Rp& __r); void set_exception(exception_ptr __p); // setting the result with deferred notification - void set_value_at_thread_exit(_R&); + void set_value_at_thread_exit(_Rp&); void set_exception_at_thread_exit(exception_ptr __p); }; -template <class _R> -promise<_R&>::promise() - : __state_(new __assoc_state<_R&>) +template <class _Rp> +promise<_Rp&>::promise() + : __state_(new __assoc_state<_Rp&>) { } -template <class _R> +template <class _Rp> template <class _Alloc> -promise<_R&>::promise(allocator_arg_t, const _Alloc& __a0) +promise<_Rp&>::promise(allocator_arg_t, const _Alloc& __a0) { - typedef typename _Alloc::template rebind<__assoc_state_alloc<_R&, _Alloc> >::other _A2; + typedef typename _Alloc::template rebind<__assoc_state_alloc<_Rp&, _Alloc> >::other _A2; typedef __allocator_destructor<_A2> _D2; _A2 __a(__a0); - unique_ptr<__assoc_state_alloc<_R&, _Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1)); - ::new(__hold.get()) __assoc_state_alloc<_R&, _Alloc>(__a0); + unique_ptr<__assoc_state_alloc<_Rp&, _Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1)); + ::new(__hold.get()) __assoc_state_alloc<_Rp&, _Alloc>(__a0); __state_ = __hold.release(); } -template <class _R> -promise<_R&>::~promise() +template <class _Rp> +promise<_Rp&>::~promise() { if (__state_) { @@ -1551,20 +1551,20 @@ promise<_R&>::~promise() } } -template <class _R> -future<_R&> -promise<_R&>::get_future() +template <class _Rp> +future<_Rp&> +promise<_Rp&>::get_future() { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) throw future_error(make_error_code(future_errc::no_state)); #endif - return future<_R&>(__state_); + return future<_Rp&>(__state_); } -template <class _R> +template <class _Rp> void -promise<_R&>::set_value(_R& __r) +promise<_Rp&>::set_value(_Rp& __r) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1573,9 +1573,9 @@ promise<_R&>::set_value(_R& __r) __state_->set_value(__r); } -template <class _R> +template <class _Rp> void -promise<_R&>::set_exception(exception_ptr __p) +promise<_Rp&>::set_exception(exception_ptr __p) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1584,9 +1584,9 @@ promise<_R&>::set_exception(exception_ptr __p) __state_->set_exception(__p); } -template <class _R> +template <class _Rp> void -promise<_R&>::set_value_at_thread_exit(_R& __r) +promise<_Rp&>::set_value_at_thread_exit(_Rp& __r) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1595,9 +1595,9 @@ promise<_R&>::set_value_at_thread_exit(_R& __r) __state_->set_value_at_thread_exit(__r); } -template <class _R> +template <class _Rp> void -promise<_R&>::set_exception_at_thread_exit(exception_ptr __p) +promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__state_ == nullptr) @@ -1674,16 +1674,16 @@ promise<void>::promise(allocator_arg_t, const _Alloc& __a0) __state_ = __hold.release(); } -template <class _R> +template <class _Rp> inline _LIBCPP_INLINE_VISIBILITY void -swap(promise<_R>& __x, promise<_R>& __y) +swap(promise<_Rp>& __x, promise<_Rp>& __y) { __x.swap(__y); } -template <class _R, class _Alloc> - struct _LIBCPP_VISIBLE uses_allocator<promise<_R>, _Alloc> +template <class _Rp, class _Alloc> + struct _LIBCPP_VISIBLE uses_allocator<promise<_Rp>, _Alloc> : public true_type {}; #ifndef _LIBCPP_HAS_NO_VARIADICS @@ -1692,8 +1692,8 @@ template <class _R, class _Alloc> template<class _Fp> class __packaged_task_base; -template<class _R, class ..._ArgTypes> -class __packaged_task_base<_R(_ArgTypes...)> +template<class _Rp, class ..._ArgTypes> +class __packaged_task_base<_Rp(_ArgTypes...)> { __packaged_task_base(const __packaged_task_base&); __packaged_task_base& operator=(const __packaged_task_base&); @@ -1705,84 +1705,84 @@ public: virtual void __move_to(__packaged_task_base*) = 0; virtual void destroy() = 0; virtual void destroy_deallocate() = 0; - virtual _R operator()(_ArgTypes&& ...) = 0; + virtual _Rp operator()(_ArgTypes&& ...) = 0; }; template<class _FD, class _Alloc, class _FB> class __packaged_task_func; -template<class _F, class _Alloc, class _R, class ..._ArgTypes> -class __packaged_task_func<_F, _Alloc, _R(_ArgTypes...)> - : public __packaged_task_base<_R(_ArgTypes...)> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +class __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)> + : public __packaged_task_base<_Rp(_ArgTypes...)> { - __compressed_pair<_F, _Alloc> __f_; + __compressed_pair<_Fp, _Alloc> __f_; public: _LIBCPP_INLINE_VISIBILITY - explicit __packaged_task_func(const _F& __f) : __f_(__f) {} + explicit __packaged_task_func(const _Fp& __f) : __f_(__f) {} _LIBCPP_INLINE_VISIBILITY - explicit __packaged_task_func(_F&& __f) : __f_(_VSTD::move(__f)) {} + explicit __packaged_task_func(_Fp&& __f) : __f_(_VSTD::move(__f)) {} _LIBCPP_INLINE_VISIBILITY - __packaged_task_func(const _F& __f, const _Alloc& __a) + __packaged_task_func(const _Fp& __f, const _Alloc& __a) : __f_(__f, __a) {} _LIBCPP_INLINE_VISIBILITY - __packaged_task_func(_F&& __f, const _Alloc& __a) + __packaged_task_func(_Fp&& __f, const _Alloc& __a) : __f_(_VSTD::move(__f), __a) {} - virtual void __move_to(__packaged_task_base<_R(_ArgTypes...)>*); + virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*); virtual void destroy(); virtual void destroy_deallocate(); - virtual _R operator()(_ArgTypes&& ... __args); + virtual _Rp operator()(_ArgTypes&& ... __args); }; -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> void -__packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::__move_to( - __packaged_task_base<_R(_ArgTypes...)>* __p) +__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to( + __packaged_task_base<_Rp(_ArgTypes...)>* __p) { ::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second())); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> void -__packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::destroy() +__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() { - __f_.~__compressed_pair<_F, _Alloc>(); + __f_.~__compressed_pair<_Fp, _Alloc>(); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> void -__packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::destroy_deallocate() +__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() { - typedef typename _Alloc::template rebind<__packaged_task_func>::other _A; - _A __a(__f_.second()); - __f_.~__compressed_pair<_F, _Alloc>(); + typedef typename _Alloc::template rebind<__packaged_task_func>::other _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); } -template<class _F, class _Alloc, class _R, class ..._ArgTypes> -_R -__packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +_Rp +__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) { return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...); } template <class _Callable> class __packaged_task_function; -template<class _R, class ..._ArgTypes> -class __packaged_task_function<_R(_ArgTypes...)> +template<class _Rp, class ..._ArgTypes> +class __packaged_task_function<_Rp(_ArgTypes...)> { - typedef __packaged_task_base<_R(_ArgTypes...)> __base; + typedef __packaged_task_base<_Rp(_ArgTypes...)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; public: - typedef _R result_type; + typedef _Rp result_type; // construct/copy/destroy: _LIBCPP_INLINE_VISIBILITY __packaged_task_function() : __f_(nullptr) {} - template<class _F> - __packaged_task_function(_F&& __f); - template<class _F, class _Alloc> - __packaged_task_function(allocator_arg_t, const _Alloc& __a, _F&& __f); + template<class _Fp> + __packaged_task_function(_Fp&& __f); + template<class _Fp, class _Alloc> + __packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f); __packaged_task_function(__packaged_task_function&&); __packaged_task_function& operator=(__packaged_task_function&&); @@ -1794,11 +1794,11 @@ public: void swap(__packaged_task_function&); - _R operator()(_ArgTypes...) const; + _Rp operator()(_ArgTypes...) const; }; -template<class _R, class ..._ArgTypes> -__packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(__packaged_task_function&& __f) +template<class _Rp, class ..._ArgTypes> +__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(__packaged_task_function&& __f) { if (__f.__f_ == nullptr) __f_ = nullptr; @@ -1814,42 +1814,42 @@ __packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(__packaged_ } } -template<class _R, class ..._ArgTypes> -template <class _F> -__packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(_F&& __f) +template<class _Rp, class ..._ArgTypes> +template <class _Fp> +__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f) : __f_(nullptr) { - typedef typename remove_reference<_F>::type _FR; - typedef __packaged_task_func<_FR, allocator<_FR>, _R(_ArgTypes...)> _FF; + typedef typename remove_reference<_Fp>::type _FR; + typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; - ::new (__f_) _FF(_VSTD::forward<_F>(__f)); + ::new (__f_) _FF(_VSTD::forward<_Fp>(__f)); } else { - typedef allocator<_FF> _A; - _A __a; - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(_VSTD::forward<_F>(__f), allocator<_FR>(__a)); + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(_VSTD::forward<_Fp>(__f), allocator<_FR>(__a)); __f_ = __hold.release(); } } -template<class _R, class ..._ArgTypes> -template <class _F, class _Alloc> -__packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function( - allocator_arg_t, const _Alloc& __a0, _F&& __f) +template<class _Rp, class ..._ArgTypes> +template <class _Fp, class _Alloc> +__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function( + allocator_arg_t, const _Alloc& __a0, _Fp&& __f) : __f_(nullptr) { typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename remove_reference<_F>::type _FR; - typedef __packaged_task_func<_FR, _Alloc, _R(_ArgTypes...)> _FF; + typedef typename remove_reference<_Fp>::type _FR; + typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; - ::new (__f_) _FF(_VSTD::forward<_F>(__f)); + ::new (__f_) _FF(_VSTD::forward<_Fp>(__f)); } else { @@ -1859,18 +1859,18 @@ __packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function( #else rebind_alloc<_FF>::other #endif - _A; - _A __a(__a0); - typedef __allocator_destructor<_A> _D; - unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); - ::new (__hold.get()) _FF(_VSTD::forward<_F>(__f), _Alloc(__a)); + _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new (__hold.get()) _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a)); __f_ = __hold.release(); } } -template<class _R, class ..._ArgTypes> -__packaged_task_function<_R(_ArgTypes...)>& -__packaged_task_function<_R(_ArgTypes...)>::operator=(__packaged_task_function&& __f) +template<class _Rp, class ..._ArgTypes> +__packaged_task_function<_Rp(_ArgTypes...)>& +__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f) { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1891,8 +1891,8 @@ __packaged_task_function<_R(_ArgTypes...)>::operator=(__packaged_task_function&& } } -template<class _R, class ..._ArgTypes> -__packaged_task_function<_R(_ArgTypes...)>::~__packaged_task_function() +template<class _Rp, class ..._ArgTypes> +__packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function() { if (__f_ == (__base*)&__buf_) __f_->destroy(); @@ -1900,9 +1900,9 @@ __packaged_task_function<_R(_ArgTypes...)>::~__packaged_task_function() __f_->destroy_deallocate(); } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> void -__packaged_task_function<_R(_ArgTypes...)>::swap(__packaged_task_function& __f) +__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) { if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) { @@ -1937,19 +1937,19 @@ __packaged_task_function<_R(_ArgTypes...)>::swap(__packaged_task_function& __f) _VSTD::swap(__f_, __f.__f_); } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> inline _LIBCPP_INLINE_VISIBILITY -_R -__packaged_task_function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const +_Rp +__packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const { return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...); } -template<class _R, class ..._ArgTypes> -class _LIBCPP_VISIBLE packaged_task<_R(_ArgTypes...)> +template<class _Rp, class ..._ArgTypes> +class _LIBCPP_VISIBLE packaged_task<_Rp(_ArgTypes...)> { public: - typedef _R result_type; + typedef _Rp result_type; private: __packaged_task_function<result_type(_ArgTypes...)> __f_; @@ -1959,13 +1959,13 @@ public: // construction and destruction _LIBCPP_INLINE_VISIBILITY packaged_task() : __p_(nullptr) {} - template <class _F> + template <class _Fp> _LIBCPP_INLINE_VISIBILITY - explicit packaged_task(_F&& __f) : __f_(_VSTD::forward<_F>(__f)) {} - template <class _F, class _Allocator> + explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} + template <class _Fp, class _Allocator> _LIBCPP_INLINE_VISIBILITY - explicit packaged_task(allocator_arg_t, const _Allocator& __a, _F&& __f) - : __f_(allocator_arg, __a, _VSTD::forward<_F>(__f)), + explicit packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) + : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), __p_(allocator_arg, __a) {} // ~packaged_task() = default; @@ -2005,9 +2005,9 @@ public: void reset(); }; -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> void -packaged_task<_R(_ArgTypes...)>::operator()(_ArgTypes... __args) +packaged_task<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __args) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__p_.__state_ == nullptr) @@ -2027,9 +2027,9 @@ packaged_task<_R(_ArgTypes...)>::operator()(_ArgTypes... __args) #endif // _LIBCPP_NO_EXCEPTIONS } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> void -packaged_task<_R(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args) +packaged_task<_Rp(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args) { #ifndef _LIBCPP_NO_EXCEPTIONS if (__p_.__state_ == nullptr) @@ -2049,9 +2049,9 @@ packaged_task<_R(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args) #endif // _LIBCPP_NO_EXCEPTIONS } -template<class _R, class ..._ArgTypes> +template<class _Rp, class ..._ArgTypes> void -packaged_task<_R(_ArgTypes...)>::reset() +packaged_task<_Rp(_ArgTypes...)>::reset() { #ifndef _LIBCPP_NO_EXCEPTIONS if (!valid()) @@ -2074,13 +2074,13 @@ public: // construction and destruction _LIBCPP_INLINE_VISIBILITY packaged_task() : __p_(nullptr) {} - template <class _F> + template <class _Fp> _LIBCPP_INLINE_VISIBILITY - explicit packaged_task(_F&& __f) : __f_(_VSTD::forward<_F>(__f)) {} - template <class _F, class _Allocator> + explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} + template <class _Fp, class _Allocator> _LIBCPP_INLINE_VISIBILITY - explicit packaged_task(allocator_arg_t, const _Allocator& __a, _F&& __f) - : __f_(allocator_arg, __a, _VSTD::forward<_F>(__f)), + explicit packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) + : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), __p_(allocator_arg, __a) {} // ~packaged_task() = default; @@ -2189,84 +2189,84 @@ template <class _Callable, class _Alloc> struct _LIBCPP_VISIBLE uses_allocator<packaged_task<_Callable>, _Alloc> : public true_type {}; -template <class _R, class _F> -future<_R> +template <class _Rp, class _Fp> +future<_Rp> #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__make_deferred_assoc_state(_F&& __f) +__make_deferred_assoc_state(_Fp&& __f) #else -__make_deferred_assoc_state(_F __f) +__make_deferred_assoc_state(_Fp __f) #endif { - unique_ptr<__deferred_assoc_state<_R, _F>, __release_shared_count> - __h(new __deferred_assoc_state<_R, _F>(_VSTD::forward<_F>(__f))); - return future<_R>(__h.get()); + unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count> + __h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f))); + return future<_Rp>(__h.get()); } -template <class _R, class _F> -future<_R> +template <class _Rp, class _Fp> +future<_Rp> #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__make_async_assoc_state(_F&& __f) +__make_async_assoc_state(_Fp&& __f) #else -__make_async_assoc_state(_F __f) +__make_async_assoc_state(_Fp __f) #endif { - unique_ptr<__async_assoc_state<_R, _F>, __release_shared_count> - __h(new __async_assoc_state<_R, _F>(_VSTD::forward<_F>(__f))); - _VSTD::thread(&__async_assoc_state<_R, _F>::__execute, __h.get()).detach(); - return future<_R>(__h.get()); + unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count> + __h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f))); + _VSTD::thread(&__async_assoc_state<_Rp, _Fp>::__execute, __h.get()).detach(); + return future<_Rp>(__h.get()); } -template <class _F, class... _Args> +template <class _Fp, class... _Args> class __async_func { - tuple<_F, _Args...> __f_; + tuple<_Fp, _Args...> __f_; public: - typedef typename __invoke_of<_F, _Args...>::type _R; + typedef typename __invoke_of<_Fp, _Args...>::type _Rp; _LIBCPP_INLINE_VISIBILITY - explicit __async_func(_F&& __f, _Args&&... __args) + explicit __async_func(_Fp&& __f, _Args&&... __args) : __f_(_VSTD::move(__f), _VSTD::move(__args)...) {} _LIBCPP_INLINE_VISIBILITY __async_func(__async_func&& __f) : __f_(_VSTD::move(__f.__f_)) {} - _R operator()() + _Rp operator()() { typedef typename __make_tuple_indices<1+sizeof...(_Args), 1>::type _Index; return __execute(_Index()); } private: template <size_t ..._Indices> - _R + _Rp __execute(__tuple_indices<_Indices...>) { return __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...); } }; -template <class _F, class... _Args> -future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type> -async(launch __policy, _F&& __f, _Args&&... __args) +template <class _Fp, class... _Args> +future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type> +async(launch __policy, _Fp&& __f, _Args&&... __args) { - typedef __async_func<typename decay<_F>::type, typename decay<_Args>::type...> _BF; - typedef typename _BF::_R _R; - future<_R> __r; + typedef __async_func<typename decay<_Fp>::type, typename decay<_Args>::type...> _BF; + typedef typename _BF::_Rp _Rp; + future<_Rp> __r; if (__policy & launch::async) - __r = _VSTD::__make_async_assoc_state<_R>(_BF(__decay_copy(_VSTD::forward<_F>(__f)), + __r = _VSTD::__make_async_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)), __decay_copy(_VSTD::forward<_Args>(__args))...)); else if (__policy & launch::deferred) - __r = _VSTD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_VSTD::forward<_F>(__f)), + __r = _VSTD::__make_deferred_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)), __decay_copy(_VSTD::forward<_Args>(__args))...)); return __r; } -template <class _F, class... _Args> +template <class _Fp, class... _Args> inline _LIBCPP_INLINE_VISIBILITY -future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type> -async(_F&& __f, _Args&&... __args) +future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type> +async(_Fp&& __f, _Args&&... __args) { - return _VSTD::async(launch::any, _VSTD::forward<_F>(__f), + return _VSTD::async(launch::any, _VSTD::forward<_Fp>(__f), _VSTD::forward<_Args>(__args)...); } @@ -2274,10 +2274,10 @@ async(_F&& __f, _Args&&... __args) // shared_future -template <class _R> +template <class _Rp> class _LIBCPP_VISIBLE shared_future { - __assoc_state<_R>* __state_; + __assoc_state<_Rp>* __state_; public: _LIBCPP_INLINE_VISIBILITY @@ -2287,7 +2287,7 @@ public: {if (__state_) __state_->__add_shared();} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - shared_future(future<_R>&& __f) : __state_(__f.__state_) + shared_future(future<_Rp>&& __f) : __state_(__f.__state_) {__f.__state_ = nullptr;} _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) : __state_(__rhs.__state_) @@ -2306,7 +2306,7 @@ public: // retrieving the value _LIBCPP_INLINE_VISIBILITY - const _R& get() const {return __state_->copy();} + const _Rp& get() const {return __state_->copy();} _LIBCPP_INLINE_VISIBILITY void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);} @@ -2329,16 +2329,16 @@ public: {return __state_->wait_until(__abs_time);} }; -template <class _R> -shared_future<_R>::~shared_future() +template <class _Rp> +shared_future<_Rp>::~shared_future() { if (__state_) __state_->__release_shared(); } -template <class _R> -shared_future<_R>& -shared_future<_R>::operator=(const shared_future& __rhs) +template <class _Rp> +shared_future<_Rp>& +shared_future<_Rp>::operator=(const shared_future& __rhs) { if (__rhs.__state_) __rhs.__state_->__add_shared(); @@ -2348,10 +2348,10 @@ shared_future<_R>::operator=(const shared_future& __rhs) return *this; } -template <class _R> -class _LIBCPP_VISIBLE shared_future<_R&> +template <class _Rp> +class _LIBCPP_VISIBLE shared_future<_Rp&> { - __assoc_state<_R&>* __state_; + __assoc_state<_Rp&>* __state_; public: _LIBCPP_INLINE_VISIBILITY @@ -2361,7 +2361,7 @@ public: {if (__state_) __state_->__add_shared();} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - shared_future(future<_R&>&& __f) : __state_(__f.__state_) + shared_future(future<_Rp&>&& __f) : __state_(__f.__state_) {__f.__state_ = nullptr;} _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) : __state_(__rhs.__state_) @@ -2380,7 +2380,7 @@ public: // retrieving the value _LIBCPP_INLINE_VISIBILITY - _R& get() const {return __state_->copy();} + _Rp& get() const {return __state_->copy();} _LIBCPP_INLINE_VISIBILITY void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);} @@ -2403,16 +2403,16 @@ public: {return __state_->wait_until(__abs_time);} }; -template <class _R> -shared_future<_R&>::~shared_future() +template <class _Rp> +shared_future<_Rp&>::~shared_future() { if (__state_) __state_->__release_shared(); } -template <class _R> -shared_future<_R&>& -shared_future<_R&>::operator=(const shared_future& __rhs) +template <class _Rp> +shared_future<_Rp&>& +shared_future<_Rp&>::operator=(const shared_future& __rhs) { if (__rhs.__state_) __rhs.__state_->__add_shared(); @@ -2477,28 +2477,28 @@ public: {return __state_->wait_until(__abs_time);} }; -template <class _R> +template <class _Rp> inline _LIBCPP_INLINE_VISIBILITY void -swap(shared_future<_R>& __x, shared_future<_R>& __y) +swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y) { __x.swap(__y); } -template <class _R> +template <class _Rp> inline _LIBCPP_INLINE_VISIBILITY -shared_future<_R> -future<_R>::share() +shared_future<_Rp> +future<_Rp>::share() { - return shared_future<_R>(_VSTD::move(*this)); + return shared_future<_Rp>(_VSTD::move(*this)); } -template <class _R> +template <class _Rp> inline _LIBCPP_INLINE_VISIBILITY -shared_future<_R&> -future<_R&>::share() +shared_future<_Rp&> +future<_Rp&>::share() { - return shared_future<_R&>(_VSTD::move(*this)); + return shared_future<_Rp&>(_VSTD::move(*this)); } #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list index 3263906d637..2f88514b7f7 100644 --- a/libcxx/include/initializer_list +++ b/libcxx/include/initializer_list @@ -55,45 +55,45 @@ namespace std // purposefully not versioned #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -template<class _E> +template<class _Ep> class _LIBCPP_VISIBLE initializer_list { - const _E* __begin_; + const _Ep* __begin_; size_t __size_; _LIBCPP_ALWAYS_INLINE - initializer_list(const _E* __b, size_t __s) _NOEXCEPT + initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT : __begin_(__b), __size_(__s) {} public: - typedef _E value_type; - typedef const _E& reference; - typedef const _E& const_reference; + typedef _Ep value_type; + typedef const _Ep& reference; + typedef const _Ep& const_reference; typedef size_t size_type; - typedef const _E* iterator; - typedef const _E* const_iterator; + typedef const _Ep* iterator; + typedef const _Ep* const_iterator; _LIBCPP_ALWAYS_INLINE initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} _LIBCPP_ALWAYS_INLINE size_t size() const _NOEXCEPT {return __size_;} - _LIBCPP_ALWAYS_INLINE const _E* begin() const _NOEXCEPT {return __begin_;} - _LIBCPP_ALWAYS_INLINE const _E* end() const _NOEXCEPT {return __begin_ + __size_;} + _LIBCPP_ALWAYS_INLINE const _Ep* begin() const _NOEXCEPT {return __begin_;} + _LIBCPP_ALWAYS_INLINE const _Ep* end() const _NOEXCEPT {return __begin_ + __size_;} }; -template<class _E> +template<class _Ep> inline _LIBCPP_INLINE_VISIBILITY -const _E* -begin(initializer_list<_E> __il) _NOEXCEPT +const _Ep* +begin(initializer_list<_Ep> __il) _NOEXCEPT { return __il.begin(); } -template<class _E> +template<class _Ep> inline _LIBCPP_INLINE_VISIBILITY -const _E* -end(initializer_list<_E> __il) _NOEXCEPT +const _Ep* +end(initializer_list<_Ep> __il) _NOEXCEPT { return __il.end(); } diff --git a/libcxx/include/iomanip b/libcxx/include/iomanip index 15704046227..0c58e1980f3 100644 --- a/libcxx/include/iomanip +++ b/libcxx/include/iomanip @@ -277,10 +277,10 @@ public: __iom_t7(_MoneyT& __mon, bool __intl) : __mon_(__mon), __intl_(__intl) {} - template <class _CharT, class _Traits, class _M> + template <class _CharT, class _Traits, class _Mp> friend basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_M>& __x); + operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_Mp>& __x); }; template <class _CharT, class _Traits, class _MoneyT> @@ -294,11 +294,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x) typename basic_istream<_CharT, _Traits>::sentry __s(__is); if (__s) { - typedef istreambuf_iterator<_CharT, _Traits> _I; - typedef money_get<_CharT, _I> _F; + typedef istreambuf_iterator<_CharT, _Traits> _Ip; + typedef money_get<_CharT, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - const _F& __mf = use_facet<_F>(__is.getloc()); - __mf.get(_I(__is), _I(), __x.__intl_, __is, __err, __x.__mon_); + const _Fp& __mf = use_facet<_Fp>(__is.getloc()); + __mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_); __is.setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -337,10 +337,10 @@ public: __iom_t8(const _MoneyT& __mon, bool __intl) : __mon_(__mon), __intl_(__intl) {} - template <class _CharT, class _Traits, class _M> + template <class _CharT, class _Traits, class _Mp> friend basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_M>& __x); + operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_Mp>& __x); }; template <class _CharT, class _Traits, class _MoneyT> @@ -354,10 +354,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x) typename basic_ostream<_CharT, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _O; - typedef money_put<_CharT, _O> _F; - const _F& __mf = use_facet<_F>(__os.getloc()); - if (__mf.put(_O(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed()) + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + typedef money_put<_CharT, _Op> _Fp; + const _Fp& __mf = use_facet<_Fp>(__os.getloc()); + if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed()) __os.setstate(ios_base::badbit); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -396,10 +396,10 @@ public: __iom_t9(tm* __tm, const _CharT* __fmt) : __tm_(__tm), __fmt_(__fmt) {} - template <class _C, class _Traits> + template <class _Cp, class _Traits> friend - basic_istream<_C, _Traits>& - operator>>(basic_istream<_C, _Traits>& __is, const __iom_t9<_C>& __x); + basic_istream<_Cp, _Traits>& + operator>>(basic_istream<_Cp, _Traits>& __is, const __iom_t9<_Cp>& __x); }; template <class _CharT, class _Traits> @@ -413,11 +413,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x) typename basic_istream<_CharT, _Traits>::sentry __s(__is); if (__s) { - typedef istreambuf_iterator<_CharT, _Traits> _I; - typedef time_get<_CharT, _I> _F; + typedef istreambuf_iterator<_CharT, _Traits> _Ip; + typedef time_get<_CharT, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - const _F& __tf = use_facet<_F>(__is.getloc()); - __tf.get(_I(__is), _I(), __is, __err, __x.__tm_, + const _Fp& __tf = use_facet<_Fp>(__is.getloc()); + __tf.get(_Ip(__is), _Ip(), __is, __err, __x.__tm_, __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)); __is.setstate(__err); } @@ -457,10 +457,10 @@ public: __iom_t10(const tm* __tm, const _CharT* __fmt) : __tm_(__tm), __fmt_(__fmt) {} - template <class _C, class _Traits> + template <class _Cp, class _Traits> friend - basic_ostream<_C, _Traits>& - operator<<(basic_ostream<_C, _Traits>& __os, const __iom_t10<_C>& __x); + basic_ostream<_Cp, _Traits>& + operator<<(basic_ostream<_Cp, _Traits>& __os, const __iom_t10<_Cp>& __x); }; template <class _CharT, class _Traits> @@ -474,10 +474,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x) typename basic_ostream<_CharT, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _O; - typedef time_put<_CharT, _O> _F; - const _F& __tf = use_facet<_F>(__os.getloc()); - if (__tf.put(_O(__os), __os, __os.fill(), __x.__tm_, + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + typedef time_put<_CharT, _Op> _Fp; + const _Fp& __tf = use_facet<_Fp>(__os.getloc()); + if (__tf.put(_Op(__os), __os, __os.fill(), __x.__tm_, __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed()) __os.setstate(ios_base::badbit); } diff --git a/libcxx/include/istream b/libcxx/include/istream index f271393136f..7b37e343080 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -271,10 +271,10 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _ __is.tie()->flush(); if (!__noskipws && (__is.flags() & ios_base::skipws)) { - typedef istreambuf_iterator<_CharT, _Traits> _I; + typedef istreambuf_iterator<_CharT, _Traits> _Ip; const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc()); - _I __i(__is); - _I __eof; + _Ip __i(__is); + _Ip __eof; for (; __i != __eof; ++__i) if (!__ct.is(__ct.space, *__i)) break; @@ -342,10 +342,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -369,10 +369,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -396,10 +396,10 @@ basic_istream<_CharT, _Traits>::operator>>(long& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -423,10 +423,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -450,10 +450,10 @@ basic_istream<_CharT, _Traits>::operator>>(long long& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -477,10 +477,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -504,10 +504,10 @@ basic_istream<_CharT, _Traits>::operator>>(float& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -531,10 +531,10 @@ basic_istream<_CharT, _Traits>::operator>>(double& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -558,10 +558,10 @@ basic_istream<_CharT, _Traits>::operator>>(long double& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -585,10 +585,10 @@ basic_istream<_CharT, _Traits>::operator>>(bool& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -612,10 +612,10 @@ basic_istream<_CharT, _Traits>::operator>>(void*& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __n); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); this->setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS @@ -639,11 +639,11 @@ basic_istream<_CharT, _Traits>::operator>>(short& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; long __temp; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __temp); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp); if (__temp < numeric_limits<short>::min()) { __err |= ios_base::failbit; @@ -679,11 +679,11 @@ basic_istream<_CharT, _Traits>::operator>>(int& __n) sentry __s(*this); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _I; - typedef num_get<char_type, _I> _F; + typedef istreambuf_iterator<char_type, traits_type> _Ip; + typedef num_get<char_type, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; long __temp; - use_facet<_F>(this->getloc()).get(_I(*this), _I(), *this, __err, __temp); + use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp); if (__temp < numeric_limits<int>::min()) { __err |= ios_base::failbit; diff --git a/libcxx/include/iterator b/libcxx/include/iterator index 13c2c341e23..e17137f6419 100644 --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -1039,9 +1039,9 @@ template <class _Iter> __wrap_iter<_Iter> operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT; -template <class _I, class _O> _O copy(_I, _I, _O); +template <class _Ip, class _Op> _Op copy(_Ip, _Ip, _Op); template <class _B1, class _B2> _B2 copy_backward(_B1, _B1, _B2); -template <class _I, class _O> _O move(_I, _I, _O); +template <class _Ip, class _Op> _Op move(_Ip, _Ip, _Op); template <class _B1, class _B2> _B2 move_backward(_B1, _B1, _B2); template <class _Tp> @@ -1212,9 +1212,9 @@ private: __wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT; - template <class _I, class _O> friend _O copy(_I, _I, _O); + template <class _Ip, class _Op> friend _Op copy(_Ip, _Ip, _Op); template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2); - template <class _I, class _O> friend _O move(_I, _I, _O); + template <class _Ip, class _Op> friend _Op move(_Ip, _Ip, _Op); template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2); template <class _Tp> @@ -1715,88 +1715,88 @@ operator+(typename __debug_iter<_Container, _Iter>::difference_type __n, #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN) -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY auto -begin(_C& __c) -> decltype(__c.begin()) +begin(_Cp& __c) -> decltype(__c.begin()) { return __c.begin(); } -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY auto -begin(const _C& __c) -> decltype(__c.begin()) +begin(const _Cp& __c) -> decltype(__c.begin()) { return __c.begin(); } -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY auto -end(_C& __c) -> decltype(__c.end()) +end(_Cp& __c) -> decltype(__c.end()) { return __c.end(); } -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY auto -end(const _C& __c) -> decltype(__c.end()) +end(const _Cp& __c) -> decltype(__c.end()) { return __c.end(); } #else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN) -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY -typename _C::iterator -begin(_C& __c) +typename _Cp::iterator +begin(_Cp& __c) { return __c.begin(); } -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY -typename _C::const_iterator -begin(const _C& __c) +typename _Cp::const_iterator +begin(const _Cp& __c) { return __c.begin(); } -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY -typename _C::iterator -end(_C& __c) +typename _Cp::iterator +end(_Cp& __c) { return __c.end(); } -template <class _C> +template <class _Cp> inline _LIBCPP_INLINE_VISIBILITY -typename _C::const_iterator -end(const _C& __c) +typename _Cp::const_iterator +end(const _Cp& __c) { return __c.end(); } #endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN) -template <class _T, size_t _N> +template <class _Tp, size_t _Np> inline _LIBCPP_INLINE_VISIBILITY -_T* -begin(_T (&__array)[_N]) +_Tp* +begin(_Tp (&__array)[_Np]) { return __array; } -template <class _T, size_t _N> +template <class _Tp, size_t _Np> inline _LIBCPP_INLINE_VISIBILITY -_T* -end(_T (&__array)[_N]) +_Tp* +end(_Tp (&__array)[_Np]) { - return __array + _N; + return __array + _Np; } _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/list b/libcxx/include/list index add519f260e..b486e831341 100644 --- a/libcxx/include/list +++ b/libcxx/include/list @@ -1195,8 +1195,8 @@ list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a) splice(end(), __c); else { - typedef move_iterator<iterator> _I; - assign(_I(__c.begin()), _I(__c.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); } } @@ -1219,8 +1219,8 @@ list<_Tp, _Alloc>::__move_assign(list& __c, false_type) { if (base::__node_alloc() != __c.__node_alloc()) { - typedef move_iterator<iterator> _I; - assign(_I(__c.begin()), _I(__c.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); } else __move_assign(__c, true_type()); @@ -1286,8 +1286,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x) " referring to this list"); #endif __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold); @@ -1311,8 +1311,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _ { size_type __ds = 0; __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); ++__ds; @@ -1379,8 +1379,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l, { size_type __ds = 0; __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); ++__ds; @@ -1434,8 +1434,8 @@ void list<_Tp, _Alloc>::push_front(const value_type& __x) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __link_nodes(*base::__end_.__next_, *__hold, *__hold); ++base::__sz(); @@ -1447,8 +1447,8 @@ void list<_Tp, _Alloc>::push_back(const value_type& __x) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold); ++base::__sz(); @@ -1462,8 +1462,8 @@ void list<_Tp, _Alloc>::push_front(value_type&& __x) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); __link_nodes(*base::__end_.__next_, *__hold, *__hold); ++base::__sz(); @@ -1475,8 +1475,8 @@ void list<_Tp, _Alloc>::push_back(value_type&& __x) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold); ++base::__sz(); @@ -1491,8 +1491,8 @@ void list<_Tp, _Alloc>::emplace_front(_Args&&... __args) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); __link_nodes(*base::__end_.__next_, *__hold, *__hold); ++base::__sz(); @@ -1505,8 +1505,8 @@ void list<_Tp, _Alloc>::emplace_back(_Args&&... __args) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold); ++base::__sz(); @@ -1519,8 +1519,8 @@ typename list<_Tp, _Alloc>::iterator list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args) { __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold); @@ -1544,8 +1544,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x) " referring to this list"); #endif __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold); @@ -1708,8 +1708,8 @@ list<_Tp, _Alloc>::resize(size_type __n) __n -= base::__sz(); size_type __ds = 0; __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_)); ++__ds; @@ -1767,8 +1767,8 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x) __n -= base::__sz(); size_type __ds = 0; __node_allocator& __na = base::__node_alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); ++__ds; diff --git a/libcxx/include/map b/libcxx/include/map index 8bb75550dba..abdaa3b6b5c 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -385,7 +385,7 @@ template <class _Key, class _Tp, class _Compare, bool = is_empty<_Compare>::valu class __map_value_compare : private _Compare { - typedef pair<typename std::remove_const<_Key>::type, _Tp> _P; + typedef pair<typename std::remove_const<_Key>::type, _Tp> _Pp; typedef pair<const _Key, _Tp> _CP; public: _LIBCPP_INLINE_VISIBILITY @@ -402,25 +402,25 @@ public: bool operator()(const _CP& __x, const _CP& __y) const {return static_cast<const _Compare&>(*this)(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _CP& __x, const _P& __y) const + bool operator()(const _CP& __x, const _Pp& __y) const {return static_cast<const _Compare&>(*this)(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _Key& __y) const {return static_cast<const _Compare&>(*this)(__x.first, __y);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _P& __x, const _CP& __y) const + bool operator()(const _Pp& __x, const _CP& __y) const {return static_cast<const _Compare&>(*this)(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _P& __x, const _P& __y) const + bool operator()(const _Pp& __x, const _Pp& __y) const {return static_cast<const _Compare&>(*this)(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _P& __x, const _Key& __y) const + bool operator()(const _Pp& __x, const _Key& __y) const {return static_cast<const _Compare&>(*this)(__x.first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _CP& __y) const {return static_cast<const _Compare&>(*this)(__x, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Key& __x, const _P& __y) const + bool operator()(const _Key& __x, const _Pp& __y) const {return static_cast<const _Compare&>(*this)(__x, __y.first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _Key& __y) const @@ -432,7 +432,7 @@ class __map_value_compare<_Key, _Tp, _Compare, false> { _Compare comp; - typedef pair<typename std::remove_const<_Key>::type, _Tp> _P; + typedef pair<typename std::remove_const<_Key>::type, _Tp> _Pp; typedef pair<const _Key, _Tp> _CP; public: @@ -451,25 +451,25 @@ public: bool operator()(const _CP& __x, const _CP& __y) const {return comp(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _CP& __x, const _P& __y) const + bool operator()(const _CP& __x, const _Pp& __y) const {return comp(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _Key& __y) const {return comp(__x.first, __y);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _P& __x, const _CP& __y) const + bool operator()(const _Pp& __x, const _CP& __y) const {return comp(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _P& __x, const _P& __y) const + bool operator()(const _Pp& __x, const _Pp& __y) const {return comp(__x.first, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _P& __x, const _Key& __y) const + bool operator()(const _Pp& __x, const _Key& __y) const {return comp(__x.first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _CP& __y) const {return comp(__x, __y.first);} _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Key& __x, const _P& __y) const + bool operator()(const _Key& __x, const _Pp& __y) const {return comp(__x, __y.first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _Key& __y) const @@ -918,17 +918,17 @@ public: #endif // _LIBCPP_HAS_NO_VARIADICS - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - pair<iterator, bool> insert(_P&& __p) - {return __tree_.__insert_unique(_VSTD::forward<_P>(__p));} + pair<iterator, bool> insert(_Pp&& __p) + {return __tree_.__insert_unique(_VSTD::forward<_Pp>(__p));} - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __pos, _P&& __p) - {return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_P>(__p));} + iterator insert(const_iterator __pos, _Pp&& __p) + {return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_Pp>(__p));} #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -1006,8 +1006,8 @@ private: typedef typename __base::__node_const_pointer __node_const_pointer; typedef typename __base::__node_base_pointer __node_base_pointer; typedef typename __base::__node_base_const_pointer __node_base_const_pointer; - typedef __map_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __map_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __node_holder __construct_node(); @@ -1202,7 +1202,7 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder map<_Key, _Tp, _Compare, _Allocator>::__construct_node() { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first)); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); @@ -1217,7 +1217,7 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0) { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; __h.get_deleter().__second_constructed = true; @@ -1233,7 +1233,7 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args) { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...); @@ -1250,7 +1250,7 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder map<_Key, _Tp, _Compare, _Allocator>::__construct_node(const key_type& __k) { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); @@ -1665,17 +1665,17 @@ public: #endif // _LIBCPP_HAS_NO_VARIADICS - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - iterator insert(_P&& __p) - {return __tree_.__insert_multi(_VSTD::forward<_P>(__p));} + iterator insert(_Pp&& __p) + {return __tree_.__insert_multi(_VSTD::forward<_Pp>(__p));} - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __pos, _P&& __p) - {return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_P>(__p));} + iterator insert(const_iterator __pos, _Pp&& __p) + {return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_Pp>(__p));} #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -1748,8 +1748,8 @@ private: typedef typename __base::__node_allocator __node_allocator; typedef typename __base::__node_pointer __node_pointer; typedef typename __base::__node_const_pointer __node_const_pointer; - typedef __map_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __map_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __node_holder __construct_node(); @@ -1784,7 +1784,7 @@ typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node() { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first)); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); @@ -1800,7 +1800,7 @@ typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0) { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; __h.get_deleter().__second_constructed = true; @@ -1817,7 +1817,7 @@ typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args) { __node_allocator& __na = __tree_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...); diff --git a/libcxx/include/memory b/libcxx/include/memory index 7576aaebc46..7177549b868 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -1064,10 +1064,10 @@ struct __const_void_pointer<_Ptr, _Alloc, false> #endif }; -template <class _T> +template <class _Tp> inline _LIBCPP_INLINE_VISIBILITY -_T* -__to_raw_pointer(_T* __p) _NOEXCEPT +_Tp* +__to_raw_pointer(_Tp* __p) _NOEXCEPT { return __p; } @@ -2517,20 +2517,20 @@ public: "unique_ptr constructed with null function pointer deleter"); } #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P, - class = typename enable_if<is_same<_P, pointer>::value>::type + template <class _Pp, + class = typename enable_if<is_same<_Pp, pointer>::value>::type > - _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_P __p) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p) _NOEXCEPT : __ptr_(__p) { static_assert(!is_pointer<deleter_type>::value, "unique_ptr constructed with null function pointer deleter"); } - template <class _P, - class = typename enable_if<is_same<_P, pointer>::value>::type + template <class _Pp, + class = typename enable_if<is_same<_Pp, pointer>::value>::type > - _LIBCPP_INLINE_VISIBILITY unique_ptr(_P __p, typename conditional< + _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p, typename conditional< is_reference<deleter_type>::value, deleter_type, typename add_lvalue_reference<const deleter_type>::type>::type __d) @@ -2544,11 +2544,11 @@ public: _NOEXCEPT : __ptr_(pointer(), __d) {} - template <class _P, - class = typename enable_if<is_same<_P, pointer>::value || - is_same<_P, nullptr_t>::value>::type + template <class _Pp, + class = typename enable_if<is_same<_Pp, pointer>::value || + is_same<_Pp, nullptr_t>::value>::type > - _LIBCPP_INLINE_VISIBILITY unique_ptr(_P __p, typename remove_reference<deleter_type>::type&& __d) + _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p, typename remove_reference<deleter_type>::type&& __d) _NOEXCEPT : __ptr_(__p, _VSTD::move(__d)) { @@ -2628,10 +2628,10 @@ public: } #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P, - class = typename enable_if<is_same<_P, pointer>::value>::type + template <class _Pp, + class = typename enable_if<is_same<_Pp, pointer>::value>::type > - _LIBCPP_INLINE_VISIBILITY void reset(_P __p) _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY void reset(_Pp __p) _NOEXCEPT { pointer __tmp = __ptr_.first(); __ptr_.first() = __p; @@ -3116,13 +3116,13 @@ public: bool unique() const _NOEXCEPT {return use_count() == 1;} _LIBCPP_INLINE_VISIBILITY /*explicit*/ operator bool() const _NOEXCEPT {return get() != 0;} - template <class _U> + template <class _Up> _LIBCPP_INLINE_VISIBILITY - bool owner_before(shared_ptr<_U> const& __p) const + bool owner_before(shared_ptr<_Up> const& __p) const {return __cntrl_ < __p.__cntrl_;} - template <class _U> + template <class _Up> _LIBCPP_INLINE_VISIBILITY - bool owner_before(weak_ptr<_U> const& __p) const + bool owner_before(weak_ptr<_Up> const& __p) const {return __cntrl_ < __p.__cntrl_;} #ifndef _LIBCPP_NO_RTTI @@ -4151,10 +4151,10 @@ struct _LIBCPP_VISIBLE hash<shared_ptr<_Tp> > } }; -template<class _CharT, class _Traits, class _Y> +template<class _CharT, class _Traits, class _Yp> inline _LIBCPP_INLINE_VISIBILITY basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Y> const& __p); +operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p); //enum class struct _LIBCPP_VISIBLE pointer_safety diff --git a/libcxx/include/mutex b/libcxx/include/mutex index d1d0a6e0587..8bc6b800141 100644 --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -464,23 +464,23 @@ private: #ifndef _LIBCPP_HAS_NO_VARIADICS -template <class _F> +template <class _Fp> class __call_once_param { - _F __f_; + _Fp __f_; public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {} + explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {} #else _LIBCPP_INLINE_VISIBILITY - explicit __call_once_param(const _F& __f) : __f_(__f) {} + explicit __call_once_param(const _Fp& __f) : __f_(__f) {} #endif _LIBCPP_INLINE_VISIBILITY void operator()() { - typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index; + typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index; __execute(_Index()); } @@ -495,17 +495,17 @@ private: #else -template <class _F> +template <class _Fp> class __call_once_param { - _F __f_; + _Fp __f_; public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {} + explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {} #else _LIBCPP_INLINE_VISIBILITY - explicit __call_once_param(const _F& __f) : __f_(__f) {} + explicit __call_once_param(const _Fp& __f) : __f_(__f) {} #endif _LIBCPP_INLINE_VISIBILITY @@ -517,11 +517,11 @@ public: #endif -template <class _F> +template <class _Fp> void __call_once_proxy(void* __vp) { - __call_once_param<_F>* __p = static_cast<__call_once_param<_F>*>(__vp); + __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp); (*__p)(); } @@ -536,10 +536,10 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) { if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul) { - typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G; - __call_once_param<_G> __p(_G(__decay_copy(_VSTD::forward<_Callable>(__func)), + typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _Gp; + __call_once_param<_Gp> __p(_Gp(__decay_copy(_VSTD::forward<_Callable>(__func)), __decay_copy(_VSTD::forward<_Args>(__args))...)); - __call_once(__flag.__state_, &__p, &__call_once_proxy<_G>); + __call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>); } } diff --git a/libcxx/include/ostream b/libcxx/include/ostream index 53064961ca9..b38326e452e 100644 --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -342,11 +342,11 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_typ try { #endif // _LIBCPP_NO_EXCEPTIONS - typedef istreambuf_iterator<_CharT, _Traits> _I; - typedef ostreambuf_iterator<_CharT, _Traits> _O; - _I __i(__sb); - _I __eof; - _O __o(*this); + typedef istreambuf_iterator<_CharT, _Traits> _Ip; + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + _Ip __i(__sb); + _Ip __eof; + _Op __o(*this); size_t __c = 0; for (; __i != __eof; ++__i, ++__o, ++__c) { @@ -388,8 +388,8 @@ basic_ostream<_CharT, _Traits>::operator<<(bool __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -415,8 +415,8 @@ basic_ostream<_CharT, _Traits>::operator<<(short __n) if (__s) { ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __flags == ios_base::oct || __flags == ios_base::hex ? static_cast<long>(static_cast<unsigned short>(__n)) : @@ -444,8 +444,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -471,8 +471,8 @@ basic_ostream<_CharT, _Traits>::operator<<(int __n) if (__s) { ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __flags == ios_base::oct || __flags == ios_base::hex ? static_cast<long>(static_cast<unsigned int>(__n)) : @@ -500,8 +500,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -526,8 +526,8 @@ basic_ostream<_CharT, _Traits>::operator<<(long __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -552,8 +552,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -578,8 +578,8 @@ basic_ostream<_CharT, _Traits>::operator<<(long long __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -604,8 +604,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -630,8 +630,8 @@ basic_ostream<_CharT, _Traits>::operator<<(float __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -656,8 +656,8 @@ basic_ostream<_CharT, _Traits>::operator<<(double __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -682,8 +682,8 @@ basic_ostream<_CharT, _Traits>::operator<<(long double __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -708,8 +708,8 @@ basic_ostream<_CharT, _Traits>::operator<<(const void* __n) sentry __s(*this); if (__s) { - typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; - const _F& __f = use_facet<_F>(this->getloc()); + typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp; + const _Fp& __f = use_facet<_Fp>(this->getloc()); if (__f.put(*this, *this, this->fill(), __n).failed()) this->setstate(ios_base::badbit | ios_base::failbit); } @@ -734,8 +734,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c) typename basic_ostream<_CharT, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _I; - if (__pad_and_output(_I(__os), + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; + if (__pad_and_output(_Ip(__os), &__c, (__os.flags() & ios_base::adjustfield) == ios_base::left ? &__c + 1 : @@ -767,8 +767,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn) if (__s) { _CharT __c = __os.widen(__cn); - typedef ostreambuf_iterator<_CharT, _Traits> _I; - if (__pad_and_output(_I(__os), + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; + if (__pad_and_output(_Ip(__os), &__c, (__os.flags() & ios_base::adjustfield) == ios_base::left ? &__c + 1 : @@ -799,8 +799,8 @@ operator<<(basic_ostream<char, _Traits>& __os, char __c) typename basic_ostream<char, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<char, _Traits> _I; - if (__pad_and_output(_I(__os), + typedef ostreambuf_iterator<char, _Traits> _Ip; + if (__pad_and_output(_Ip(__os), &__c, (__os.flags() & ios_base::adjustfield) == ios_base::left ? &__c + 1 : @@ -831,8 +831,8 @@ operator<<(basic_ostream<char, _Traits>& __os, signed char __c) typename basic_ostream<char, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<char, _Traits> _I; - if (__pad_and_output(_I(__os), + typedef ostreambuf_iterator<char, _Traits> _Ip; + if (__pad_and_output(_Ip(__os), (char*)&__c, (__os.flags() & ios_base::adjustfield) == ios_base::left ? (char*)&__c + 1 : @@ -863,8 +863,8 @@ operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c) typename basic_ostream<char, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<char, _Traits> _I; - if (__pad_and_output(_I(__os), + typedef ostreambuf_iterator<char, _Traits> _Ip; + if (__pad_and_output(_Ip(__os), (char*)&__c, (__os.flags() & ios_base::adjustfield) == ios_base::left ? (char*)&__c + 1 : @@ -895,9 +895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str) typename basic_ostream<_CharT, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _I; + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; size_t __len = _Traits::length(__str); - if (__pad_and_output(_I(__os), + if (__pad_and_output(_Ip(__os), __str, (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : @@ -928,7 +928,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) typename basic_ostream<_CharT, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _I; + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; size_t __len = char_traits<char>::length(__strn); const int __bs = 100; _CharT __wbb[__bs]; @@ -943,7 +943,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) } for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p) *__p = __os.widen(*__strn); - if (__pad_and_output(_I(__os), + if (__pad_and_output(_Ip(__os), __wb, (__os.flags() & ios_base::adjustfield) == ios_base::left ? __wb + __len : @@ -974,9 +974,9 @@ operator<<(basic_ostream<char, _Traits>& __os, const char* __str) typename basic_ostream<char, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<char, _Traits> _I; + typedef ostreambuf_iterator<char, _Traits> _Ip; size_t __len = _Traits::length(__str); - if (__pad_and_output(_I(__os), + if (__pad_and_output(_Ip(__os), __str, (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : @@ -1007,9 +1007,9 @@ operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str) typename basic_ostream<char, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<char, _Traits> _I; + typedef ostreambuf_iterator<char, _Traits> _Ip; size_t __len = _Traits::length((const char*)__str); - if (__pad_and_output(_I(__os), + if (__pad_and_output(_Ip(__os), (const char*)__str, (__os.flags() & ios_base::adjustfield) == ios_base::left ? (const char*)__str + __len : @@ -1040,9 +1040,9 @@ operator<<(basic_ostream<char, _Traits>& __os, const unsigned char* __str) typename basic_ostream<char, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<char, _Traits> _I; + typedef ostreambuf_iterator<char, _Traits> _Ip; size_t __len = _Traits::length((const char*)__str); - if (__pad_and_output(_I(__os), + if (__pad_and_output(_Ip(__os), (const char*)__str, (__os.flags() & ios_base::adjustfield) == ios_base::left ? (const char*)__str + __len : @@ -1073,8 +1073,8 @@ basic_ostream<_CharT, _Traits>::put(char_type __c) sentry __s(*this); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _O; - _O __o(*this); + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + _Op __o(*this); *__o = __c; if (__o.failed()) this->setstate(ios_base::badbit); @@ -1100,8 +1100,8 @@ basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n) sentry __sen(*this); if (__sen && __n) { - typedef ostreambuf_iterator<_CharT, _Traits> _O; - _O __o(*this); + typedef ostreambuf_iterator<_CharT, _Traits> _Op; + _Op __o(*this); for (; __n; --__n, ++__o, ++__s) { *__o = *__s; @@ -1240,9 +1240,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, typename basic_ostream<_CharT, _Traits>::sentry __s(__os); if (__s) { - typedef ostreambuf_iterator<_CharT, _Traits> _I; + typedef ostreambuf_iterator<_CharT, _Traits> _Ip; size_t __len = __str.size(); - if (__pad_and_output(_I(__os), + if (__pad_and_output(_Ip(__os), __str.data(), (__os.flags() & ios_base::adjustfield) == ios_base::left ? __str.data() + __len : @@ -1270,10 +1270,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec) return __os << __ec.category().name() << ':' << __ec.value(); } -template<class _CharT, class _Traits, class _Y> +template<class _CharT, class _Traits, class _Yp> inline _LIBCPP_INLINE_VISIBILITY basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Y> const& __p) +operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p) { return __os << __p.get(); } diff --git a/libcxx/include/random b/libcxx/include/random index e14425dff98..4d83a9dabc9 100644 --- a/libcxx/include/random +++ b/libcxx/include/random @@ -1667,8 +1667,8 @@ struct __is_seed_sequence // linear_congruential_engine template <unsigned long long __a, unsigned long long __c, - unsigned long long __m, unsigned long long _M, - bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_M-__c)/__a)> + unsigned long long __m, unsigned long long _Mp, + bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_Mp-__c)/__a)> struct __lce_ta; // 64 @@ -1732,16 +1732,16 @@ struct __lce_ta<__a, __c, 0, (unsigned long long)(~0), false> // 32 -template <unsigned long long _A, unsigned long long _C, unsigned long long _M> -struct __lce_ta<_A, _C, _M, unsigned(~0), true> +template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), true> { typedef unsigned result_type; _LIBCPP_INLINE_VISIBILITY static result_type next(result_type __x) { - const result_type __a = static_cast<result_type>(_A); - const result_type __c = static_cast<result_type>(_C); - const result_type __m = static_cast<result_type>(_M); + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); + const result_type __m = static_cast<result_type>(_Mp); // Schrage's algorithm const result_type __q = __m / __a; const result_type __r = __m % __a; @@ -1753,15 +1753,15 @@ struct __lce_ta<_A, _C, _M, unsigned(~0), true> } }; -template <unsigned long long _A, unsigned long long _M> -struct __lce_ta<_A, 0, _M, unsigned(~0), true> +template <unsigned long long _Ap, unsigned long long _Mp> +struct __lce_ta<_Ap, 0, _Mp, unsigned(~0), true> { typedef unsigned result_type; _LIBCPP_INLINE_VISIBILITY static result_type next(result_type __x) { - const result_type __a = static_cast<result_type>(_A); - const result_type __m = static_cast<result_type>(_M); + const result_type __a = static_cast<result_type>(_Ap); + const result_type __m = static_cast<result_type>(_Mp); // Schrage's algorithm const result_type __q = __m / __a; const result_type __r = __m % __a; @@ -1772,29 +1772,29 @@ struct __lce_ta<_A, 0, _M, unsigned(~0), true> } }; -template <unsigned long long _A, unsigned long long _C, unsigned long long _M> -struct __lce_ta<_A, _C, _M, unsigned(~0), false> +template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), false> { typedef unsigned result_type; _LIBCPP_INLINE_VISIBILITY static result_type next(result_type __x) { - const result_type __a = static_cast<result_type>(_A); - const result_type __c = static_cast<result_type>(_C); - const result_type __m = static_cast<result_type>(_M); + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); + const result_type __m = static_cast<result_type>(_Mp); return (__a * __x + __c) % __m; } }; -template <unsigned long long _A, unsigned long long _C> -struct __lce_ta<_A, _C, 0, unsigned(~0), false> +template <unsigned long long _Ap, unsigned long long _Cp> +struct __lce_ta<_Ap, _Cp, 0, unsigned(~0), false> { typedef unsigned result_type; _LIBCPP_INLINE_VISIBILITY static result_type next(result_type __x) { - const result_type __a = static_cast<result_type>(_A); - const result_type __c = static_cast<result_type>(_C); + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); return __a * __x + __c; } }; @@ -1816,16 +1816,16 @@ template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> class linear_congruential_engine; template <class _CharT, class _Traits, - class _U, _U _A, _U _C, _U _N> + class _Up, _Up _Ap, _Up _Cp, _Up _Np> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const linear_congruential_engine<_U, _A, _C, _N>&); + const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&); template <class _CharT, class _Traits, - class _U, _U _A, _U _C, _U _N> + class _Up, _Up _Ap, _Up _Cp, _Up _Np> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - linear_congruential_engine<_U, _A, _C, _N>& __x); + linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x); template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> class _LIBCPP_VISIBLE linear_congruential_engine @@ -1837,7 +1837,7 @@ public: private: result_type __x_; - static const result_type _M = result_type(~0); + static const result_type _Mp = result_type(~0); static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters"); static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters"); @@ -1883,7 +1883,7 @@ public: // generating functions _LIBCPP_INLINE_VISIBILITY result_type operator()() - {return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _M>::next(__x_));} + {return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _Mp>::next(__x_));} _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} @@ -1914,18 +1914,18 @@ private: void __seed(_Sseq& __q, integral_constant<unsigned, 2>); template <class _CharT, class _Traits, - class _U, _U _A, _U _C, _U _N> + class _Up, _Up _Ap, _Up _Cp, _Up _Np> friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const linear_congruential_engine<_U, _A, _C, _N>&); + const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&); template <class _CharT, class _Traits, - class _U, _U _A, _U _C, _U _N> + class _Up, _Up _Ap, _Up _Cp, _Up _Np> friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - linear_congruential_engine<_U, _A, _C, _N>& __x); + linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x); }; template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> @@ -2022,41 +2022,41 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> class mersenne_twister_engine; -template <class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> +template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> bool -operator==(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __y); - -template <class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> +operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); + +template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> bool -operator!=(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __y); +operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x); + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x); + mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, _UIntType __a, size_t __u, _UIntType __d, size_t __s, @@ -2136,45 +2136,45 @@ public: _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} - template <class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> friend bool - operator==(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __y); - - template <class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); + + template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> friend bool - operator!=(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __y); + operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x); + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x); + mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); private: template<class _Sseq> @@ -2297,9 +2297,9 @@ mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, const size_t __j = (__i_ + 1) % __n; const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1); - const result_type _Y = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask); + const result_type _Yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask); const size_t __k = (__i_ + __m) % __n; - __x_[__i_] = __x_[__k] ^ __rshift<1>(_Y) ^ (__a * (_Y & 1)); + __x_[__i_] = __x_[__k] ^ __rshift<1>(_Yp) ^ (__a * (_Yp & 1)); result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d); __i_ = __j; __z ^= __lshift<__s>(__z) & __b; @@ -2307,78 +2307,78 @@ mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, return __z ^ __rshift<__l>(__z); } -template <class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> +template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> bool -operator==(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __y) +operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y) { if (__x.__i_ == __y.__i_) - return _VSTD::equal(__x.__x_, __x.__x_ + _N, __y.__x_); + return _VSTD::equal(__x.__x_, __x.__x_ + _Np, __y.__x_); if (__x.__i_ == 0 || __y.__i_ == 0) { - size_t __j = _VSTD::min(_N - __x.__i_, _N - __y.__i_); + size_t __j = _VSTD::min(_Np - __x.__i_, _Np - __y.__i_); if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j, __y.__x_ + __y.__i_)) return false; if (__x.__i_ == 0) - return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _N, __y.__x_); - return _VSTD::equal(__x.__x_, __x.__x_ + (_N - __j), __y.__x_ + __j); + return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _Np, __y.__x_); + return _VSTD::equal(__x.__x_, __x.__x_ + (_Np - __j), __y.__x_ + __j); } if (__x.__i_ < __y.__i_) { - size_t __j = _N - __y.__i_; + size_t __j = _Np - __y.__i_; if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j), __y.__x_ + __y.__i_)) return false; - if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _N, + if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Np, __y.__x_)) return false; return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_, - __y.__x_ + (_N - (__x.__i_ + __j))); + __y.__x_ + (_Np - (__x.__i_ + __j))); } - size_t __j = _N - __x.__i_; + size_t __j = _Np - __x.__i_; if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j), __x.__x_ + __x.__i_)) return false; - if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _N, + if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Np, __x.__x_)) return false; return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_, - __x.__x_ + (_N - (__y.__i_ + __j))); + __x.__x_ + (_Np - (__y.__i_ + __j))); } -template <class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> +template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> inline _LIBCPP_INLINE_VISIBILITY bool -operator!=(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __y) +operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y) { return !(__x == __y); } template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x) + const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x) { __save_flags<_CharT, _Traits> _(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); __os << __x.__x_[__x.__i_]; - for (size_t __j = __x.__i_ + 1; __j < _N; ++__j) + for (size_t __j = __x.__i_ + 1; __j < _Np; ++__j) __os << __sp << __x.__x_[__j]; for (size_t __j = 0; __j < __x.__i_; ++__j) __os << __sp << __x.__x_[__j]; @@ -2386,22 +2386,22 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, } template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _N, size_t _M, size_t _R, - _UI _A, size_t _U, _UI _D, size_t _S, - _UI _B, size_t _T, _UI _C, size_t _L, _UI _F> + class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp, + _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S, - _B, _T, _C, _L, _F>& __x) + mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x) { __save_flags<_CharT, _Traits> _(__is); __is.flags(ios_base::dec | ios_base::skipws); - _UI __t[_N]; - for (size_t __i = 0; __i < _N; ++__i) + _UI __t[_Np]; + for (size_t __i = 0; __i < _Np; ++__i) __is >> __t[__i]; if (!__is.fail()) { - for (size_t __i = 0; __i < _N; ++__i) + for (size_t __i = 0; __i < _Np; ++__i) __x.__x_[__i] = __t[__i]; __x.__i_ = 0; } @@ -2424,29 +2424,29 @@ typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31, template<class _UIntType, size_t __w, size_t __s, size_t __r> class subtract_with_carry_engine; -template<class _UI, size_t _W, size_t _S, size_t _R> +template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp> bool operator==( - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __y); + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y); -template<class _UI, size_t _W, size_t _S, size_t _R> +template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp> bool operator!=( - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __y); + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _S, size_t _R> + class _UI, size_t _Wp, size_t _Sp, size_t _Rp> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x); + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _S, size_t _R> + class _UI, size_t _Wp, size_t _Sp, size_t _Rp> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - subtract_with_carry_engine<_UI, _W, _S, _R>& __x); + subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x); template<class _UIntType, size_t __w, size_t __s, size_t __r> class _LIBCPP_VISIBLE subtract_with_carry_engine @@ -2507,33 +2507,33 @@ public: _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} - template<class _UI, size_t _W, size_t _S, size_t _R> + template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp> friend bool operator==( - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __y); + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y); - template<class _UI, size_t _W, size_t _S, size_t _R> + template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp> friend bool operator!=( - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __y); + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _S, size_t _R> + class _UI, size_t _Wp, size_t _Sp, size_t _Rp> friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x); + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x); template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _S, size_t _R> + class _UI, size_t _Wp, size_t _Sp, size_t _Rp> friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - subtract_with_carry_engine<_UI, _W, _S, _R>& __x); + subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x); private: @@ -2619,71 +2619,71 @@ subtract_with_carry_engine<_UIntType, __w, __s, __r>::operator()() return __xr; } -template<class _UI, size_t _W, size_t _S, size_t _R> +template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp> bool operator==( - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __y) + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y) { if (__x.__c_ != __y.__c_) return false; if (__x.__i_ == __y.__i_) - return _VSTD::equal(__x.__x_, __x.__x_ + _R, __y.__x_); + return _VSTD::equal(__x.__x_, __x.__x_ + _Rp, __y.__x_); if (__x.__i_ == 0 || __y.__i_ == 0) { - size_t __j = _VSTD::min(_R - __x.__i_, _R - __y.__i_); + size_t __j = _VSTD::min(_Rp - __x.__i_, _Rp - __y.__i_); if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j, __y.__x_ + __y.__i_)) return false; if (__x.__i_ == 0) - return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _R, __y.__x_); - return _VSTD::equal(__x.__x_, __x.__x_ + (_R - __j), __y.__x_ + __j); + return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _Rp, __y.__x_); + return _VSTD::equal(__x.__x_, __x.__x_ + (_Rp - __j), __y.__x_ + __j); } if (__x.__i_ < __y.__i_) { - size_t __j = _R - __y.__i_; + size_t __j = _Rp - __y.__i_; if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j), __y.__x_ + __y.__i_)) return false; - if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _R, + if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Rp, __y.__x_)) return false; return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_, - __y.__x_ + (_R - (__x.__i_ + __j))); + __y.__x_ + (_Rp - (__x.__i_ + __j))); } - size_t __j = _R - __x.__i_; + size_t __j = _Rp - __x.__i_; if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j), __x.__x_ + __x.__i_)) return false; - if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _R, + if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Rp, __x.__x_)) return false; return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_, - __x.__x_ + (_R - (__y.__i_ + __j))); + __x.__x_ + (_Rp - (__y.__i_ + __j))); } -template<class _UI, size_t _W, size_t _S, size_t _R> +template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp> inline _LIBCPP_INLINE_VISIBILITY bool operator!=( - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __y) + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y) { return !(__x == __y); } template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _S, size_t _R> + class _UI, size_t _Wp, size_t _Sp, size_t _Rp> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const subtract_with_carry_engine<_UI, _W, _S, _R>& __x) + const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x) { __save_flags<_CharT, _Traits> _(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); __os << __x.__x_[__x.__i_]; - for (size_t __j = __x.__i_ + 1; __j < _R; ++__j) + for (size_t __j = __x.__i_ + 1; __j < _Rp; ++__j) __os << __sp << __x.__x_[__j]; for (size_t __j = 0; __j < __x.__i_; ++__j) __os << __sp << __x.__x_[__j]; @@ -2692,21 +2692,21 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, } template <class _CharT, class _Traits, - class _UI, size_t _W, size_t _S, size_t _R> + class _UI, size_t _Wp, size_t _Sp, size_t _Rp> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - subtract_with_carry_engine<_UI, _W, _S, _R>& __x) + subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x) { __save_flags<_CharT, _Traits> _(__is); __is.flags(ios_base::dec | ios_base::skipws); - _UI __t[_R+1]; - for (size_t __i = 0; __i < _R+1; ++__i) + _UI __t[_Rp+1]; + for (size_t __i = 0; __i < _Rp+1; ++__i) __is >> __t[__i]; if (!__is.fail()) { - for (size_t __i = 0; __i < _R; ++__i) + for (size_t __i = 0; __i < _Rp; ++__i) __x.__x_[__i] = __t[__i]; - __x.__c_ = __t[_R]; + __x.__c_ = __t[_Rp]; __x.__i_ = 0; } return __is; @@ -2783,33 +2783,33 @@ public: _LIBCPP_INLINE_VISIBILITY const _Engine& base() const {return __e_;} - template<class _Eng, size_t _P, size_t _R> + template<class _Eng, size_t _Pp, size_t _Rp> friend bool operator==( - const discard_block_engine<_Eng, _P, _R>& __x, - const discard_block_engine<_Eng, _P, _R>& __y); + const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y); - template<class _Eng, size_t _P, size_t _R> + template<class _Eng, size_t _Pp, size_t _Rp> friend bool operator!=( - const discard_block_engine<_Eng, _P, _R>& __x, - const discard_block_engine<_Eng, _P, _R>& __y); + const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y); template <class _CharT, class _Traits, - class _Eng, size_t _P, size_t _R> + class _Eng, size_t _Pp, size_t _Rp> friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const discard_block_engine<_Eng, _P, _R>& __x); + const discard_block_engine<_Eng, _Pp, _Rp>& __x); template <class _CharT, class _Traits, - class _Eng, size_t _P, size_t _R> + class _Eng, size_t _Pp, size_t _Rp> friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - discard_block_engine<_Eng, _P, _R>& __x); + discard_block_engine<_Eng, _Pp, _Rp>& __x); }; template<class _Engine, size_t __p, size_t __r> @@ -2825,29 +2825,29 @@ discard_block_engine<_Engine, __p, __r>::operator()() return __e_(); } -template<class _Eng, size_t _P, size_t _R> +template<class _Eng, size_t _Pp, size_t _Rp> inline _LIBCPP_INLINE_VISIBILITY bool -operator==(const discard_block_engine<_Eng, _P, _R>& __x, - const discard_block_engine<_Eng, _P, _R>& __y) +operator==(const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y) { return __x.__n_ == __y.__n_ && __x.__e_ == __y.__e_; } -template<class _Eng, size_t _P, size_t _R> +template<class _Eng, size_t _Pp, size_t _Rp> inline _LIBCPP_INLINE_VISIBILITY bool -operator!=(const discard_block_engine<_Eng, _P, _R>& __x, - const discard_block_engine<_Eng, _P, _R>& __y) +operator!=(const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y) { return !(__x == __y); } template <class _CharT, class _Traits, - class _Eng, size_t _P, size_t _R> + class _Eng, size_t _Pp, size_t _Rp> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const discard_block_engine<_Eng, _P, _R>& __x) + const discard_block_engine<_Eng, _Pp, _Rp>& __x) { __save_flags<_CharT, _Traits> _(__os); __os.flags(ios_base::dec | ios_base::left); @@ -2857,10 +2857,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, } template <class _CharT, class _Traits, - class _Eng, size_t _P, size_t _R> + class _Eng, size_t _Pp, size_t _Rp> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - discard_block_engine<_Eng, _P, _R>& __x) + discard_block_engine<_Eng, _Pp, _Rp>& __x) { __save_flags<_CharT, _Traits> _(__is); __is.flags(ios_base::dec | ios_base::skipws); @@ -2883,15 +2883,15 @@ typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48; template<class _Engine, size_t __w, class _UIntType> class _LIBCPP_VISIBLE independent_bits_engine { - template <class _UI, _UI _R0, size_t _W, size_t _M> + template <class _UI, _UI _R0, size_t _Wp, size_t _Mp> class __get_n { static const size_t _Dt = numeric_limits<_UI>::digits; - static const size_t _N = _W / _M + (_W % _M != 0); - static const size_t _W0 = _W / _N; + static const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0); + static const size_t _W0 = _Wp / _Np; static const _UI _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0; public: - static const size_t value = _R0 - _Y0 > _Y0 / _N ? _N + 1 : _N; + static const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np; }; public: // types @@ -2912,18 +2912,18 @@ private: _Engine_result_type >::type _Working_result_type; // Temporary work around for lack of constexpr - static const _Working_result_type _R = _Engine::_Max - _Engine::_Min + static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + _Working_result_type(1); - static const size_t __m = __log2<_Working_result_type, _R>::value; - static const size_t __n = __get_n<_Working_result_type, _R, __w, __m>::value; + static const size_t __m = __log2<_Working_result_type, _Rp>::value; + static const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value; static const size_t __w0 = __w / __n; static const size_t __n0 = __n - __w % __n; static const size_t _WDt = numeric_limits<_Working_result_type>::digits; static const size_t _EDt = numeric_limits<_Engine_result_type>::digits; static const _Working_result_type __y0 = __w0 >= _WDt ? 0 : - (_R >> __w0) << __w0; + (_Rp >> __w0) << __w0; static const _Working_result_type __y1 = __w0 >= _WDt - 1 ? 0 : - (_R >> (__w0+1)) << (__w0+1); + (_Rp >> (__w0+1)) << (__w0+1); static const _Engine_result_type __mask0 = __w0 > 0 ? _Engine_result_type(~0) >> (_EDt - __w0) : _Engine_result_type(0); @@ -2975,7 +2975,7 @@ public: // generating functions _LIBCPP_INLINE_VISIBILITY - result_type operator()() {return __eval(integral_constant<bool, _R != 0>());} + result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} @@ -2983,33 +2983,33 @@ public: _LIBCPP_INLINE_VISIBILITY const _Engine& base() const {return __e_;} - template<class _Eng, size_t _W, class _UI> + template<class _Eng, size_t _Wp, class _UI> friend bool operator==( - const independent_bits_engine<_Eng, _W, _UI>& __x, - const independent_bits_engine<_Eng, _W, _UI>& __y); + const independent_bits_engine<_Eng, _Wp, _UI>& __x, + const independent_bits_engine<_Eng, _Wp, _UI>& __y); - template<class _Eng, size_t _W, class _UI> + template<class _Eng, size_t _Wp, class _UI> friend bool operator!=( - const independent_bits_engine<_Eng, _W, _UI>& __x, - const independent_bits_engine<_Eng, _W, _UI>& __y); + const independent_bits_engine<_Eng, _Wp, _UI>& __x, + const independent_bits_engine<_Eng, _Wp, _UI>& __y); template <class _CharT, class _Traits, - class _Eng, size_t _W, class _UI> + class _Eng, size_t _Wp, class _UI> friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const independent_bits_engine<_Eng, _W, _UI>& __x); + const independent_bits_engine<_Eng, _Wp, _UI>& __x); template <class _CharT, class _Traits, - class _Eng, size_t _W, class _UI> + class _Eng, size_t _Wp, class _UI> friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - independent_bits_engine<_Eng, _W, _UI>& __x); + independent_bits_engine<_Eng, _Wp, _UI>& __x); private: result_type __eval(false_type); @@ -3048,7 +3048,7 @@ template<class _Engine, size_t __w, class _UIntType> _UIntType independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) { - result_type _S = 0; + result_type _Sp = 0; for (size_t __k = 0; __k < __n0; ++__k) { _Engine_result_type __u; @@ -3056,7 +3056,7 @@ independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) { __u = __e_() - _Engine::min(); } while (__u >= __y0); - _S = static_cast<result_type>(__lshift<__w0>(_S) + (__u & __mask0)); + _Sp = static_cast<result_type>(__lshift<__w0>(_Sp) + (__u & __mask0)); } for (size_t __k = __n0; __k < __n; ++__k) { @@ -3065,45 +3065,45 @@ independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) { __u = __e_() - _Engine::min(); } while (__u >= __y1); - _S = static_cast<result_type>(__lshift<__w0+1>(_S) + (__u & __mask1)); + _Sp = static_cast<result_type>(__lshift<__w0+1>(_Sp) + (__u & __mask1)); } - return _S; + return _Sp; } -template<class _Eng, size_t _W, class _UI> +template<class _Eng, size_t _Wp, class _UI> inline _LIBCPP_INLINE_VISIBILITY bool operator==( - const independent_bits_engine<_Eng, _W, _UI>& __x, - const independent_bits_engine<_Eng, _W, _UI>& __y) + const independent_bits_engine<_Eng, _Wp, _UI>& __x, + const independent_bits_engine<_Eng, _Wp, _UI>& __y) { return __x.base() == __y.base(); } -template<class _Eng, size_t _W, class _UI> +template<class _Eng, size_t _Wp, class _UI> inline _LIBCPP_INLINE_VISIBILITY bool operator!=( - const independent_bits_engine<_Eng, _W, _UI>& __x, - const independent_bits_engine<_Eng, _W, _UI>& __y) + const independent_bits_engine<_Eng, _Wp, _UI>& __x, + const independent_bits_engine<_Eng, _Wp, _UI>& __y) { return !(__x == __y); } template <class _CharT, class _Traits, - class _Eng, size_t _W, class _UI> + class _Eng, size_t _Wp, class _UI> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const independent_bits_engine<_Eng, _W, _UI>& __x) + const independent_bits_engine<_Eng, _Wp, _UI>& __x) { return __os << __x.base(); } template <class _CharT, class _Traits, - class _Eng, size_t _W, class _UI> + class _Eng, size_t _Wp, class _UI> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - independent_bits_engine<_Eng, _W, _UI>& __x) + independent_bits_engine<_Eng, _Wp, _UI>& __x) { _Eng __e; __is >> __e; @@ -3126,14 +3126,14 @@ struct __ugcd<_Xp, 0> static const uint64_t value = _Xp; }; -template <uint64_t _N, uint64_t _D> +template <uint64_t _Np, uint64_t _Dp> class __uratio { - static_assert(_D != 0, "__uratio divide by 0"); - static const uint64_t __gcd = __ugcd<_N, _D>::value; + static_assert(_Dp != 0, "__uratio divide by 0"); + static const uint64_t __gcd = __ugcd<_Np, _Dp>::value; public: - static const uint64_t num = _N / __gcd; - static const uint64_t den = _D / __gcd; + static const uint64_t num = _Np / __gcd; + static const uint64_t den = _Dp / __gcd; typedef __uratio<num, den> type; }; @@ -3163,7 +3163,7 @@ public: _LIBCPP_INLINE_VISIBILITY static const/*expr*/ result_type max() { return _Max; } - static const unsigned long long _R = _Max - _Min + 1ull; + static const unsigned long long _Rp = _Max - _Min + 1ull; // constructors and seeding functions _LIBCPP_INLINE_VISIBILITY @@ -3198,7 +3198,7 @@ public: // generating functions _LIBCPP_INLINE_VISIBILITY - result_type operator()() {return __eval(integral_constant<bool, _R != 0>());} + result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} @@ -3207,33 +3207,33 @@ public: const _Engine& base() const {return __e_;} private: - template<class _Eng, size_t _K> + template<class _Eng, size_t _Kp> friend bool operator==( - const shuffle_order_engine<_Eng, _K>& __x, - const shuffle_order_engine<_Eng, _K>& __y); + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y); - template<class _Eng, size_t _K> + template<class _Eng, size_t _Kp> friend bool operator!=( - const shuffle_order_engine<_Eng, _K>& __x, - const shuffle_order_engine<_Eng, _K>& __y); + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y); template <class _CharT, class _Traits, - class _Eng, size_t _K> + class _Eng, size_t _Kp> friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const shuffle_order_engine<_Eng, _K>& __x); + const shuffle_order_engine<_Eng, _Kp>& __x); template <class _CharT, class _Traits, - class _Eng, size_t _K> + class _Eng, size_t _Kp> friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - shuffle_order_engine<_Eng, _K>& __x); + shuffle_order_engine<_Eng, _Kp>& __x); _LIBCPP_INLINE_VISIBILITY void __init() @@ -3246,34 +3246,34 @@ private: _LIBCPP_INLINE_VISIBILITY result_type __eval(false_type) {return __eval2(integral_constant<bool, __k & 1>());} _LIBCPP_INLINE_VISIBILITY - result_type __eval(true_type) {return __eval(__uratio<__k, _R>());} + result_type __eval(true_type) {return __eval(__uratio<__k, _Rp>());} _LIBCPP_INLINE_VISIBILITY result_type __eval2(false_type) {return __eval(__uratio<__k/2, 0x8000000000000000ull>());} _LIBCPP_INLINE_VISIBILITY result_type __eval2(true_type) {return __evalf<__k, 0>();} - template <uint64_t _N, uint64_t _D> + template <uint64_t _Np, uint64_t _Dp> _LIBCPP_INLINE_VISIBILITY typename enable_if < - (__uratio<_N, _D>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)), + (__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)), result_type >::type - __eval(__uratio<_N, _D>) - {return __evalf<__uratio<_N, _D>::num, __uratio<_N, _D>::den>();} + __eval(__uratio<_Np, _Dp>) + {return __evalf<__uratio<_Np, _Dp>::num, __uratio<_Np, _Dp>::den>();} - template <uint64_t _N, uint64_t _D> + template <uint64_t _Np, uint64_t _Dp> _LIBCPP_INLINE_VISIBILITY typename enable_if < - __uratio<_N, _D>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min), + __uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min), result_type >::type - __eval(__uratio<_N, _D>) + __eval(__uratio<_Np, _Dp>) { - const size_t __j = static_cast<size_t>(__uratio<_N, _D>::num * (_Y_ - _Min) - / __uratio<_N, _D>::den); + const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (_Y_ - _Min) + / __uratio<_Np, _Dp>::den); _Y_ = _V_[__j]; _V_[__j] = __e_(); return _Y_; @@ -3283,72 +3283,72 @@ private: _LIBCPP_INLINE_VISIBILITY result_type __evalf() { - const double _F = __d == 0 ? + const double _Fp = __d == 0 ? __n / (2. * 0x8000000000000000ull) : __n / (double)__d; - const size_t __j = static_cast<size_t>(_F * (_Y_ - _Min)); + const size_t __j = static_cast<size_t>(_Fp * (_Y_ - _Min)); _Y_ = _V_[__j]; _V_[__j] = __e_(); return _Y_; } }; -template<class _Eng, size_t _K> +template<class _Eng, size_t _Kp> bool operator==( - const shuffle_order_engine<_Eng, _K>& __x, - const shuffle_order_engine<_Eng, _K>& __y) + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y) { - return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _K, __y._V_) && + return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _Kp, __y._V_) && __x.__e_ == __y.__e_; } -template<class _Eng, size_t _K> +template<class _Eng, size_t _Kp> inline _LIBCPP_INLINE_VISIBILITY bool operator!=( - const shuffle_order_engine<_Eng, _K>& __x, - const shuffle_order_engine<_Eng, _K>& __y) + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y) { return !(__x == __y); } template <class _CharT, class _Traits, - class _Eng, size_t _K> + class _Eng, size_t _Kp> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const shuffle_order_engine<_Eng, _K>& __x) + const shuffle_order_engine<_Eng, _Kp>& __x) { __save_flags<_CharT, _Traits> _(__os); __os.flags(ios_base::dec | ios_base::left); _CharT __sp = __os.widen(' '); __os.fill(__sp); __os << __x.__e_ << __sp << __x._V_[0]; - for (size_t __i = 1; __i < _K; ++__i) + for (size_t __i = 1; __i < _Kp; ++__i) __os << __sp << __x._V_[__i]; return __os << __sp << __x._Y_; } template <class _CharT, class _Traits, - class _Eng, size_t _K> + class _Eng, size_t _Kp> basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, - shuffle_order_engine<_Eng, _K>& __x) + shuffle_order_engine<_Eng, _Kp>& __x) { - typedef typename shuffle_order_engine<_Eng, _K>::result_type result_type; + typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type; __save_flags<_CharT, _Traits> _(__is); __is.flags(ios_base::dec | ios_base::skipws); _Eng __e; - result_type _V[_K+1]; + result_type _Vp[_Kp+1]; __is >> __e; - for (size_t __i = 0; __i < _K+1; ++__i) - __is >> _V[__i]; + for (size_t __i = 0; __i < _Kp+1; ++__i) + __is >> _Vp[__i]; if (!__is.fail()) { __x.__e_ = __e; - for (size_t __i = 0; __i < _K; ++__i) - __x._V_[__i] = _V[__i]; - __x._Y_ = _V[_K]; + for (size_t __i = 0; __i < _Kp; ++__i) + __x._V_[__i] = _Vp[__i]; + __x._Y_ = _Vp[_Kp]; } return __is; } @@ -3435,7 +3435,7 @@ private: void operator=(const seed_seq&); // = delete; _LIBCPP_INLINE_VISIBILITY - static result_type _T(result_type __x) {return __x ^ (__x >> 27);} + static result_type _Tp(result_type __x) {return __x ^ (__x >> 27);} }; template<class _InputIterator> @@ -3465,7 +3465,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last) const size_t __m = _VSTD::max(__s + 1, __n); // __k = 0; { - result_type __r = 1664525 * _T(__first[0] ^ __first[__p] + result_type __r = 1664525 * _Tp(__first[0] ^ __first[__p] ^ __first[__n - 1]); __first[__p] += __r; __r += __s; @@ -3476,7 +3476,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last) { const size_t __kmodn = __k % __n; const size_t __kpmodn = (__k + __p) % __n; - result_type __r = 1664525 * _T(__first[__kmodn] ^ __first[__kpmodn] + result_type __r = 1664525 * _Tp(__first[__kmodn] ^ __first[__kpmodn] ^ __first[(__k - 1) % __n]); __first[__kpmodn] += __r; __r += __kmodn + __v_[__k-1]; @@ -3487,7 +3487,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last) { const size_t __kmodn = __k % __n; const size_t __kpmodn = (__k + __p) % __n; - result_type __r = 1664525 * _T(__first[__kmodn] ^ __first[__kpmodn] + result_type __r = 1664525 * _Tp(__first[__kmodn] ^ __first[__kpmodn] ^ __first[(__k - 1) % __n]); __first[__kpmodn] += __r; __r += __kmodn; @@ -3498,7 +3498,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last) { const size_t __kmodn = __k % __n; const size_t __kpmodn = (__k + __p) % __n; - result_type __r = 1566083941 * _T(__first[__kmodn] + + result_type __r = 1566083941 * _Tp(__first[__kmodn] + __first[__kpmodn] + __first[(__k - 1) % __n]); __first[__kpmodn] ^= __r; @@ -3519,12 +3519,12 @@ generate_canonical(_URNG& __g) const size_t __b = _Dt < __bits ? _Dt : __bits; const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value; const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0); - const _RealType _R = _URNG::_Max - _URNG::_Min + _RealType(1); - _RealType __base = _R; - _RealType _S = __g() - _URNG::_Min; - for (size_t __i = 1; __i < __k; ++__i, __base *= _R) - _S += (__g() - _URNG::_Min) * __base; - return _S / __base; + const _RealType _Rp = _URNG::_Max - _URNG::_Min + _RealType(1); + _RealType __base = _Rp; + _RealType _Sp = __g() - _URNG::_Min; + for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp) + _Sp += (__g() - _URNG::_Min) * __base; + return _Sp / __base; } // uniform_int_distribution @@ -4171,11 +4171,11 @@ template<class _URNG> _RealType normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) { - result_type _U; + result_type _Up; if (_V_hot_) { _V_hot_ = false; - _U = _V_; + _Up = _V_; } else { @@ -4189,12 +4189,12 @@ normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) __v = _Uni(__g); __s = __u * __u + __v * __v; } while (__s > 1 || __s == 0); - result_type _F = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s); - _V_ = __v * _F; + result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s); + _V_ = __v * _Fp; _V_hot_ = true; - _U = __u * _F; + _Up = __u * _Fp; } - return _U * __p.stddev() + __p.mean(); + return _Up * __p.stddev() + __p.mean(); } template <class _CharT, class _Traits, class _RT> @@ -4225,16 +4225,16 @@ operator>>(basic_istream<_CharT, _Traits>& __is, __is.flags(ios_base::dec | ios_base::skipws); result_type __mean; result_type __stddev; - result_type _V = 0; + result_type _Vp = 0; bool _V_hot = false; __is >> __mean >> __stddev >> _V_hot; if (_V_hot) - __is >> _V; + __is >> _Vp; if (!__is.fail()) { __x.param(param_type(__mean, __stddev)); __x._V_hot_ = _V_hot; - __x._V_ = _V; + __x._V_ = _Vp; } return __is; } @@ -6421,23 +6421,23 @@ void piecewise_linear_distribution<_RealType>::param_type::__init() { __areas_.assign(__densities_.size() - 1, result_type()); - result_type _S = 0; + result_type _Sp = 0; for (size_t __i = 0; __i < __areas_.size(); ++__i) { __areas_[__i] = (__densities_[__i+1] + __densities_[__i]) * (__b_[__i+1] - __b_[__i]) * .5; - _S += __areas_[__i]; + _Sp += __areas_[__i]; } for (size_t __i = __areas_.size(); __i > 1;) { --__i; - __areas_[__i] = __areas_[__i-1] / _S; + __areas_[__i] = __areas_[__i-1] / _Sp; } __areas_[0] = 0; for (size_t __i = 1; __i < __areas_.size(); ++__i) __areas_[__i] += __areas_[__i-1]; for (size_t __i = 0; __i < __densities_.size(); ++__i) - __densities_[__i] /= _S; + __densities_[__i] /= _Sp; } template<class _RealType> diff --git a/libcxx/include/ratio b/libcxx/include/ratio index eb1ad24e40e..23f22679462 100644 --- a/libcxx/include/ratio +++ b/libcxx/include/ratio @@ -414,27 +414,27 @@ struct __ratio_less1 static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2; }; -template <class _R1, class _R2, bool _Odd, intmax_t _Q> -struct __ratio_less1<_R1, _R2, _Odd, _Q, 0, _Q, 0> +template <class _R1, class _R2, bool _Odd, intmax_t _Qp> +struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, 0> { static const bool value = false; }; -template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M2> -struct __ratio_less1<_R1, _R2, _Odd, _Q, 0, _Q, _M2> +template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M2> +struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, _M2> { static const bool value = !_Odd; }; -template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M1> -struct __ratio_less1<_R1, _R2, _Odd, _Q, _M1, _Q, 0> +template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1> +struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, 0> { static const bool value = _Odd; }; -template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M1, +template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1, intmax_t _M2> -struct __ratio_less1<_R1, _R2, _Odd, _Q, _M1, _Q, _M2> +struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, _M2> { static const bool value = __ratio_less1<ratio<_R1::den, _M1>, ratio<_R2::den, _M2>, !_Odd>::value; diff --git a/libcxx/include/regex b/libcxx/include/regex index 1da7b0e76f7..0774eee6511 100644 --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -2794,49 +2794,49 @@ private: match_results<const _CharT*, _Allocator>& __m, regex_constants::match_flag_type __flags, bool) const; - template <class _B, class _A, class _C, class _T> + template <class _Bp, class _Ap, class _Cp, class _Tp> friend bool - regex_search(_B, _B, match_results<_B, _A>&, const basic_regex<_C, _T>&, + regex_search(_Bp, _Bp, match_results<_Bp, _Ap>&, const basic_regex<_Cp, _Tp>&, regex_constants::match_flag_type); - template <class _A, class _C, class _T> + template <class _Ap, class _Cp, class _Tp> friend bool - regex_search(const _C*, const _C*, match_results<const _C*, _A>&, - const basic_regex<_C, _T>&, regex_constants::match_flag_type); + regex_search(const _Cp*, const _Cp*, match_results<const _Cp*, _Ap>&, + const basic_regex<_Cp, _Tp>&, regex_constants::match_flag_type); - template <class _B, class _C, class _T> + template <class _Bp, class _Cp, class _Tp> friend bool - regex_search(_B, _B, const basic_regex<_C, _T>&, + regex_search(_Bp, _Bp, const basic_regex<_Cp, _Tp>&, regex_constants::match_flag_type); - template <class _C, class _T> + template <class _Cp, class _Tp> friend bool - regex_search(const _C*, const _C*, - const basic_regex<_C, _T>&, regex_constants::match_flag_type); + regex_search(const _Cp*, const _Cp*, + const basic_regex<_Cp, _Tp>&, regex_constants::match_flag_type); - template <class _C, class _A, class _T> + template <class _Cp, class _Ap, class _Tp> friend bool - regex_search(const _C*, match_results<const _C*, _A>&, const basic_regex<_C, _T>&, + regex_search(const _Cp*, match_results<const _Cp*, _Ap>&, const basic_regex<_Cp, _Tp>&, regex_constants::match_flag_type); - template <class _ST, class _SA, class _C, class _T> + template <class _ST, class _SA, class _Cp, class _Tp> friend bool - regex_search(const basic_string<_C, _ST, _SA>& __s, - const basic_regex<_C, _T>& __e, + regex_search(const basic_string<_Cp, _ST, _SA>& __s, + const basic_regex<_Cp, _Tp>& __e, regex_constants::match_flag_type __flags); - template <class _ST, class _SA, class _A, class _C, class _T> + template <class _ST, class _SA, class _Ap, class _Cp, class _Tp> friend bool - regex_search(const basic_string<_C, _ST, _SA>& __s, - match_results<typename basic_string<_C, _ST, _SA>::const_iterator, _A>&, - const basic_regex<_C, _T>& __e, + regex_search(const basic_string<_Cp, _ST, _SA>& __s, + match_results<typename basic_string<_Cp, _ST, _SA>::const_iterator, _Ap>&, + const basic_regex<_Cp, _Tp>& __e, regex_constants::match_flag_type __flags); template <class, class> friend class __lookahead; @@ -5263,12 +5263,12 @@ public: // swap: void swap(match_results& __m); - template <class _B, class _A> + template <class _Bp, class _Ap> _LIBCPP_INLINE_VISIBILITY void __assign(_BidirectionalIterator __f, _BidirectionalIterator __l, - const match_results<_B, _A>& __m, bool __no_update_pos) + const match_results<_Bp, _Ap>& __m, bool __no_update_pos) { - _B __mf = __m.prefix().first; + _Bp __mf = __m.prefix().first; __matches_.resize(__m.size()); for (size_type __i = 0; __i < __matches_.size(); ++__i) { @@ -5297,16 +5297,16 @@ private: template <class, class> friend class basic_regex; - template <class _B, class _A, class _C, class _T> + template <class _Bp, class _Ap, class _Cp, class _Tp> friend bool - regex_match(_B, _B, match_results<_B, _A>&, const basic_regex<_C, _T>&, + regex_match(_Bp, _Bp, match_results<_Bp, _Ap>&, const basic_regex<_Cp, _Tp>&, regex_constants::match_flag_type); - template <class _B, class _A> + template <class _Bp, class _Ap> friend bool - operator==(const match_results<_B, _A>&, const match_results<_B, _A>&); + operator==(const match_results<_Bp, _Ap>&, const match_results<_Bp, _Ap>&); template <class, class> friend class __lookahead; }; @@ -5497,7 +5497,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma( { vector<__state> __states; ptrdiff_t __j = 0; - ptrdiff_t _N = _VSTD::distance(__first, __last); + ptrdiff_t _Np = _VSTD::distance(__first, __last); __node* __st = __start_.get(); if (__st) { @@ -5563,7 +5563,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs( { deque<__state> __states; ptrdiff_t __highest_j = 0; - ptrdiff_t _N = _VSTD::distance(__first, __last); + ptrdiff_t _Np = _VSTD::distance(__first, __last); __node* __st = __start_.get(); if (__st) { @@ -5588,7 +5588,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs( if (!__matched || __highest_j < __s.__current_ - __s.__first_) __highest_j = __s.__current_ - __s.__first_; __matched = true; - if (__highest_j == _N) + if (__highest_j == _Np) __states.clear(); else __states.pop_back(); @@ -5643,7 +5643,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs( __state __best_state; ptrdiff_t __j = 0; ptrdiff_t __highest_j = 0; - ptrdiff_t _N = _VSTD::distance(__first, __last); + ptrdiff_t _Np = _VSTD::distance(__first, __last); __node* __st = __start_.get(); if (__st) { @@ -5673,7 +5673,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs( __best_state = __s; } __matched = true; - if (__highest_j == _N) + if (__highest_j == _Np) __states.clear(); else __states.pop_back(); @@ -6088,11 +6088,11 @@ public: regex_constants::match_flag_type __m = regex_constants::match_default); #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <size_t _N> + template <size_t _Np> regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, const regex_type& __re, - const int (&__submatches)[_N], + const int (&__submatches)[_Np], regex_constants::match_flag_type __m = regex_constants::match_default); regex_token_iterator(const regex_token_iterator&); @@ -6194,15 +6194,15 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>:: #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS template <class _BidirectionalIterator, class _CharT, class _Traits> -template <size_t _N> +template <size_t _Np> regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>:: regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, const regex_type& __re, - const int (&__submatches)[_N], + const int (&__submatches)[_Np], regex_constants::match_flag_type __m) : __position_(__a, __b, __re, __m), _N_(0), - __subs_(__submatches, __submatches + _N) + __subs_(__submatches, __submatches + _Np) { __init(__a, __b); } diff --git a/libcxx/include/system_error b/libcxx/include/system_error index ea96a66c0db..d65b29b1640 100644 --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -419,10 +419,10 @@ public: error_condition(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {} - template <class _E> + template <class _Ep> _LIBCPP_ALWAYS_INLINE - error_condition(_E __e, - typename enable_if<is_error_condition_enum<_E>::value>::type* = 0 + error_condition(_Ep __e, + typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0 ) _NOEXCEPT {*this = make_error_condition(__e);} @@ -433,14 +433,14 @@ public: __cat_ = &__cat; } - template <class _E> + template <class _Ep> _LIBCPP_ALWAYS_INLINE typename enable_if < - is_error_condition_enum<_E>::value, + is_error_condition_enum<_Ep>::value, error_condition& >::type - operator=(_E __e) _NOEXCEPT + operator=(_Ep __e) _NOEXCEPT {*this = make_error_condition(__e); return *this;} _LIBCPP_ALWAYS_INLINE @@ -491,10 +491,10 @@ public: error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {} - template <class _E> + template <class _Ep> _LIBCPP_ALWAYS_INLINE - error_code(_E __e, - typename enable_if<is_error_code_enum<_E>::value>::type* = 0 + error_code(_Ep __e, + typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0 ) _NOEXCEPT {*this = make_error_code(__e);} @@ -505,14 +505,14 @@ public: __cat_ = &__cat; } - template <class _E> + template <class _Ep> _LIBCPP_ALWAYS_INLINE typename enable_if < - is_error_code_enum<_E>::value, + is_error_code_enum<_Ep>::value, error_code& >::type - operator=(_E __e) _NOEXCEPT + operator=(_Ep __e) _NOEXCEPT {*this = make_error_code(__e); return *this;} _LIBCPP_ALWAYS_INLINE diff --git a/libcxx/include/thread b/libcxx/include/thread index 4db4f61b981..2e8284692fe 100644 --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -267,15 +267,15 @@ public: _LIBCPP_INLINE_VISIBILITY thread() : __t_(0) {} #ifndef _LIBCPP_HAS_NO_VARIADICS - template <class _F, class ..._Args, + template <class _Fp, class ..._Args, class = typename enable_if < - !is_same<typename decay<_F>::type, thread>::value + !is_same<typename decay<_Fp>::type, thread>::value >::type > - explicit thread(_F&& __f, _Args&&... __args); + explicit thread(_Fp&& __f, _Args&&... __args); #else // _LIBCPP_HAS_NO_VARIADICS - template <class _F> explicit thread(_F __f); + template <class _Fp> explicit thread(_Fp __f); #endif ~thread(); @@ -322,34 +322,34 @@ __thread_specific_ptr<__thread_struct>& __thread_local_data(); #ifndef _LIBCPP_HAS_NO_VARIADICS -template <class _F, class ..._Args, size_t ..._Indices> +template <class _Fp, class ..._Args, size_t ..._Indices> inline _LIBCPP_INLINE_VISIBILITY void -__threaad_execute(tuple<_F, _Args...>& __t, __tuple_indices<_Indices...>) +__threaad_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>) { __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...); } -template <class _F> +template <class _Fp> void* __thread_proxy(void* __vp) { __thread_local_data().reset(new __thread_struct); - std::unique_ptr<_F> __p(static_cast<_F*>(__vp)); - typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index; + std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp)); + typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index; __threaad_execute(*__p, _Index()); return nullptr; } -template <class _F, class ..._Args, +template <class _Fp, class ..._Args, class > -thread::thread(_F&& __f, _Args&&... __args) +thread::thread(_Fp&& __f, _Args&&... __args) { - typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G; - _VSTD::unique_ptr<_G> __p(new _G(__decay_copy(_VSTD::forward<_F>(__f)), + typedef tuple<typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp; + _VSTD::unique_ptr<_Gp> __p(new _Gp(__decay_copy(_VSTD::forward<_Fp>(__f)), __decay_copy(_VSTD::forward<_Args>(__args))...)); - int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get()); + int __ec = pthread_create(&__t_, 0, &__thread_proxy<_Gp>, __p.get()); if (__ec == 0) __p.release(); else @@ -358,21 +358,21 @@ thread::thread(_F&& __f, _Args&&... __args) #else // _LIBCPP_HAS_NO_VARIADICS -template <class _F> +template <class _Fp> void* __thread_proxy(void* __vp) { __thread_local_data().reset(new __thread_struct); - std::unique_ptr<_F> __p(static_cast<_F*>(__vp)); + std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp)); (*__p)(); return nullptr; } -template <class _F> -thread::thread(_F __f) +template <class _Fp> +thread::thread(_Fp __f) { - std::unique_ptr<_F> __p(new _F(__f)); - int __ec = pthread_create(&__t_, 0, &__thread_proxy<_F>, __p.get()); + std::unique_ptr<_Fp> __p(new _Fp(__f)); + int __ec = pthread_create(&__t_, 0, &__thread_proxy<_Fp>, __p.get()); if (__ec == 0) __p.release(); else diff --git a/libcxx/include/tuple b/libcxx/include/tuple index cc679296678..190567db8e0 100644 --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -359,10 +359,10 @@ struct __all<> static const bool value = true; }; -template <bool _B0, bool ... _B> -struct __all<_B0, _B...> +template <bool _B0, bool ... _Bp> +struct __all<_B0, _Bp...> { - static const bool value = _B0 && __all<_B...>::value; + static const bool value = _B0 && __all<_Bp...>::value; }; // __tuple_impl @@ -577,12 +577,12 @@ public: template <class _Alloc> _LIBCPP_INLINE_VISIBILITY tuple(allocator_arg_t, const _Alloc&, const tuple&) {} - template <class _U> + template <class _Up> _LIBCPP_INLINE_VISIBILITY - tuple(array<_U, 0>) {} - template <class _Alloc, class _U> + tuple(array<_Up, 0>) {} + template <class _Alloc, class _Up> _LIBCPP_INLINE_VISIBILITY - tuple(allocator_arg_t, const _Alloc&, array<_U, 0>) {} + tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) {} _LIBCPP_INLINE_VISIBILITY void swap(tuple&) _NOEXCEPT {} }; @@ -684,14 +684,14 @@ forward_as_tuple(_Tp&&... __t) return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...); } -template <size_t _I> +template <size_t _Ip> struct __tuple_equal { template <class _Tp, class _Up> _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Up& __y) { - return __tuple_equal<_I - 1>()(__x, __y) && get<_I-1>(__x) == get<_I-1>(__y); + return __tuple_equal<_Ip - 1>()(__x, __y) && get<_Ip-1>(__x) == get<_Ip-1>(__y); } }; @@ -722,15 +722,15 @@ operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) return !(__x == __y); } -template <size_t _I> +template <size_t _Ip> struct __tuple_less { template <class _Tp, class _Up> _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Up& __y) { - return __tuple_less<_I-1>()(__x, __y) || - (!__tuple_less<_I-1>()(__y, __x) && get<_I-1>(__x) < get<_I-1>(__y)); + return __tuple_less<_Ip-1>()(__x, __y) || + (!__tuple_less<_Ip-1>()(__y, __x) && get<_Ip-1>(__x) < get<_Ip-1>(__y)); } }; @@ -835,7 +835,7 @@ tuple_cat() return tuple<>(); } -template <class _R, class _Indices, class _Tuple0, class ..._Tuples> +template <class _Rp, class _Indices, class _Tuple0, class ..._Tuples> struct __tuple_cat_return_ref_imp; template <class ..._Types, size_t ..._I0, class _Tuple0> diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 90d56df3743..14fa4c4dbce 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -148,7 +148,7 @@ namespace std _LIBCPP_BEGIN_NAMESPACE_STD -template <bool _B, class _If, class _Then> +template <bool _Bp, class _If, class _Then> struct _LIBCPP_VISIBLE conditional {typedef _If type;}; template <class _If, class _Then> struct _LIBCPP_VISIBLE conditional<false, _If, _Then> {typedef _Then type;}; @@ -1418,215 +1418,215 @@ struct __member_pointer_traits_imp #ifndef _LIBCPP_HAS_NO_VARIADICS -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...), true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> { typedef _Class _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false> { typedef _Class const _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) volatile, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false> { typedef _Class volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const volatile, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false> { typedef _Class const volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; #if __has_feature(cxx_reference_qualified_functions) -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) &, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> { typedef _Class& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false> { typedef _Class const& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) volatile&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false> { typedef _Class volatile& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const volatile&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false> { typedef _Class const volatile& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) &&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false> { typedef _Class&& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const&&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false> { typedef _Class const&& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) volatile&&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false> { typedef _Class volatile&& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class ..._Param> -struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const volatile&&, true, false> +template <class _Rp, class _Class, class ..._Param> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false> { typedef _Class const volatile&& _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; #endif // __has_feature(cxx_reference_qualified_functions) #else // _LIBCPP_HAS_NO_VARIADICS -template <class _R, class _Class> -struct __member_pointer_traits_imp<_R (_Class::*)(), true, false> +template <class _Rp, class _Class> +struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false> { typedef _Class _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0), true, false> +template <class _Rp, class _Class, class _P0> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false> { typedef _Class _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1), true, false> +template <class _Rp, class _Class, class _P0, class _P1> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false> { typedef _Class _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1, class _P2> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2), true, false> +template <class _Rp, class _Class, class _P0, class _P1, class _P2> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false> { typedef _Class _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class> -struct __member_pointer_traits_imp<_R (_Class::*)() const, true, false> +template <class _Rp, class _Class> +struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false> { typedef _Class const _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0) const, true, false> +template <class _Rp, class _Class, class _P0> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false> { typedef _Class const _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1) const, true, false> +template <class _Rp, class _Class, class _P0, class _P1> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false> { typedef _Class const _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1, class _P2> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2) const, true, false> +template <class _Rp, class _Class, class _P0, class _P1, class _P2> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false> { typedef _Class const _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class> -struct __member_pointer_traits_imp<_R (_Class::*)() volatile, true, false> +template <class _Rp, class _Class> +struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false> { typedef _Class volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0) volatile, true, false> +template <class _Rp, class _Class, class _P0> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false> { typedef _Class volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1) volatile, true, false> +template <class _Rp, class _Class, class _P0, class _P1> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false> { typedef _Class volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1, class _P2> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2) volatile, true, false> +template <class _Rp, class _Class, class _P0, class _P1, class _P2> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false> { typedef _Class volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class> -struct __member_pointer_traits_imp<_R (_Class::*)() const volatile, true, false> +template <class _Rp, class _Class> +struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false> { typedef _Class const volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0) const volatile, true, false> +template <class _Rp, class _Class, class _P0> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false> { typedef _Class const volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1) const volatile, true, false> +template <class _Rp, class _Class, class _P0, class _P1> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false> { typedef _Class const volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; -template <class _R, class _Class, class _P0, class _P1, class _P2> -struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2) const volatile, true, false> +template <class _Rp, class _Class, class _P0, class _P1, class _P2> +struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false> { typedef _Class const volatile _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; #endif // _LIBCPP_HAS_NO_VARIADICS -template <class _R, class _Class> -struct __member_pointer_traits_imp<_R _Class::*, false, true> +template <class _Rp, class _Class> +struct __member_pointer_traits_imp<_Rp _Class::*, false, true> { typedef _Class _ClassType; - typedef _R _ReturnType; + typedef _Rp _ReturnType; }; template <class _MP> @@ -1673,21 +1673,21 @@ struct __result_of_mp<_MP, _Tp, true> template <class _MP, class _Tp, bool> struct __result_of_mdp; -template <class _R, class _Class, class _Tp> -struct __result_of_mdp<_R _Class::*, _Tp, false> +template <class _Rp, class _Class, class _Tp> +struct __result_of_mdp<_Rp _Class::*, _Tp, false> { - typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _R>::type&& type; + typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type&& type; }; -template <class _R, class _Class, class _Tp> -struct __result_of_mdp<_R _Class::*, _Tp, true> +template <class _Rp, class _Class, class _Tp> +struct __result_of_mdp<_Rp _Class::*, _Tp, true> { - typedef typename __apply_cv<_Tp, _R>::type&& type; + typedef typename __apply_cv<_Tp, _Rp>::type&& type; }; -template <class _R, class _Class, class _Tp> -struct __result_of_mp<_R _Class::*, _Tp, false> - : public __result_of_mdp<_R _Class::*, _Tp, +template <class _Rp, class _Class, class _Tp> +struct __result_of_mp<_Rp _Class::*, _Tp, false> + : public __result_of_mdp<_Rp _Class::*, _Tp, is_base_of<_Class, typename remove_reference<_Tp>::type>::value> { }; @@ -1758,21 +1758,21 @@ struct __result_of_mp<_MP, _Tp, true> template <class _MP, class _Tp, bool> struct __result_of_mdp; -template <class _R, class _Class, class _Tp> -struct __result_of_mdp<_R _Class::*, _Tp, false> +template <class _Rp, class _Class, class _Tp> +struct __result_of_mdp<_Rp _Class::*, _Tp, false> { - typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _R>::type& type; + typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type& type; }; -template <class _R, class _Class, class _Tp> -struct __result_of_mdp<_R _Class::*, _Tp, true> +template <class _Rp, class _Class, class _Tp> +struct __result_of_mdp<_Rp _Class::*, _Tp, true> { - typedef typename __apply_cv<_Tp, _R>::type& type; + typedef typename __apply_cv<_Tp, _Rp>::type& type; }; -template <class _R, class _Class, class _Tp> -struct __result_of_mp<_R _Class::*, _Tp, false> - : public __result_of_mdp<_R _Class::*, _Tp, +template <class _Rp, class _Class, class _Tp> +struct __result_of_mp<_Rp _Class::*, _Tp, false> + : public __result_of_mdp<_Rp _Class::*, _Tp, is_base_of<_Class, typename remove_reference<_Tp>::type>::value> { }; @@ -1879,8 +1879,8 @@ struct __is_constructible // false, _Tp is not a scalar // function types are not constructible -template <class _R, class... _A1, class... _A2> -struct __is_constructible<false, _R(_A1...), _A2...> +template <class _Rp, class... _A1, class... _A2> +struct __is_constructible<false, _Rp(_A1...), _A2...> : public false_type {}; @@ -1956,22 +1956,22 @@ struct _LIBCPP_VISIBLE is_constructible // Array types are default constructible if their element type // is default constructible -template <class _A, size_t _N> -struct __is_constructible<false, _A[_N]> - : public is_constructible<typename remove_all_extents<_A>::type> +template <class _Ap, size_t _Np> +struct __is_constructible<false, _Ap[_Np]> + : public is_constructible<typename remove_all_extents<_Ap>::type> {}; // Otherwise array types are not constructible by this syntax -template <class _A, size_t _N, class ..._Args> -struct __is_constructible<false, _A[_N], _Args...> +template <class _Ap, size_t _Np, class ..._Args> +struct __is_constructible<false, _Ap[_Np], _Args...> : public false_type {}; // Incomplete array types are not constructible -template <class _A, class ..._Args> -struct __is_constructible<false, _A[], _Args...> +template <class _Ap, class ..._Args> +struct __is_constructible<false, _Ap[], _Args...> : public false_type {}; @@ -2124,35 +2124,35 @@ struct _LIBCPP_VISIBLE is_constructible<_Tp, _A0, __is_construct::__nat> // Array types are default constructible if their element type // is default constructible -template <class _A, size_t _N> -struct __is_constructible0_imp<false, _A[_N]> - : public is_constructible<typename remove_all_extents<_A>::type> +template <class _Ap, size_t _Np> +struct __is_constructible0_imp<false, _Ap[_Np]> + : public is_constructible<typename remove_all_extents<_Ap>::type> {}; -template <class _A, size_t _N, class _A0> -struct __is_constructible1_imp<false, _A[_N], _A0> +template <class _Ap, size_t _Np, class _A0> +struct __is_constructible1_imp<false, _Ap[_Np], _A0> : public false_type {}; -template <class _A, size_t _N, class _A0, class _A1> -struct __is_constructible2_imp<false, _A[_N], _A0, _A1> +template <class _Ap, size_t _Np, class _A0, class _A1> +struct __is_constructible2_imp<false, _Ap[_Np], _A0, _A1> : public false_type {}; // Incomplete array types are not constructible -template <class _A> -struct __is_constructible0_imp<false, _A[]> +template <class _Ap> +struct __is_constructible0_imp<false, _Ap[]> : public false_type {}; -template <class _A, class _A0> -struct __is_constructible1_imp<false, _A[], _A0> +template <class _Ap, class _A0> +struct __is_constructible1_imp<false, _Ap[], _A0> : public false_type {}; -template <class _A, class _A0, class _A1> -struct __is_constructible2_imp<false, _A[], _A0, _A1> +template <class _Ap, class _A0, class _A1> +struct __is_constructible2_imp<false, _Ap[], _A0, _A1> : public false_type {}; @@ -2761,134 +2761,134 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_trivial // Check for complete types -template <class ..._T> struct __check_complete; +template <class ..._Tp> struct __check_complete; template <> struct __check_complete<> { }; -template <class _H, class _T0, class ..._T> -struct __check_complete<_H, _T0, _T...> - : private __check_complete<_H>, - private __check_complete<_T0, _T...> +template <class _Hp, class _T0, class ..._Tp> +struct __check_complete<_Hp, _T0, _Tp...> + : private __check_complete<_Hp>, + private __check_complete<_T0, _Tp...> { }; -template <class _H> -struct __check_complete<_H, _H> - : private __check_complete<_H> +template <class _Hp> +struct __check_complete<_Hp, _Hp> + : private __check_complete<_Hp> { }; -template <class _T> -struct __check_complete<_T> +template <class _Tp> +struct __check_complete<_Tp> { - static_assert(sizeof(_T) > 0, "Type must be complete."); + static_assert(sizeof(_Tp) > 0, "Type must be complete."); }; -template <class _T> -struct __check_complete<_T&> - : private __check_complete<_T> +template <class _Tp> +struct __check_complete<_Tp&> + : private __check_complete<_Tp> { }; -template <class _T> -struct __check_complete<_T&&> - : private __check_complete<_T> +template <class _Tp> +struct __check_complete<_Tp&&> + : private __check_complete<_Tp> { }; -template <class _R, class ..._Param> -struct __check_complete<_R (*)(_Param...)> +template <class _Rp, class ..._Param> +struct __check_complete<_Rp (*)(_Param...)> : private __check_complete<_Param...> { }; -template <class _R, class ..._Param> -struct __check_complete<_R (_Param...)> +template <class _Rp, class ..._Param> +struct __check_complete<_Rp (_Param...)> : private __check_complete<_Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...)> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...)> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) const> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) const> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) volatile> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) volatile> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) const volatile> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) const volatile> : private __check_complete<_Class, _Param...> { }; #if __has_feature(cxx_reference_qualified_functions) -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) &> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) &> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) const&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) const&> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) volatile&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) volatile&> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) const volatile&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) &&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) &&> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) const&&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) const&&> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) volatile&&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&> : private __check_complete<_Class, _Param...> { }; -template <class _R, class _Class, class ..._Param> -struct __check_complete<_R (_Class::*)(_Param...) const volatile&&> +template <class _Rp, class _Class, class ..._Param> +struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&> : private __check_complete<_Class, _Param...> { }; #endif -template <class _R, class _Class> -struct __check_complete<_R _Class::*> +template <class _Rp, class _Class> +struct __check_complete<_Rp _Class::*> : private __check_complete<_Class> { }; @@ -2904,70 +2904,70 @@ __invoke(__any, _Args&& ...__args) // bullets 1 and 2 -template <class _F, class _A0, class ..._Args> +template <class _Fp, class _A0, class ..._Args> auto -__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)); -template <class _F, class _A0, class ..._Args> +template <class _Fp, class _A0, class ..._Args> auto -__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)); // bullets 3 and 4 -template <class _F, class _A0> +template <class _Fp, class _A0> auto -__invoke(_F&& __f, _A0&& __a0) +__invoke(_Fp&& __f, _A0&& __a0) -> decltype(_VSTD::forward<_A0>(__a0).*__f); -template <class _F, class _A0> +template <class _Fp, class _A0> auto -__invoke(_F&& __f, _A0&& __a0) +__invoke(_Fp&& __f, _A0&& __a0) -> decltype((*_VSTD::forward<_A0>(__a0)).*__f); // bullet 5 -template <class _F, class ..._Args> +template <class _Fp, class ..._Args> auto -__invoke(_F&& __f, _Args&& ...__args) - -> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...)); +__invoke(_Fp&& __f, _Args&& ...__args) + -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)); // __invokable -template <class _F, class ..._Args> +template <class _Fp, class ..._Args> struct __invokable_imp - : private __check_complete<_F, _Args...> + : private __check_complete<_Fp, _Args...> { typedef decltype( - __invoke(_VSTD::declval<_F>(), _VSTD::declval<_Args>()...) + __invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...) ) type; static const bool value = !is_same<type, __nat>::value; }; -template <class _F, class ..._Args> +template <class _Fp, class ..._Args> struct __invokable : public integral_constant<bool, - __invokable_imp<_F, _Args...>::value> + __invokable_imp<_Fp, _Args...>::value> { }; // __invoke_of -template <bool _Invokable, class _F, class ..._Args> +template <bool _Invokable, class _Fp, class ..._Args> struct __invoke_of_imp // false { }; -template <class _F, class ..._Args> -struct __invoke_of_imp<true, _F, _Args...> +template <class _Fp, class ..._Args> +struct __invoke_of_imp<true, _Fp, _Args...> { - typedef typename __invokable_imp<_F, _Args...>::type type; + typedef typename __invokable_imp<_Fp, _Args...>::type type; }; -template <class _F, class ..._Args> +template <class _Fp, class ..._Args> struct __invoke_of - : public __invoke_of_imp<__invokable<_F, _Args...>::value, _F, _Args...> + : public __invoke_of_imp<__invokable<_Fp, _Args...>::value, _Fp, _Args...> { }; diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index 56645e09b92..0862e3fe0a3 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -644,8 +644,8 @@ private: typedef typename __table::__node_traits __node_traits; typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node __node; - typedef __hash_map_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __hash_map_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; typedef allocator_traits<allocator_type> __alloc_traits; public: typedef typename __alloc_traits::pointer pointer; @@ -776,21 +776,21 @@ public: pair<iterator, bool> insert(const value_type& __x) {return __table_.__insert_unique(__x);} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - pair<iterator, bool> insert(_P&& __x) - {return __table_.__insert_unique(_VSTD::forward<_P>(__x));} + pair<iterator, bool> insert(_Pp&& __x) + {return __table_.__insert_unique(_VSTD::forward<_Pp>(__x));} #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator, _P&& __x) - {return insert(_VSTD::forward<_P>(__x)).first;} + iterator insert(const_iterator, _Pp&& __x) + {return insert(_VSTD::forward<_Pp>(__x)).first;} #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _InputIterator> void insert(_InputIterator __first, _InputIterator __last); @@ -1065,7 +1065,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0, _Args&&... __args) { __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; @@ -1085,7 +1085,7 @@ typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0) { __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; @@ -1118,7 +1118,7 @@ typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k) { __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k); __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); @@ -1266,8 +1266,8 @@ private: typedef typename __table::__node_traits __node_traits; typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node __node; - typedef __hash_map_node_destructor<__node_allocator> _D; - typedef unique_ptr<__node, _D> __node_holder; + typedef __hash_map_node_destructor<__node_allocator> _Dp; + typedef unique_ptr<__node, _Dp> __node_holder; typedef allocator_traits<allocator_type> __alloc_traits; public: typedef typename __alloc_traits::pointer pointer; @@ -1395,21 +1395,21 @@ public: _LIBCPP_INLINE_VISIBILITY iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - iterator insert(_P&& __x) - {return __table_.__insert_multi(_VSTD::forward<_P>(__x));} + iterator insert(_Pp&& __x) + {return __table_.__insert_multi(_VSTD::forward<_Pp>(__x));} #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, const value_type& __x) {return __table_.__insert_multi(__p.__i_, __x);} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _P, - class = typename enable_if<is_constructible<value_type, _P>::value>::type> + template <class _Pp, + class = typename enable_if<is_constructible<value_type, _Pp>::value>::type> _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __p, _P&& __x) - {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_P>(__x));} + iterator insert(const_iterator __p, _Pp&& __x) + {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_Pp>(__x));} #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _InputIterator> void insert(_InputIterator __first, _InputIterator __last); @@ -1675,7 +1675,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node( _A0&& __a0, _Args&&... __args) { __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; @@ -1695,7 +1695,7 @@ typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0) { __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _D(__na)); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0)); __h.get_deleter().__first_constructed = true; diff --git a/libcxx/include/utility b/libcxx/include/utility index dd9ff33d712..2efea28435a 100644 --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -180,12 +180,12 @@ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardItera return __first2; } -template<class _Tp, size_t _N> +template<class _Tp, size_t _Np> inline _LIBCPP_INLINE_VISIBILITY void -swap(_Tp (&__a)[_N], _Tp (&__b)[_N]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) +swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - _VSTD::swap_ranges(__a, __a + _N, __b); + _VSTD::swap_ranges(__a, __a + _Np, __b); } template <class _Tp> diff --git a/libcxx/include/valarray b/libcxx/include/valarray index 3ac9494120f..fff3ce129be 100644 --- a/libcxx/include/valarray +++ b/libcxx/include/valarray @@ -495,14 +495,14 @@ struct __bit_shift_right : binary_function<_Tp, _Tp, _Tp> {return __x >> __y;} }; -template <class _Tp, class _F> +template <class _Tp, class _Fp> struct __apply_expr : unary_function<_Tp, _Tp> { private: - _F __f_; + _Fp __f_; public: _LIBCPP_INLINE_VISIBILITY - explicit __apply_expr(_F __f) : __f_(__f) {} + explicit __apply_expr(_Fp __f) : __f_(__f) {} _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const @@ -690,7 +690,7 @@ private: ptrdiff_t __ul_; ptrdiff_t __sn_; ptrdiff_t __n_; - static const ptrdiff_t _N = static_cast<ptrdiff_t>( + static const ptrdiff_t _Np = static_cast<ptrdiff_t>( sizeof(ptrdiff_t) * __CHAR_BIT__ - 1); _LIBCPP_INLINE_VISIBILITY @@ -699,8 +699,8 @@ private: __size_(__e.size()), __n_(__n) { - ptrdiff_t __neg_n = static_cast<ptrdiff_t>(__n_ >> _N); - __sn_ = __neg_n | static_cast<ptrdiff_t>(static_cast<size_t>(-__n_) >> _N); + ptrdiff_t __neg_n = static_cast<ptrdiff_t>(__n_ >> _Np); + __sn_ = __neg_n | static_cast<ptrdiff_t>(static_cast<size_t>(-__n_) >> _Np); __ul_ = ((__size_ - __n_) & ~__neg_n) | ((__n_ + 1) & __neg_n); } public: @@ -709,7 +709,7 @@ public: result_type operator[](size_t __j) const { ptrdiff_t __i = static_cast<size_t>(__j); - ptrdiff_t __m = (__sn_ * __i - __ul_) >> _N; + ptrdiff_t __m = (__sn_ * __i - __ul_) >> _Np; return (__expr_[(__i + __n_) & __m] & __m) | (value_type() & ~__m); } diff --git a/libcxx/include/vector b/libcxx/include/vector index 10702f3c870..1fb6f591971 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -1146,8 +1146,8 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a) } else { - typedef move_iterator<iterator> _I; - assign(_I(__x.begin()), _I(__x.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__x.begin()), _Ip(__x.end())); } } @@ -1203,8 +1203,8 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type) { if (__base::__alloc() != __c.__alloc()) { - typedef move_iterator<iterator> _I; - assign(_I(__c.begin()), _I(__c.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__c.begin()), _Ip(__c.end())); } else __move_assign(__c, true_type()); |