Further macro protection by replacing _[A-Z] with _[A-Z]p

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2011-11-29 18:15:50 +00:00
parent 66c6f9733b
commit 9996844df0
38 changed files with 2831 additions and 2831 deletions

View File

@ -22,8 +22,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD
template <class _C, bool _IsConst> class __bit_iterator; template <class _Cp, bool _IsConst> class __bit_iterator;
template <class _C> class __bit_const_reference; template <class _Cp> class __bit_const_reference;
template <class _Tp> template <class _Tp>
struct __has_storage_type struct __has_storage_type
@ -31,22 +31,22 @@ struct __has_storage_type
static const bool value = false; 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 class __bit_reference
{ {
typedef typename _C::__storage_type __storage_type; typedef typename _Cp::__storage_type __storage_type;
typedef typename _C::__storage_pointer __storage_pointer; typedef typename _Cp::__storage_pointer __storage_pointer;
__storage_pointer __seg_; __storage_pointer __seg_;
__storage_type __mask_; __storage_type __mask_;
#if defined(__clang__) #if defined(__clang__)
friend typename _C::__self; friend typename _Cp::__self;
#else #else
friend class _C::__self; friend class _Cp::__self;
#endif #endif
friend class __bit_const_reference<_C>; friend class __bit_const_reference<_Cp>;
friend class __bit_iterator<_C, false>; friend class __bit_iterator<_Cp, false>;
public: public:
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
{return static_cast<bool>(*__seg_ & __mask_);} {return static_cast<bool>(*__seg_ & __mask_);}
@ -68,74 +68,74 @@ public:
{return operator=(static_cast<bool>(__x));} {return operator=(static_cast<bool>(__x));}
_LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;} _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const _NOEXCEPT
{return __bit_iterator<_C, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
private: private:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
__bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
: __seg_(__s), __mask_(__m) {} : __seg_(__s), __mask_(__m) {}
}; };
template <class _C> template <class _Cp>
class __bit_reference<_C, false> class __bit_reference<_Cp, false>
{ {
}; };
template <class _C, class _D> template <class _Cp, class _Dp>
_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY inline
void void
swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT
{ {
bool __t = __x; bool __t = __x;
__x = __y; __x = __y;
__y = __t; __y = __t;
} }
template <class _C> template <class _Cp>
_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY inline
void void
swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT
{ {
bool __t = __x; bool __t = __x;
__x = __y; __x = __y;
__y = __t; __y = __t;
} }
template <class _C> template <class _Cp>
_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY inline
void void
swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT swap(bool& __x, __bit_reference<_Cp> __y) _NOEXCEPT
{ {
bool __t = __x; bool __t = __x;
__x = __y; __x = __y;
__y = __t; __y = __t;
} }
template <class _C> template <class _Cp>
class __bit_const_reference class __bit_const_reference
{ {
typedef typename _C::__storage_type __storage_type; typedef typename _Cp::__storage_type __storage_type;
typedef typename _C::__const_storage_pointer __storage_pointer; typedef typename _Cp::__const_storage_pointer __storage_pointer;
__storage_pointer __seg_; __storage_pointer __seg_;
__storage_type __mask_; __storage_type __mask_;
#if defined(__clang__) #if defined(__clang__)
friend typename _C::__self; friend typename _Cp::__self;
#else #else
friend class _C::__self; friend class _Cp::__self;
#endif #endif
friend class __bit_iterator<_C, true>; friend class __bit_iterator<_Cp, true>;
public: public:
_LIBCPP_INLINE_VISIBILITY _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_) {} : __seg_(__x.__seg_), __mask_(__x.__mask_) {}
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
{return static_cast<bool>(*__seg_ & __mask_);} {return static_cast<bool>(*__seg_ & __mask_);}
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
{return __bit_iterator<_C, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
private: private:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
__bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
@ -146,11 +146,11 @@ private:
// find // find
template <class _C> template <class _Cp>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
__find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) __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; typedef typename _It::__storage_type __storage_type;
static const unsigned __bits_per_word = _It::__bits_per_word; static const unsigned __bits_per_word = _It::__bits_per_word;
// do first partial 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)); return _It(__first.__seg_, static_cast<unsigned>(__n));
} }
template <class _C> template <class _Cp>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
__find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) __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; typedef typename _It::__storage_type __storage_type;
static const unsigned __bits_per_word = _It::__bits_per_word; static const unsigned __bits_per_word = _It::__bits_per_word;
// do first partial 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)); return _It(__first.__seg_, static_cast<unsigned>(__n));
} }
template <class _C, class _Tp> template <class _Cp, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
find(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) find(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_)
{ {
if (static_cast<bool>(__value_)) if (static_cast<bool>(__value_))
return __find_bool_true(__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 _C::size_type>(__last - __first)); return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
} }
// count // count
template <class _C> template <class _Cp>
typename __bit_iterator<_C, false>::difference_type typename __bit_iterator<_Cp, false>::difference_type
__count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) __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::__storage_type __storage_type;
typedef typename _It::difference_type difference_type; typedef typename _It::difference_type difference_type;
static const unsigned __bits_per_word = _It::__bits_per_word; 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; return __r;
} }
template <class _C> template <class _Cp>
typename __bit_iterator<_C, false>::difference_type typename __bit_iterator<_Cp, false>::difference_type
__count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) __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::__storage_type __storage_type;
typedef typename _It::difference_type difference_type; typedef typename _It::difference_type difference_type;
static const unsigned __bits_per_word = _It::__bits_per_word; 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; return __r;
} }
template <class _C, class _Tp> template <class _Cp, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
typename __bit_iterator<_C, false>::difference_type typename __bit_iterator<_Cp, false>::difference_type
count(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) count(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_)
{ {
if (static_cast<bool>(__value_)) if (static_cast<bool>(__value_))
return __count_bool_true(__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 _C::size_type>(__last - __first)); return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
} }
// fill_n // fill_n
template <class _C> template <class _Cp>
void 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; typedef typename _It::__storage_type __storage_type;
static const unsigned __bits_per_word = _It::__bits_per_word; static const unsigned __bits_per_word = _It::__bits_per_word;
// do first partial 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 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; typedef typename _It::__storage_type __storage_type;
static const unsigned __bits_per_word = _It::__bits_per_word; static const unsigned __bits_per_word = _It::__bits_per_word;
// do first partial 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 _LIBCPP_INLINE_VISIBILITY inline
void 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) if (__n > 0)
{ {
@ -379,22 +379,22 @@ fill_n(__bit_iterator<_C, false> __first, typename _C::size_type __n, bool __val
// fill // fill
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
void 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 // copy
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
__copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
__bit_iterator<_C, false> __result) __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::difference_type difference_type;
typedef typename _In::__storage_type __storage_type; typedef typename _In::__storage_type __storage_type;
static const unsigned __bits_per_word = _In::__bits_per_word; 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; return __result;
} }
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
__copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
__bit_iterator<_C, false> __result) __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::difference_type difference_type;
typedef typename _In::__storage_type __storage_type; typedef typename _In::__storage_type __storage_type;
static const unsigned __bits_per_word = _In::__bits_per_word; 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; return __result;
} }
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
copy(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
{ {
if (__first.__ctz_ == __result.__ctz_) if (__first.__ctz_ == __result.__ctz_)
return __copy_aligned(__first, __last, __result); return __copy_aligned(__first, __last, __result);
@ -526,12 +526,12 @@ copy(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last,
// copy_backward // copy_backward
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
__copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
__bit_iterator<_C, false> __result) __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::difference_type difference_type;
typedef typename _In::__storage_type __storage_type; typedef typename _In::__storage_type __storage_type;
static const unsigned __bits_per_word = _In::__bits_per_word; 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; return __result;
} }
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
__copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
__bit_iterator<_C, false> __result) __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::difference_type difference_type;
typedef typename _In::__storage_type __storage_type; typedef typename _In::__storage_type __storage_type;
static const unsigned __bits_per_word = _In::__bits_per_word; 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; return __result;
} }
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
copy_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
{ {
if (__last.__ctz_ == __result.__ctz_) if (__last.__ctz_ == __result.__ctz_)
return __copy_backward_aligned(__first, __last, __result); return __copy_backward_aligned(__first, __last, __result);
@ -671,20 +671,20 @@ copy_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst>
// move // move
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
{ {
return _VSTD::copy(__first, __last, __result); return _VSTD::copy(__first, __last, __result);
} }
// move_backward // move_backward
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
{ {
return _VSTD::copy(__first, __last, __result); return _VSTD::copy(__first, __last, __result);
} }
@ -854,31 +854,31 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __
// rotate // rotate
template <class _C> template <class _Cp>
struct __bit_array struct __bit_array
{ {
typedef typename _C::difference_type difference_type; typedef typename _Cp::difference_type difference_type;
typedef typename _C::__storage_type __storage_type; typedef typename _Cp::__storage_type __storage_type;
typedef typename _C::iterator iterator; typedef typename _Cp::iterator iterator;
static const unsigned __bits_per_word = _C::__bits_per_word; static const unsigned __bits_per_word = _Cp::__bits_per_word;
static const unsigned _N = 4; static const unsigned _Np = 4;
difference_type __size_; difference_type __size_;
__storage_type __word_[_N]; __storage_type __word_[_Np];
_LIBCPP_INLINE_VISIBILITY static difference_type capacity() _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 explicit __bit_array(difference_type __s) : __size_(__s) {}
_LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);} _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);}
_LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__word_ + __size_ / __bits_per_word, _LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__word_ + __size_ / __bits_per_word,
static_cast<unsigned>(__size_ % __bits_per_word));} static_cast<unsigned>(__size_ % __bits_per_word));}
}; };
template <class _C> template <class _Cp>
__bit_iterator<_C, false> __bit_iterator<_Cp, false>
rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __bit_iterator<_C, false> __last) 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::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type; typedef typename _I1::__storage_type __storage_type;
static const unsigned __bits_per_word = _I1::__bits_per_word; 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 <= __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(__first, __middle, __b.begin());
_VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first)); _VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first));
break; break;
} }
else 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; __first = __middle;
__middle = __mp; __middle = __mp;
__d2 -= __d1; __d2 -= __d1;
@ -906,16 +906,16 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __
} }
else 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(__middle, __last, __b.begin());
_VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last)); _VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last));
break; break;
} }
else else
{ {
__bit_iterator<_C, false> __mp = __first + __d2; __bit_iterator<_Cp, false> __mp = __first + __d2;
_VSTD::swap_ranges(__first, __mp, __middle); _VSTD::swap_ranges(__first, __mp, __middle);
__first = __mp; __first = __mp;
__d1 -= __d2; __d1 -= __d2;
@ -927,12 +927,12 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __
// equal // equal
template <class _C> template <class _Cp>
bool bool
__equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __last1, __equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1,
__bit_iterator<_C, true> __first2) __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::difference_type difference_type;
typedef typename _It::__storage_type __storage_type; typedef typename _It::__storage_type __storage_type;
static const unsigned __bits_per_word = _It::__bits_per_word; 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; return true;
} }
template <class _C> template <class _Cp>
bool bool
__equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __last1, __equal_aligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1,
__bit_iterator<_C, true> __first2) __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::difference_type difference_type;
typedef typename _It::__storage_type __storage_type; typedef typename _It::__storage_type __storage_type;
static const unsigned __bits_per_word = _It::__bits_per_word; 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; return true;
} }
template <class _C, bool _IC1, bool _IC2> template <class _Cp, bool _IC1, bool _IC2>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
bool 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_) if (__first1.__ctz_ == __first2.__ctz_)
return __equal_aligned(__first1, __last1, __first2); return __equal_aligned(__first1, __last1, __first2);
return __equal_unaligned(__first1, __last1, __first2); return __equal_unaligned(__first1, __last1, __first2);
} }
template <class _C, bool _IsConst> template <class _Cp, bool _IsConst>
class __bit_iterator class __bit_iterator
{ {
public: public:
typedef typename _C::difference_type difference_type; typedef typename _Cp::difference_type difference_type;
typedef bool value_type; typedef bool value_type;
typedef __bit_iterator pointer; 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; typedef random_access_iterator_tag iterator_category;
private: private:
typedef typename _C::__storage_type __storage_type; typedef typename _Cp::__storage_type __storage_type;
typedef typename conditional<_IsConst, typename _C::__const_storage_pointer, typedef typename conditional<_IsConst, typename _Cp::__const_storage_pointer,
typename _C::__storage_pointer>::type __storage_pointer; typename _Cp::__storage_pointer>::type __storage_pointer;
static const unsigned __bits_per_word = _C::__bits_per_word; static const unsigned __bits_per_word = _Cp::__bits_per_word;
__storage_pointer __seg_; __storage_pointer __seg_;
unsigned __ctz_; unsigned __ctz_;
@ -1081,7 +1081,7 @@ public:
_LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {} _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {}
_LIBCPP_INLINE_VISIBILITY _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_) {} : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
@ -1189,34 +1189,34 @@ private:
: __seg_(__s), __ctz_(__ctz) {} : __seg_(__s), __ctz_(__ctz) {}
#if defined(__clang__) #if defined(__clang__)
friend typename _C::__self; friend typename _Cp::__self;
#else #else
friend class _C::__self; friend class _Cp::__self;
#endif #endif
friend class __bit_reference<_C>; friend class __bit_reference<_Cp>;
friend class __bit_const_reference<_C>; friend class __bit_const_reference<_Cp>;
friend class __bit_iterator<_C, true>; friend class __bit_iterator<_Cp, true>;
template <class _D> friend struct __bit_array; template <class _Dp> friend struct __bit_array;
template <class _D> friend void __fill_n_false(__bit_iterator<_D, false> __first, typename _D::size_type __n); template <class _Dp> friend void __fill_n_false(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
template <class _D> friend void __fill_n_true(__bit_iterator<_D, false> __first, typename _D::size_type __n); template <class _Dp> friend void __fill_n_true(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_aligned(__bit_iterator<_D, _IC> __first, template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_aligned(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_D, _IC> __last, __bit_iterator<_Dp, _IC> __last,
__bit_iterator<_D, false> __result); __bit_iterator<_Dp, false> __result);
template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_unaligned(__bit_iterator<_D, _IC> __first, template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_unaligned(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_D, _IC> __last, __bit_iterator<_Dp, _IC> __last,
__bit_iterator<_D, false> __result); __bit_iterator<_Dp, false> __result);
template <class _D, bool _IC> friend __bit_iterator<_D, false> copy(__bit_iterator<_D, _IC> __first, template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_D, _IC> __last, __bit_iterator<_Dp, _IC> __last,
__bit_iterator<_D, false> __result); __bit_iterator<_Dp, false> __result);
template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_backward_aligned(__bit_iterator<_D, _IC> __first, template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_aligned(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_D, _IC> __last, __bit_iterator<_Dp, _IC> __last,
__bit_iterator<_D, false> __result); __bit_iterator<_Dp, false> __result);
template <class _D, bool _IC> friend __bit_iterator<_D, false> __copy_backward_unaligned(__bit_iterator<_D, _IC> __first, template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> __copy_backward_unaligned(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_D, _IC> __last, __bit_iterator<_Dp, _IC> __last,
__bit_iterator<_D, false> __result); __bit_iterator<_Dp, false> __result);
template <class _D, bool _IC> friend __bit_iterator<_D, false> copy_backward(__bit_iterator<_D, _IC> __first, template <class _Dp, bool _IC> friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first,
__bit_iterator<_D, _IC> __last, __bit_iterator<_Dp, _IC> __last,
__bit_iterator<_D, false> __result); __bit_iterator<_Dp, false> __result);
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>, template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>,
__bit_iterator<__C1, false>, __bit_iterator<__C1, false>,
__bit_iterator<__C2, 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>, template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>,
__bit_iterator<__C1, false>, __bit_iterator<__C1, false>,
__bit_iterator<__C2, false>); __bit_iterator<__C2, false>);
template <class _D> friend __bit_iterator<_D, false> rotate(__bit_iterator<_D, false>, template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
__bit_iterator<_D, false>, __bit_iterator<_Dp, false>,
__bit_iterator<_D, false>); __bit_iterator<_Dp, false>);
template <class _D> friend bool __equal_aligned(__bit_iterator<_D, true>, template <class _Dp> friend bool __equal_aligned(__bit_iterator<_Dp, true>,
__bit_iterator<_D, true>, __bit_iterator<_Dp, true>,
__bit_iterator<_D, true>); __bit_iterator<_Dp, true>);
template <class _D> friend bool __equal_unaligned(__bit_iterator<_D, true>, template <class _Dp> friend bool __equal_unaligned(__bit_iterator<_Dp, true>,
__bit_iterator<_D, true>, __bit_iterator<_Dp, true>,
__bit_iterator<_D, true>); __bit_iterator<_Dp, true>);
template <class _D, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_D, _IC1>, template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>,
__bit_iterator<_D, _IC1>, __bit_iterator<_Dp, _IC1>,
__bit_iterator<_D, _IC2>); __bit_iterator<_Dp, _IC2>);
template <class _D> friend __bit_iterator<_D, false> __find_bool_true(__bit_iterator<_D, false>, template <class _Dp> friend __bit_iterator<_Dp, false> __find_bool_true(__bit_iterator<_Dp, false>,
typename _D::size_type); typename _Dp::size_type);
template <class _D> friend __bit_iterator<_D, false> __find_bool_false(__bit_iterator<_D, false>, template <class _Dp> friend __bit_iterator<_Dp, false> __find_bool_false(__bit_iterator<_Dp, false>,
typename _D::size_type); typename _Dp::size_type);
}; };
_LIBCPP_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD

View File

@ -83,8 +83,8 @@ _C_node<_Cont>::__dereferenceable(const void* __i) const
{ {
typedef typename _Cont::const_iterator iterator; typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i); const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _C = static_cast<_Cont*>(__c_); _Cont* _Cp = static_cast<_Cont*>(__c_);
return _C->__dereferenceable(__j); return _Cp->__dereferenceable(__j);
} }
template <class _Cont> template <class _Cont>
@ -93,8 +93,8 @@ _C_node<_Cont>::__decrementable(const void* __i) const
{ {
typedef typename _Cont::const_iterator iterator; typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i); const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _C = static_cast<_Cont*>(__c_); _Cont* _Cp = static_cast<_Cont*>(__c_);
return _C->__decrementable(__j); return _Cp->__decrementable(__j);
} }
template <class _Cont> template <class _Cont>
@ -103,8 +103,8 @@ _C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
{ {
typedef typename _Cont::const_iterator iterator; typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i); const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _C = static_cast<_Cont*>(__c_); _Cont* _Cp = static_cast<_Cont*>(__c_);
return _C->__addable(__j, __n); return _Cp->__addable(__j, __n);
} }
template <class _Cont> template <class _Cont>
@ -113,8 +113,8 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
{ {
typedef typename _Cont::const_iterator iterator; typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i); const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _C = static_cast<_Cont*>(__c_); _Cont* _Cp = static_cast<_Cont*>(__c_);
return _C->__subscriptable(__j, __n); return _Cp->__subscriptable(__j, __n);
} }
class _LIBCPP_VISIBLE __libcpp_db class _LIBCPP_VISIBLE __libcpp_db

File diff suppressed because it is too large Load Diff

View File

@ -64,9 +64,9 @@ struct __derives_from_unary_function
private: private:
struct __two {char _; char __;}; struct __two {char _; char __;};
static __two __test(...); static __two __test(...);
template <class _A, class _R> template <class _Ap, class _Rp>
static unary_function<_A, _R> static unary_function<_Ap, _Rp>
__test(const volatile unary_function<_A, _R>*); __test(const volatile unary_function<_Ap, _Rp>*);
public: public:
static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
typedef decltype(__test((_Tp*)0)) type; typedef decltype(__test((_Tp*)0)) type;
@ -78,9 +78,9 @@ struct __derives_from_binary_function
private: private:
struct __two {char _; char __;}; struct __two {char _; char __;};
static __two __test(...); static __two __test(...);
template <class _A1, class _A2, class _R> template <class _A1, class _A2, class _Rp>
static binary_function<_A1, _A2, _R> static binary_function<_A1, _A2, _Rp>
__test(const volatile binary_function<_A1, _A2, _R>*); __test(const volatile binary_function<_A1, _A2, _Rp>*);
public: public:
static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
typedef decltype(__test((_Tp*)0)) type; typedef decltype(__test((_Tp*)0)) type;
@ -131,173 +131,173 @@ struct __weak_result_type
// 0 argument case // 0 argument case
template <class _R> template <class _Rp>
struct __weak_result_type<_R ()> struct __weak_result_type<_Rp ()>
{ {
typedef _R result_type; typedef _Rp result_type;
}; };
template <class _R> template <class _Rp>
struct __weak_result_type<_R (&)()> struct __weak_result_type<_Rp (&)()>
{ {
typedef _R result_type; typedef _Rp result_type;
}; };
template <class _R> template <class _Rp>
struct __weak_result_type<_R (*)()> struct __weak_result_type<_Rp (*)()>
{ {
typedef _R result_type; typedef _Rp result_type;
}; };
// 1 argument case // 1 argument case
template <class _R, class _A1> template <class _Rp, class _A1>
struct __weak_result_type<_R (_A1)> struct __weak_result_type<_Rp (_A1)>
: public unary_function<_A1, _R> : public unary_function<_A1, _Rp>
{ {
}; };
template <class _R, class _A1> template <class _Rp, class _A1>
struct __weak_result_type<_R (&)(_A1)> struct __weak_result_type<_Rp (&)(_A1)>
: public unary_function<_A1, _R> : public unary_function<_A1, _Rp>
{ {
}; };
template <class _R, class _A1> template <class _Rp, class _A1>
struct __weak_result_type<_R (*)(_A1)> struct __weak_result_type<_Rp (*)(_A1)>
: public unary_function<_A1, _R> : public unary_function<_A1, _Rp>
{ {
}; };
template <class _R, class _C> template <class _Rp, class _Cp>
struct __weak_result_type<_R (_C::*)()> struct __weak_result_type<_Rp (_Cp::*)()>
: public unary_function<_C*, _R> : public unary_function<_Cp*, _Rp>
{ {
}; };
template <class _R, class _C> template <class _Rp, class _Cp>
struct __weak_result_type<_R (_C::*)() const> struct __weak_result_type<_Rp (_Cp::*)() const>
: public unary_function<const _C*, _R> : public unary_function<const _Cp*, _Rp>
{ {
}; };
template <class _R, class _C> template <class _Rp, class _Cp>
struct __weak_result_type<_R (_C::*)() volatile> struct __weak_result_type<_Rp (_Cp::*)() volatile>
: public unary_function<volatile _C*, _R> : public unary_function<volatile _Cp*, _Rp>
{ {
}; };
template <class _R, class _C> template <class _Rp, class _Cp>
struct __weak_result_type<_R (_C::*)() const volatile> struct __weak_result_type<_Rp (_Cp::*)() const volatile>
: public unary_function<const volatile _C*, _R> : public unary_function<const volatile _Cp*, _Rp>
{ {
}; };
// 2 argument case // 2 argument case
template <class _R, class _A1, class _A2> template <class _Rp, class _A1, class _A2>
struct __weak_result_type<_R (_A1, _A2)> struct __weak_result_type<_Rp (_A1, _A2)>
: public binary_function<_A1, _A2, _R> : public binary_function<_A1, _A2, _Rp>
{ {
}; };
template <class _R, class _A1, class _A2> template <class _Rp, class _A1, class _A2>
struct __weak_result_type<_R (*)(_A1, _A2)> struct __weak_result_type<_Rp (*)(_A1, _A2)>
: public binary_function<_A1, _A2, _R> : public binary_function<_A1, _A2, _Rp>
{ {
}; };
template <class _R, class _A1, class _A2> template <class _Rp, class _A1, class _A2>
struct __weak_result_type<_R (&)(_A1, _A2)> struct __weak_result_type<_Rp (&)(_A1, _A2)>
: public binary_function<_A1, _A2, _R> : public binary_function<_A1, _A2, _Rp>
{ {
}; };
template <class _R, class _C, class _A1> template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_R (_C::*)(_A1)> struct __weak_result_type<_Rp (_Cp::*)(_A1)>
: public binary_function<_C*, _A1, _R> : public binary_function<_Cp*, _A1, _Rp>
{ {
}; };
template <class _R, class _C, class _A1> template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_R (_C::*)(_A1) const> struct __weak_result_type<_Rp (_Cp::*)(_A1) const>
: public binary_function<const _C*, _A1, _R> : public binary_function<const _Cp*, _A1, _Rp>
{ {
}; };
template <class _R, class _C, class _A1> template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_R (_C::*)(_A1) volatile> struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile>
: public binary_function<volatile _C*, _A1, _R> : public binary_function<volatile _Cp*, _A1, _Rp>
{ {
}; };
template <class _R, class _C, class _A1> template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_R (_C::*)(_A1) const volatile> struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
: public binary_function<const volatile _C*, _A1, _R> : public binary_function<const volatile _Cp*, _A1, _Rp>
{ {
}; };
// 3 or more arguments // 3 or more arguments
template <class _R, class _A1, class _A2, class _A3, class ..._A4> template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
struct __weak_result_type<_R (_A1, _A2, _A3, _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> template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
struct __weak_result_type<_R (&)(_A1, _A2, _A3, _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> template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
struct __weak_result_type<_R (*)(_A1, _A2, _A3, _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> template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
struct __weak_result_type<_R (_C::*)(_A1, _A2, _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> template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const> 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> template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) volatile> 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> template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile> struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
{ {
typedef _R result_type; typedef _Rp result_type;
}; };
// __invoke // __invoke
// bullets 1 and 2 // bullets 1 and 2
template <class _F, class _A0, class ..._Args> template <class _Fp, class _A0, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto 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)...)) -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
{ {
return (_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 inline _LIBCPP_INLINE_VISIBILITY
auto 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)...)) -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
{ {
return ((*_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 // bullets 3 and 4
template <class _F, class _A0> template <class _Fp, class _A0>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto auto
__invoke(_F&& __f, _A0&& __a0) __invoke(_Fp&& __f, _A0&& __a0)
-> decltype(_VSTD::forward<_A0>(__a0).*__f) -> decltype(_VSTD::forward<_A0>(__a0).*__f)
{ {
return _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 inline _LIBCPP_INLINE_VISIBILITY
auto auto
__invoke(_F&& __f, _A0&& __a0) __invoke(_Fp&& __f, _A0&& __a0)
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f) -> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
{ {
return (*_VSTD::forward<_A0>(__a0)).*__f; return (*_VSTD::forward<_A0>(__a0)).*__f;
@ -325,13 +325,13 @@ __invoke(_F&& __f, _A0&& __a0)
// bullet 5 // bullet 5
template <class _F, class ..._Args> template <class _Fp, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto auto
__invoke(_F&& __f, _Args&& ...__args) __invoke(_Fp&& __f, _Args&& ...__args)
-> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_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> template <class _Tp, class ..._Args>

File diff suppressed because it is too large Load Diff

View File

@ -604,15 +604,15 @@ public:
pair<iterator, bool> __insert_unique(const value_type& __x); pair<iterator, bool> __insert_unique(const value_type& __x);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P> template <class _Pp>
pair<iterator, bool> __insert_unique(_P&& __x); pair<iterator, bool> __insert_unique(_Pp&& __x);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P> template <class _Pp>
iterator __insert_multi(_P&& __x); iterator __insert_multi(_Pp&& __x);
template <class _P> template <class _Pp>
iterator __insert_multi(const_iterator __p, _P&& __x); iterator __insert_multi(const_iterator __p, _Pp&& __x);
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
iterator __insert_multi(const value_type& __x); iterator __insert_multi(const value_type& __x);
iterator __insert_multi(const_iterator __p, const value_type& __x); iterator __insert_multi(const_iterator __p, const value_type& __x);
@ -644,8 +644,8 @@ public:
template <class _Key> template <class _Key>
const_iterator find(const _Key& __x) const; const_iterator find(const _Key& __x) const;
typedef __hash_node_destructor<__node_allocator> _D; typedef __hash_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
iterator erase(const_iterator __p); iterator erase(const_iterator __p);
iterator erase(const_iterator __first, const_iterator __last); iterator erase(const_iterator __first, const_iterator __last);
@ -752,37 +752,37 @@ private:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
template <class _A> template <class _Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static static
void void
__swap_alloc(_A& __x, _A& __y) __swap_alloc(_Ap& __x, _Ap& __y)
_NOEXCEPT_( _NOEXCEPT_(
!allocator_traits<_A>::propagate_on_container_swap::value || !allocator_traits<_Ap>::propagate_on_container_swap::value ||
__is_nothrow_swappable<_A>::value) __is_nothrow_swappable<_Ap>::value)
{ {
__swap_alloc(__x, __y, __swap_alloc(__x, __y,
integral_constant<bool, 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 _LIBCPP_INLINE_VISIBILITY
static static
void void
__swap_alloc(_A& __x, _A& __y, true_type) __swap_alloc(_Ap& __x, _Ap& __y, true_type)
_NOEXCEPT_(__is_nothrow_swappable<_A>::value) _NOEXCEPT_(__is_nothrow_swappable<_Ap>::value)
{ {
using _VSTD::swap; using _VSTD::swap;
swap(__x, __y); swap(__x, __y);
} }
template <class _A> template <class _Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static static
void 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; void __deallocate(__node_pointer __np) _NOEXCEPT;
__node_pointer __detach() _NOEXCEPT; __node_pointer __detach() _NOEXCEPT;
@ -1422,11 +1422,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Hash, class _Equal, class _Alloc> 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> 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()); pair<iterator, bool> __r = __node_insert_unique(__h.get());
if (__r.second) if (__r.second)
__h.release(); __h.release();
@ -1438,23 +1438,23 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_P&& __x)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc> template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _P> template <class _Pp>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator 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()); iterator __r = __node_insert_multi(__h.get());
__h.release(); __h.release();
return __r; return __r;
} }
template <class _Tp, class _Hash, class _Equal, class _Alloc> template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _P> template <class _Pp>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p, __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()); iterator __r = __node_insert_multi(__p, __h.get());
__h.release(); __h.release();
return __r; 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) __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
{ {
__node_allocator& __na = __node_alloc(); __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)...); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
__h.get_deleter().__value_constructed = true; __h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_); __h->__hash_ = hash_function()(__h->__value_);
@ -1632,7 +1632,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
size_t __hash) size_t __hash)
{ {
__node_allocator& __na = __node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
__h.get_deleter().__value_constructed = true; __h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash; __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) __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v)
{ {
__node_allocator& __na = __node_alloc(); __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); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true; __h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_); __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) size_t __hash)
{ {
__node_allocator& __na = __node_alloc(); __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); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true; __h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash; __h->__hash_ = __hash;
@ -1758,7 +1758,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
__pn->__next_ = __cn->__next_; __pn->__next_ = __cn->__next_;
__cn->__next_ = nullptr; __cn->__next_ = nullptr;
--size(); --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> template <class _Tp, class _Hash, class _Equal, class _Alloc>

View File

@ -1123,7 +1123,7 @@ extern template class codecvt_byname<char32_t, char, mbstate_t>;
_LIBCPP_VISIBLE void __throw_runtime_error(const char*); _LIBCPP_VISIBLE void __throw_runtime_error(const char*);
template <size_t _N> template <size_t _Np>
struct __narrow_to_utf8 struct __narrow_to_utf8
{ {
template <class _OutputIterator, class _CharT> 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 struct __widen_from_utf8
{ {
template <class _OutputIterator> template <class _OutputIterator>

View File

@ -392,8 +392,8 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al
__first_ = __alloc_traits::allocate(__alloc(), __cap); __first_ = __alloc_traits::allocate(__alloc(), __cap);
__begin_ = __end_ = __first_; __begin_ = __end_ = __first_;
__end_cap() = __first_ + __cap; __end_cap() = __first_ + __cap;
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
__construct_at_end(_I(__c.begin()), _I(__c.end())); __construct_at_end(_Ip(__c.begin()), _Ip(__c.end()));
} }
} }

View File

@ -21,20 +21,20 @@
_LIBCPP_BEGIN_NAMESPACE_STD _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> template <size_t _Np>
class _LIBCPP_HIDDEN __sso_allocator<void, _N> class _LIBCPP_HIDDEN __sso_allocator<void, _Np>
{ {
public: public:
typedef const void* const_pointer; typedef const void* const_pointer;
typedef void value_type; typedef void value_type;
}; };
template <class _Tp, size_t _N> template <class _Tp, size_t _Np>
class _LIBCPP_HIDDEN __sso_allocator class _LIBCPP_HIDDEN __sso_allocator
{ {
typename aligned_storage<sizeof(_Tp) * _N>::type buf_; typename aligned_storage<sizeof(_Tp) * _Np>::type buf_;
bool __allocated_; bool __allocated_;
public: public:
typedef size_t size_type; typedef size_t size_type;
@ -43,14 +43,14 @@ public:
_LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {} _LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {}
_LIBCPP_INLINE_VISIBILITY __sso_allocator(const __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) {} : __allocated_(false) {}
private: private:
__sso_allocator& operator=(const __sso_allocator&); __sso_allocator& operator=(const __sso_allocator&);
public: 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; __allocated_ = true;
return (pointer)&buf_; return (pointer)&buf_;

View File

@ -932,14 +932,14 @@ public:
__emplace_hint_multi(const_iterator __p, _Args&&... __args); __emplace_hint_multi(const_iterator __p, _Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
template <class _V> template <class _Vp>
pair<iterator, bool> __insert_unique(_V&& __v); pair<iterator, bool> __insert_unique(_Vp&& __v);
template <class _V> template <class _Vp>
iterator __insert_unique(const_iterator __p, _V&& __v); iterator __insert_unique(const_iterator __p, _Vp&& __v);
template <class _V> template <class _Vp>
iterator __insert_multi(_V&& __v); iterator __insert_multi(_Vp&& __v);
template <class _V> template <class _Vp>
iterator __insert_multi(const_iterator __p, _V&& __v); iterator __insert_multi(const_iterator __p, _Vp&& __v);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
pair<iterator, bool> __insert_unique(const value_type& __v); pair<iterator, bool> __insert_unique(const value_type& __v);
@ -1021,8 +1021,8 @@ public:
pair<const_iterator, const_iterator> pair<const_iterator, const_iterator>
__equal_range_multi(const _Key& __k) const; __equal_range_multi(const _Key& __k) const;
typedef __tree_node_destructor<__node_allocator> _D; typedef __tree_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
__node_holder remove(const_iterator __p) _NOEXCEPT; __node_holder remove(const_iterator __p) _NOEXCEPT;
private: private:
@ -1711,7 +1711,7 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args) __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args)
{ {
__node_allocator& __na = __node_alloc(); __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)...); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
__h.get_deleter().__value_constructed = true; __h.get_deleter().__value_constructed = true;
return __h; return __h;
@ -1781,11 +1781,11 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Compare, class _Allocator> template <class _Tp, class _Compare, class _Allocator>
template <class _V> template <class _Vp>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool> 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()); pair<iterator, bool> __r = __node_insert_unique(__h.get());
if (__r.second) if (__r.second)
__h.release(); __h.release();
@ -1793,11 +1793,11 @@ __tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v)
} }
template <class _Tp, class _Compare, class _Allocator> template <class _Tp, class _Compare, class _Allocator>
template <class _V> template <class _Vp>
typename __tree<_Tp, _Compare, _Allocator>::iterator 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()); iterator __r = __node_insert_unique(__p, __h.get());
if (__r.__ptr_ == __h.get()) if (__r.__ptr_ == __h.get())
__h.release(); __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 _Tp, class _Compare, class _Allocator>
template <class _V> template <class _Vp>
typename __tree<_Tp, _Compare, _Allocator>::iterator 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 __parent;
__node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_); __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
__insert_node_at(__parent, __child, __h.get()); __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 _Tp, class _Compare, class _Allocator>
template <class _V> template <class _Vp>
typename __tree<_Tp, _Compare, _Allocator>::iterator 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 __parent;
__node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_); __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
__insert_node_at(__parent, __child, __h.get()); __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) __tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v)
{ {
__node_allocator& __na = __node_alloc(); __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); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true; __h.get_deleter().__value_constructed = true;
return _VSTD::move(__h); return _VSTD::move(__h);
@ -2053,7 +2053,7 @@ template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::size_type typename __tree<_Tp, _Compare, _Allocator>::size_type
__tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const __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 __result = __end_node();
__node_const_pointer __rt = __root(); __node_const_pointer __rt = __root();
while (__rt != nullptr) while (__rt != nullptr)
@ -2160,7 +2160,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator,
typename __tree<_Tp, _Compare, _Allocator>::iterator> typename __tree<_Tp, _Compare, _Allocator>::iterator>
__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) __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 __result = __end_node();
__node_pointer __rt = __root(); __node_pointer __rt = __root();
while (__rt != nullptr) while (__rt != nullptr)
@ -2173,13 +2173,13 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)
else if (value_comp()(__rt->__value_, __k)) else if (value_comp()(__rt->__value_, __k))
__rt = static_cast<__node_pointer>(__rt->__right_); __rt = static_cast<__node_pointer>(__rt->__right_);
else else
return _P(iterator(__rt), return _Pp(iterator(__rt),
iterator( iterator(
__rt->__right_ != nullptr ? __rt->__right_ != nullptr ?
static_cast<__node_pointer>(__tree_min(__rt->__right_)) static_cast<__node_pointer>(__tree_min(__rt->__right_))
: __result)); : __result));
} }
return _P(iterator(__result), iterator(__result)); return _Pp(iterator(__result), iterator(__result));
} }
template <class _Tp, class _Compare, class _Allocator> 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> typename __tree<_Tp, _Compare, _Allocator>::const_iterator>
__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const __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 __result = __end_node();
__node_const_pointer __rt = __root(); __node_const_pointer __rt = __root();
while (__rt != nullptr) 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)) else if (value_comp()(__rt->__value_, __k))
__rt = static_cast<__node_const_pointer>(__rt->__right_); __rt = static_cast<__node_const_pointer>(__rt->__right_);
else else
return _P(const_iterator(__rt), return _Pp(const_iterator(__rt),
const_iterator( const_iterator(
__rt->__right_ != nullptr ? __rt->__right_ != nullptr ?
static_cast<__node_const_pointer>(__tree_min(__rt->__right_)) static_cast<__node_const_pointer>(__tree_min(__rt->__right_))
: __result)); : __result));
} }
return _P(const_iterator(__result), const_iterator(__result)); return _Pp(const_iterator(__result), const_iterator(__result));
} }
template <class _Tp, class _Compare, class _Allocator> template <class _Tp, class _Compare, class _Allocator>
@ -2216,7 +2216,7 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator,
typename __tree<_Tp, _Compare, _Allocator>::iterator> typename __tree<_Tp, _Compare, _Allocator>::iterator>
__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) __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 __result = __end_node();
__node_pointer __rt = __root(); __node_pointer __rt = __root();
while (__rt != nullptr) while (__rt != nullptr)
@ -2229,10 +2229,10 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k)
else if (value_comp()(__rt->__value_, __k)) else if (value_comp()(__rt->__value_, __k))
__rt = static_cast<__node_pointer>(__rt->__right_); __rt = static_cast<__node_pointer>(__rt->__right_);
else 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)); __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> 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> typename __tree<_Tp, _Compare, _Allocator>::const_iterator>
__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const __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 __result = __end_node();
__node_const_pointer __rt = __root(); __node_const_pointer __rt = __root();
while (__rt != nullptr) 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)) else if (value_comp()(__rt->__value_, __k))
__rt = static_cast<__node_const_pointer>(__rt->__right_); __rt = static_cast<__node_const_pointer>(__rt->__right_);
else 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)); __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> template <class _Tp, class _Compare, class _Allocator>
@ -2275,7 +2275,7 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
--size(); --size();
__tree_remove(__end_node()->__left_, __tree_remove(__end_node()->__left_,
static_cast<__node_base_pointer>(__np)); 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> template <class _Tp, class _Compare, class _Allocator>

View File

@ -2422,29 +2422,29 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
// __independent_bits_engine // __independent_bits_engine
template <unsigned long long _X, size_t _R> template <unsigned long long _Xp, size_t _Rp>
struct __log2_imp struct __log2_imp
{ {
static const size_t value = _X & ((unsigned long long)(1) << _R) ? _R static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp
: __log2_imp<_X, _R - 1>::value; : __log2_imp<_Xp, _Rp - 1>::value;
}; };
template <unsigned long long _X> template <unsigned long long _Xp>
struct __log2_imp<_X, 0> struct __log2_imp<_Xp, 0>
{ {
static const size_t value = 0; static const size_t value = 0;
}; };
template <size_t _R> template <size_t _Rp>
struct __log2_imp<0, _R> 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 struct __log2
{ {
static const size_t value = __log2_imp<_X, static const size_t value = __log2_imp<_Xp,
sizeof(_UI) * __CHAR_BIT__ - 1>::value; sizeof(_UI) * __CHAR_BIT__ - 1>::value;
}; };
@ -2474,9 +2474,9 @@ private:
_Engine_result_type __mask0_; _Engine_result_type __mask0_;
_Engine_result_type __mask1_; _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); + _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 _WDt = numeric_limits<_Working_result_type>::digits;
static const size_t _EDt = numeric_limits<_Engine_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); __independent_bits_engine(_Engine& __e, size_t __w);
// generating functions // generating functions
result_type operator()() {return __eval(integral_constant<bool, _R != 0>());} result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
private: private:
result_type __eval(false_type); result_type __eval(false_type);
@ -2500,24 +2500,24 @@ __independent_bits_engine<_Engine, _UIntType>
{ {
__n_ = __w_ / __m + (__w_ % __m != 0); __n_ = __w_ / __m + (__w_ % __m != 0);
__w0_ = __w_ / __n_; __w0_ = __w_ / __n_;
if (_R == 0) if (_Rp == 0)
__y0_ = _R; __y0_ = _Rp;
else if (__w0_ < _WDt) else if (__w0_ < _WDt)
__y0_ = (_R >> __w0_) << __w0_; __y0_ = (_Rp >> __w0_) << __w0_;
else else
__y0_ = 0; __y0_ = 0;
if (_R - __y0_ > __y0_ / __n_) if (_Rp - __y0_ > __y0_ / __n_)
{ {
++__n_; ++__n_;
__w0_ = __w_ / __n_; __w0_ = __w_ / __n_;
if (__w0_ < _WDt) if (__w0_ < _WDt)
__y0_ = (_R >> __w0_) << __w0_; __y0_ = (_Rp >> __w0_) << __w0_;
else else
__y0_ = 0; __y0_ = 0;
} }
__n0_ = __n_ - __w_ % __n_; __n0_ = __n_ - __w_ % __n_;
if (__w0_ < _WDt - 1) if (__w0_ < _WDt - 1)
__y1_ = (_R >> (__w0_ + 1)) << (__w0_ + 1); __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1);
else else
__y1_ = 0; __y1_ = 0;
__mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) : __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) :
@ -2539,7 +2539,7 @@ template<class _Engine, class _UIntType>
_UIntType _UIntType
__independent_bits_engine<_Engine, _UIntType>::__eval(true_type) __independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
{ {
result_type _S = 0; result_type _Sp = 0;
for (size_t __k = 0; __k < __n0_; ++__k) for (size_t __k = 0; __k < __n0_; ++__k)
{ {
_Engine_result_type __u; _Engine_result_type __u;
@ -2548,10 +2548,10 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
__u = __e_() - _Engine::min(); __u = __e_() - _Engine::min();
} while (__u >= __y0_); } while (__u >= __y0_);
if (__w0_ < _WDt) if (__w0_ < _WDt)
_S <<= __w0_; _Sp <<= __w0_;
else else
_S = 0; _Sp = 0;
_S += __u & __mask0_; _Sp += __u & __mask0_;
} }
for (size_t __k = __n0_; __k < __n_; ++__k) for (size_t __k = __n0_; __k < __n_; ++__k)
{ {
@ -2561,12 +2561,12 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
__u = __e_() - _Engine::min(); __u = __e_() - _Engine::min();
} while (__u >= __y1_); } while (__u >= __y1_);
if (__w0_ < _WDt - 1) if (__w0_ < _WDt - 1)
_S <<= __w0_ + 1; _Sp <<= __w0_ + 1;
else else
_S = 0; _Sp = 0;
_S += __u & __mask1_; _Sp += __u & __mask1_;
} }
return _S; return _Sp;
} }
// uniform_int_distribution // 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), typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t),
uint32_t, uint64_t>::type _UIntType; uint32_t, uint64_t>::type _UIntType;
const _UIntType _R = __p.b() - __p.a() + _UIntType(1); const _UIntType _Rp = __p.b() - __p.a() + _UIntType(1);
if (_R == 1) if (_Rp == 1)
return __p.a(); return __p.a();
const size_t _Dt = numeric_limits<_UIntType>::digits; const size_t _Dt = numeric_limits<_UIntType>::digits;
typedef __independent_bits_engine<_URNG, _UIntType> _Eng; typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
if (_R == 0) if (_Rp == 0)
return static_cast<result_type>(_Eng(__g, _Dt)()); return static_cast<result_type>(_Eng(__g, _Dt)());
size_t __w = _Dt - __clz(_R) - 1; size_t __w = _Dt - __clz(_Rp) - 1;
if ((_R & (_UIntType(~0) >> (_Dt - __w))) != 0) if ((_Rp & (_UIntType(~0) >> (_Dt - __w))) != 0)
++__w; ++__w;
_Eng __e(__g, __w); _Eng __e(__g, __w);
_UIntType __u; _UIntType __u;
do do
{ {
__u = __e(); __u = __e();
} while (__u >= _R); } while (__u >= _Rp);
return static_cast<result_type>(__u + __p.a()); return static_cast<result_type>(__u + __p.a());
} }
@ -2691,16 +2691,16 @@ void
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
{ {
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
typedef uniform_int_distribution<ptrdiff_t> _D; typedef uniform_int_distribution<ptrdiff_t> _Dp;
typedef typename _D::param_type _P; typedef typename _Dp::param_type _Pp;
difference_type __d = __last - __first; difference_type __d = __last - __first;
if (__d > 1) if (__d > 1)
{ {
_D __uid; _Dp __uid;
__rs_default __g = __rs_get(); __rs_default __g = __rs_get();
for (--__last, --__d; __first < __last; ++__first, --__d) 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)) if (__i != difference_type(0))
swap(*__first, *(__first + __i)); swap(*__first, *(__first + __i));
} }
@ -2737,15 +2737,15 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
#endif #endif
{ {
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
typedef uniform_int_distribution<ptrdiff_t> _D; typedef uniform_int_distribution<ptrdiff_t> _Dp;
typedef typename _D::param_type _P; typedef typename _Dp::param_type _Pp;
difference_type __d = __last - __first; difference_type __d = __last - __first;
if (__d > 1) if (__d > 1)
{ {
_D __uid; _Dp __uid;
for (--__last, --__d; __first < __last; ++__first, --__d) 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)) if (__i != difference_type(0))
swap(*__first, *(__first + __i)); swap(*__first, *(__first + __i));
} }

View File

@ -695,11 +695,11 @@ bitset<_Size>::bitset(const _CharT* __str,
#else #else
assert(!"bitset string ctor has invalid argument"); assert(!"bitset string ctor has invalid argument");
#endif #endif
size_t _M = _VSTD::min(__rlen, _Size); size_t _Mp = _VSTD::min(__rlen, _Size);
size_t __i = 0; 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) if (__c == __zero)
(*this)[__i] = false; (*this)[__i] = false;
else else
@ -729,11 +729,11 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
#else #else
assert(!"bitset string ctor has invalid argument"); assert(!"bitset string ctor has invalid argument");
#endif #endif
size_t _M = _VSTD::min(__rlen, _Size); size_t _Mp = _VSTD::min(__rlen, _Size);
size_t __i = 0; 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)) if (_Traits::eq(__c, __zero))
(*this)[__i] = false; (*this)[__i] = false;
else else

View File

@ -280,10 +280,10 @@ public:
_LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT {} _LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT {}
template <class _P, class _R, class _MP> template <class _Pp, class _Rp, class _MP>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
__deque_iterator(const __deque_iterator<value_type, _P, _R, _MP, difference_type, __block_size>& __it, __deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, __block_size>& __it,
typename enable_if<is_convertible<_P, pointer>::value>::type* = 0) _NOEXCEPT typename enable_if<is_convertible<_Pp, pointer>::value>::type* = 0) _NOEXCEPT
: __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {} : __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {}
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__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 _LIBCPP_INLINE_VISIBILITY __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
: __m_iter_(__m), __ptr_(__p) {} : __m_iter_(__m), __ptr_(__p) {}
template <class _Tp, class _A> friend class __deque_base; template <class _Tp, class _Ap> friend class __deque_base;
template <class _Tp, class _A> friend class _LIBCPP_VISIBLE deque; template <class _Tp, class _Ap> friend class _LIBCPP_VISIBLE deque;
template <class _V, class _P, class _R, class _MP, class _D, _D> template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp>
friend class _LIBCPP_VISIBLE __deque_iterator; friend class _LIBCPP_VISIBLE __deque_iterator;
template <class _RAIter, template <class _RAIter,
@ -1510,8 +1510,8 @@ deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
{ {
if (__a != __c.__alloc()) if (__a != __c.__alloc())
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__c.begin()), _I(__c.end())); 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()) if (__base::__alloc() != __c.__alloc())
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__c.begin()), _I(__c.end())); assign(_Ip(__c.begin()), _Ip(__c.end()));
} }
else else
__move_assign(__c, true_type()); __move_assign(__c, true_type());

View File

@ -146,9 +146,9 @@ public:
_ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr); _ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr);
}; };
template<class _E> template<class _Ep>
exception_ptr exception_ptr
make_exception_ptr(_E __e) _NOEXCEPT make_exception_ptr(_Ep __e) _NOEXCEPT
{ {
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
@ -224,11 +224,11 @@ throw_with_nested (_Tp& __t, typename enable_if<
#endif #endif
} }
template <class _E> template <class _Ep>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
void void
rethrow_if_nested(const _E& __e, typename enable_if< rethrow_if_nested(const _Ep& __e, typename enable_if<
is_polymorphic<_E>::value is_polymorphic<_Ep>::value
>::type* = 0) >::type* = 0)
{ {
const nested_exception* __nep = dynamic_cast<const nested_exception*>(&__e); 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(); __nep->rethrow_nested();
} }
template <class _E> template <class _Ep>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
void void
rethrow_if_nested(const _E& __e, typename enable_if< rethrow_if_nested(const _Ep& __e, typename enable_if<
!is_polymorphic<_E>::value !is_polymorphic<_Ep>::value
>::type* = 0) >::type* = 0)
{ {
} }

View File

@ -499,8 +499,8 @@ private:
typedef typename __table::__node_traits __node_traits; typedef typename __table::__node_traits __node_traits;
typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node_allocator __node_allocator;
typedef typename __table::__node __node; typedef typename __table::__node __node;
typedef __hash_map_node_destructor<__node_allocator> _D; typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits; typedef allocator_traits<allocator_type> __alloc_traits;
public: public:
typedef typename __alloc_traits::pointer pointer; 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) hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
{ {
__node_allocator& __na = __table_.__node_alloc(); __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); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __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_traits __node_traits;
typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node_allocator __node_allocator;
typedef typename __table::__node __node; typedef typename __table::__node __node;
typedef __hash_map_node_destructor<__node_allocator> _D; typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits; typedef allocator_traits<allocator_type> __alloc_traits;
public: public:
typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::pointer pointer;

View File

@ -772,8 +772,8 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
if (__n > 0) if (__n > 0)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
for (__node_pointer __p = base::__before_begin(); __n > 0; --__n, for (__node_pointer __p = base::__before_begin(); __n > 0; --__n,
__p = __p->__next_) __p = __p->__next_)
{ {
@ -848,8 +848,8 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
{ {
if (base::__alloc() != __x.__alloc()) if (base::__alloc() != __x.__alloc())
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
insert_after(cbefore_begin(), _I(__x.begin()), _I(__x.end())); 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()); __move_assign(__x, true_type());
else else
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__x.begin()), _I(__x.end())); assign(_Ip(__x.begin()), _Ip(__x.end()));
} }
} }
@ -995,8 +995,8 @@ void
forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args) forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __node_traits::construct(__a, _VSTD::addressof(__h->__value_),
_VSTD::forward<_Args>(__args)...); _VSTD::forward<_Args>(__args)...);
__h->__next_ = base::__before_begin()->__next_; __h->__next_ = base::__before_begin()->__next_;
@ -1010,8 +1010,8 @@ void
forward_list<_Tp, _Alloc>::push_front(value_type&& __v) forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
__h->__next_ = base::__before_begin()->__next_; __h->__next_ = base::__before_begin()->__next_;
base::__before_begin()->__next_ = __h.release(); base::__before_begin()->__next_ = __h.release();
@ -1024,8 +1024,8 @@ void
forward_list<_Tp, _Alloc>::push_front(const value_type& __v) forward_list<_Tp, _Alloc>::push_front(const value_type& __v)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__h->__next_ = base::__before_begin()->__next_; __h->__next_ = base::__before_begin()->__next_;
base::__before_begin()->__next_ = __h.release(); 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_pointer const __r = const_cast<__node_pointer>(__p.__ptr_);
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __node_traits::construct(__a, _VSTD::addressof(__h->__value_),
_VSTD::forward<_Args>(__args)...); _VSTD::forward<_Args>(__args)...);
__h->__next_ = __r->__next_; __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_pointer const __r = const_cast<__node_pointer>(__p.__ptr_);
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
__h->__next_ = __r->__next_; __h->__next_ = __r->__next_;
__r->__next_ = __h.release(); __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_pointer const __r = const_cast<__node_pointer>(__p.__ptr_);
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__h->__next_ = __r->__next_; __h->__next_ = __r->__next_;
__r->__next_ = __h.release(); __r->__next_ = __h.release();
@ -1102,8 +1102,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
if (__n > 0) if (__n > 0)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__node_pointer __first = __h.release(); __node_pointer __first = __h.release();
__node_pointer __last = __first; __node_pointer __last = __first;
@ -1152,8 +1152,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
if (__f != __l) if (__f != __l)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
__node_pointer __first = __h.release(); __node_pointer __first = __h.release();
__node_pointer __last = __first; __node_pointer __last = __first;
@ -1244,8 +1244,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n)
if (__n > 0) if (__n > 0)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n, for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n,
__ptr = __ptr->__next_) __ptr = __ptr->__next_)
{ {
@ -1276,8 +1276,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v)
if (__n > 0) if (__n > 0)
{ {
__node_allocator& __a = base::__alloc(); __node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n, for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n,
__ptr = __ptr->__next_) __ptr = __ptr->__next_)
{ {
@ -1569,12 +1569,12 @@ template <class _Tp, class _Alloc>
bool operator==(const forward_list<_Tp, _Alloc>& __x, bool operator==(const forward_list<_Tp, _Alloc>& __x,
const forward_list<_Tp, _Alloc>& __y) const forward_list<_Tp, _Alloc>& __y)
{ {
typedef forward_list<_Tp, _Alloc> _C; typedef forward_list<_Tp, _Alloc> _Cp;
typedef typename _C::const_iterator _I; typedef typename _Cp::const_iterator _Ip;
_I __ix = __x.begin(); _Ip __ix = __x.begin();
_I __ex = __x.end(); _Ip __ex = __x.end();
_I __iy = __y.begin(); _Ip __iy = __y.begin();
_I __ey = __y.end(); _Ip __ey = __y.end();
for (; __ix != __ex && __iy != __ey; ++__ix, ++__iy) for (; __ix != __ex && __iy != __ey; ++__ix, ++__iy)
if (!(*__ix == *__iy)) if (!(*__ix == *__iy))
return false; return false;

View File

@ -198,7 +198,7 @@ namespace placeholders {
. .
. .
. .
extern unspecified _M; extern unspecified _Mp;
} }
template <class Operation> template <class Operation>
@ -890,44 +890,44 @@ public:
} }
}; };
template<class _R, class _T> template<class _Rp, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_R _T::*> __mem_fn<_Rp _Tp::*>
mem_fn(_R _T::* __pm) 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 inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_R (_T::*)(_Args...)> __mem_fn<_Rp (_Tp::*)(_Args...)>
mem_fn(_R (_T::* __pm)(_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 inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_R (_T::*)(_Args...) const> __mem_fn<_Rp (_Tp::*)(_Args...) const>
mem_fn(_R (_T::* __pm)(_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 inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_R (_T::*)(_Args...) volatile> __mem_fn<_Rp (_Tp::*)(_Args...) volatile>
mem_fn(_R (_T::* __pm)(_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 inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_R (_T::*)(_Args...) const volatile> __mem_fn<_Rp (_Tp::*)(_Args...) const volatile>
mem_fn(_R (_T::* __pm)(_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 // bad_function_call
@ -942,32 +942,32 @@ template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
namespace __function namespace __function
{ {
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
struct __maybe_derive_from_unary_function struct __maybe_derive_from_unary_function
{ {
}; };
template<class _R, class _A1> template<class _Rp, class _A1>
struct __maybe_derive_from_unary_function<_R(_A1)> struct __maybe_derive_from_unary_function<_Rp(_A1)>
: public unary_function<_A1, _R> : public unary_function<_A1, _Rp>
{ {
}; };
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
struct __maybe_derive_from_binary_function struct __maybe_derive_from_binary_function
{ {
}; };
template<class _R, class _A1, class _A2> template<class _Rp, class _A1, class _A2>
struct __maybe_derive_from_binary_function<_R(_A1, _A2)> struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
: public binary_function<_A1, _A2, _R> : public binary_function<_A1, _A2, _Rp>
{ {
}; };
template<class _Fp> class __base; template<class _Fp> class __base;
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
class __base<_R(_ArgTypes...)> class __base<_Rp(_ArgTypes...)>
{ {
__base(const __base&); __base(const __base&);
__base& operator=(const __base&); __base& operator=(const __base&);
@ -978,7 +978,7 @@ public:
virtual void __clone(__base*) const = 0; virtual void __clone(__base*) const = 0;
virtual void destroy() _NOEXCEPT = 0; virtual void destroy() _NOEXCEPT = 0;
virtual void destroy_deallocate() _NOEXCEPT = 0; virtual void destroy_deallocate() _NOEXCEPT = 0;
virtual _R operator()(_ArgTypes&& ...) = 0; virtual _Rp operator()(_ArgTypes&& ...) = 0;
#ifndef _LIBCPP_NO_RTTI #ifndef _LIBCPP_NO_RTTI
virtual const void* target(const type_info&) const _NOEXCEPT = 0; virtual const void* target(const type_info&) const _NOEXCEPT = 0;
virtual const std::type_info& target_type() 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 _FD, class _Alloc, class _FB> class __func;
template<class _F, class _Alloc, class _R, class ..._ArgTypes> template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
class __func<_F, _Alloc, _R(_ArgTypes...)> class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
: public __base<_R(_ArgTypes...)> : public __base<_Rp(_ArgTypes...)>
{ {
__compressed_pair<_F, _Alloc> __f_; __compressed_pair<_Fp, _Alloc> __f_;
public: public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __func(_F __f) : __f_(_VSTD::move(__f)) {} explicit __func(_Fp __f) : __f_(_VSTD::move(__f)) {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
virtual __base<_R(_ArgTypes...)>* __clone() const; virtual __base<_Rp(_ArgTypes...)>* __clone() const;
virtual void __clone(__base<_R(_ArgTypes...)>*) const; virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
virtual void destroy() _NOEXCEPT; virtual void destroy() _NOEXCEPT;
virtual void destroy_deallocate() _NOEXCEPT; virtual void destroy_deallocate() _NOEXCEPT;
virtual _R operator()(_ArgTypes&& ... __arg); virtual _Rp operator()(_ArgTypes&& ... __arg);
#ifndef _LIBCPP_NO_RTTI #ifndef _LIBCPP_NO_RTTI
virtual const void* target(const type_info&) const _NOEXCEPT; virtual const void* target(const type_info&) const _NOEXCEPT;
virtual const std::type_info& target_type() const _NOEXCEPT; virtual const std::type_info& target_type() const _NOEXCEPT;
#endif // _LIBCPP_NO_RTTI #endif // _LIBCPP_NO_RTTI
}; };
template<class _F, class _Alloc, class _R, class ..._ArgTypes> template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
__base<_R(_ArgTypes...)>* __base<_Rp(_ArgTypes...)>*
__func<_F, _Alloc, _R(_ArgTypes...)>::__clone() const __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const
{ {
typedef typename _Alloc::template rebind<__func>::other _A; typedef typename _Alloc::template rebind<__func>::other _Ap;
_A __a(__f_.second()); _Ap __a(__f_.second());
typedef __allocator_destructor<_A> _D; typedef __allocator_destructor<_Ap> _Dp;
unique_ptr<__func, _D> __hold(__a.allocate(1), _D(__a, 1)); unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); ::new (__hold.get()) __func(__f_.first(), _Alloc(__a));
return __hold.release(); return __hold.release();
} }
template<class _F, class _Alloc, class _R, class ..._ArgTypes> template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
void 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()); ::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 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 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; typedef typename _Alloc::template rebind<__func>::other _Ap;
_A __a(__f_.second()); _Ap __a(__f_.second());
__f_.~__compressed_pair<_F, _Alloc>(); __f_.~__compressed_pair<_Fp, _Alloc>();
__a.deallocate(this, 1); __a.deallocate(this, 1);
} }
template<class _F, class _Alloc, class _R, class ..._ArgTypes> template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
_R _Rp
__func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
{ {
return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...); return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
} }
#ifndef _LIBCPP_NO_RTTI #ifndef _LIBCPP_NO_RTTI
template<class _F, class _Alloc, class _R, class ..._ArgTypes> template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
const void* 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 &__f_.first();
return (const void*)0; 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& 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 #endif // _LIBCPP_NO_RTTI
} // __function } // __function
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
class _LIBCPP_VISIBLE function<_R(_ArgTypes...)> class _LIBCPP_VISIBLE function<_Rp(_ArgTypes...)>
: public __function::__maybe_derive_from_unary_function<_R(_ArgTypes...)>, : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
public __function::__maybe_derive_from_binary_function<_R(_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_; aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_; __base* __f_;
template <class _F> template <class _Fp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static bool __not_null(const _F&) {return true;} static bool __not_null(const _Fp&) {return true;}
template <class _R2, class ..._A> template <class _R2, class ..._Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static bool __not_null(_R2 (*__p)(_A...)) {return __p;} static bool __not_null(_R2 (*__p)(_Ap...)) {return __p;}
template <class _R2, class _C, class ..._A> template <class _R2, class _Cp, class ..._Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static bool __not_null(_R2 (_C::*__p)(_A...)) {return __p;} static bool __not_null(_R2 (_Cp::*__p)(_Ap...)) {return __p;}
template <class _R2, class _C, class ..._A> template <class _R2, class _Cp, class ..._Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static bool __not_null(_R2 (_C::*__p)(_A...) const) {return __p;} static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const) {return __p;}
template <class _R2, class _C, class ..._A> template <class _R2, class _Cp, class ..._Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static bool __not_null(_R2 (_C::*__p)(_A...) volatile) {return __p;} static bool __not_null(_R2 (_Cp::*__p)(_Ap...) volatile) {return __p;}
template <class _R2, class _C, class ..._A> template <class _R2, class _Cp, class ..._Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
static bool __not_null(_R2 (_C::*__p)(_A...) const volatile) {return __p;} static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const volatile) {return __p;}
template <class _R2, class ..._A> template <class _R2, class ..._Ap>
_LIBCPP_INLINE_VISIBILITY _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; struct __callable;
template <class _F> template <class _Fp>
struct __callable<_F, true> struct __callable<_Fp, true>
{ {
static const bool value = static const bool value =
is_convertible<typename __invoke_of<_F&, _ArgTypes...>::type, is_convertible<typename __invoke_of<_Fp&, _ArgTypes...>::type,
_R>::value; _Rp>::value;
}; };
template <class _F> template <class _Fp>
struct __callable<_F, false> struct __callable<_Fp, false>
{ {
static const bool value = false; static const bool value = false;
}; };
public: public:
typedef _R result_type; typedef _Rp result_type;
// construct/copy/destroy: // construct/copy/destroy:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@ -1128,9 +1128,9 @@ public:
function(nullptr_t) _NOEXCEPT : __f_(0) {} function(nullptr_t) _NOEXCEPT : __f_(0) {}
function(const function&); function(const function&);
function(function&&) _NOEXCEPT; function(function&&) _NOEXCEPT;
template<class _F> template<class _Fp>
function(_F, function(_Fp,
typename enable_if<__callable<_F>::value>::type* = 0); typename enable_if<__callable<_Fp>::value>::type* = 0);
template<class _Alloc> template<class _Alloc>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@ -1142,29 +1142,29 @@ public:
function(allocator_arg_t, const _Alloc&, const function&); function(allocator_arg_t, const _Alloc&, const function&);
template<class _Alloc> template<class _Alloc>
function(allocator_arg_t, const _Alloc&, function&&); function(allocator_arg_t, const _Alloc&, function&&);
template<class _F, class _Alloc> template<class _Fp, class _Alloc>
function(allocator_arg_t, const _Alloc& __a, _F __f, function(allocator_arg_t, const _Alloc& __a, _Fp __f,
typename enable_if<__callable<_F>::value>::type* = 0); typename enable_if<__callable<_Fp>::value>::type* = 0);
function& operator=(const function&); function& operator=(const function&);
function& operator=(function&&) _NOEXCEPT; function& operator=(function&&) _NOEXCEPT;
function& operator=(nullptr_t) _NOEXCEPT; function& operator=(nullptr_t) _NOEXCEPT;
template<class _F> template<class _Fp>
typename enable_if typename enable_if
< <
__callable<typename decay<_F>::type>::value, __callable<typename decay<_Fp>::type>::value,
function& function&
>::type >::type
operator=(_F&&); operator=(_Fp&&);
~function(); ~function();
// function modifiers: // function modifiers:
void swap(function&) _NOEXCEPT; void swap(function&) _NOEXCEPT;
template<class _F, class _Alloc> template<class _Fp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void assign(_F&& __f, const _Alloc& __a) void assign(_Fp&& __f, const _Alloc& __a)
{function(allocator_arg, __a, _VSTD::forward<_F>(__f)).swap(*this);} {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);}
// function capacity: // function capacity:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@ -1177,18 +1177,18 @@ public:
bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete; bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
public: public:
// function invocation: // function invocation:
_R operator()(_ArgTypes...) const; _Rp operator()(_ArgTypes...) const;
#ifndef _LIBCPP_NO_RTTI #ifndef _LIBCPP_NO_RTTI
// function target access: // function target access:
const std::type_info& target_type() const _NOEXCEPT; const std::type_info& target_type() const _NOEXCEPT;
template <typename _T> _T* target() _NOEXCEPT; template <typename _Tp> _Tp* target() _NOEXCEPT;
template <typename _T> const _T* target() const _NOEXCEPT; template <typename _Tp> const _Tp* target() const _NOEXCEPT;
#endif // _LIBCPP_NO_RTTI #endif // _LIBCPP_NO_RTTI
}; };
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
function<_R(_ArgTypes...)>::function(const function& __f) function<_Rp(_ArgTypes...)>::function(const function& __f)
{ {
if (__f.__f_ == 0) if (__f.__f_ == 0)
__f_ = 0; __f_ = 0;
@ -1201,9 +1201,9 @@ function<_R(_ArgTypes...)>::function(const function& __f)
__f_ = __f.__f_->__clone(); __f_ = __f.__f_->__clone();
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
template <class _Alloc> template <class _Alloc>
function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
const function& __f) const function& __f)
{ {
if (__f.__f_ == 0) if (__f.__f_ == 0)
@ -1217,8 +1217,8 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
__f_ = __f.__f_->__clone(); __f_ = __f.__f_->__clone();
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
function<_R(_ArgTypes...)>::function(function&& __f) _NOEXCEPT function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
{ {
if (__f.__f_ == 0) if (__f.__f_ == 0)
__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> template <class _Alloc>
function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
function&& __f) function&& __f)
{ {
if (__f.__f_ == 0) if (__f.__f_ == 0)
@ -1253,43 +1253,43 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
} }
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
template <class _F> template <class _Fp>
function<_R(_ArgTypes...)>::function(_F __f, function<_Rp(_ArgTypes...)>::function(_Fp __f,
typename enable_if<__callable<_F>::value>::type*) typename enable_if<__callable<_Fp>::value>::type*)
: __f_(0) : __f_(0)
{ {
if (__not_null(__f)) if (__not_null(__f))
{ {
typedef __function::__func<_F, allocator<_F>, _R(_ArgTypes...)> _FF; typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value) if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value)
{ {
__f_ = (__base*)&__buf_; __f_ = (__base*)&__buf_;
::new (__f_) _FF(_VSTD::move(__f)); ::new (__f_) _FF(_VSTD::move(__f));
} }
else else
{ {
typedef allocator<_FF> _A; typedef allocator<_FF> _Ap;
_A __a; _Ap __a;
typedef __allocator_destructor<_A> _D; typedef __allocator_destructor<_Ap> _Dp;
unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_F>(__a)); ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
__f_ = __hold.release(); __f_ = __hold.release();
} }
} }
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
template <class _F, class _Alloc> template <class _Fp, class _Alloc>
function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f, function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
typename enable_if<__callable<_F>::value>::type*) typename enable_if<__callable<_Fp>::value>::type*)
: __f_(0) : __f_(0)
{ {
typedef allocator_traits<_Alloc> __alloc_traits; typedef allocator_traits<_Alloc> __alloc_traits;
if (__not_null(__f)) if (__not_null(__f))
{ {
typedef __function::__func<_F, _Alloc, _R(_ArgTypes...)> _FF; typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value) if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value)
{ {
__f_ = (__base*)&__buf_; __f_ = (__base*)&__buf_;
::new (__f_) _FF(_VSTD::move(__f)); ::new (__f_) _FF(_VSTD::move(__f));
@ -1302,27 +1302,27 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f
#else #else
rebind_alloc<_FF>::other rebind_alloc<_FF>::other
#endif #endif
_A; _Ap;
_A __a(__a0); _Ap __a(__a0);
typedef __allocator_destructor<_A> _D; typedef __allocator_destructor<_Ap> _Dp;
unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1)); unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
::new (__hold.get()) _FF(_VSTD::move(__f), _Alloc(__a)); ::new (__hold.get()) _FF(_VSTD::move(__f), _Alloc(__a));
__f_ = __hold.release(); __f_ = __hold.release();
} }
} }
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
function<_R(_ArgTypes...)>& function<_Rp(_ArgTypes...)>&
function<_R(_ArgTypes...)>::operator=(const function& __f) function<_Rp(_ArgTypes...)>::operator=(const function& __f)
{ {
function(__f).swap(*this); function(__f).swap(*this);
return *this; return *this;
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
function<_R(_ArgTypes...)>& function<_Rp(_ArgTypes...)>&
function<_R(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
{ {
if (__f_ == (__base*)&__buf_) if (__f_ == (__base*)&__buf_)
__f_->destroy(); __f_->destroy();
@ -1343,9 +1343,9 @@ function<_R(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
} }
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
function<_R(_ArgTypes...)>& function<_Rp(_ArgTypes...)>&
function<_R(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
{ {
if (__f_ == (__base*)&__buf_) if (__f_ == (__base*)&__buf_)
__f_->destroy(); __f_->destroy();
@ -1354,21 +1354,21 @@ function<_R(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
__f_ = 0; __f_ = 0;
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
template <class _F> template <class _Fp>
typename enable_if typename enable_if
< <
function<_R(_ArgTypes...)>::template __callable<typename decay<_F>::type>::value, function<_Rp(_ArgTypes...)>::template __callable<typename decay<_Fp>::type>::value,
function<_R(_ArgTypes...)>& function<_Rp(_ArgTypes...)>&
>::type >::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; return *this;
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
function<_R(_ArgTypes...)>::~function() function<_Rp(_ArgTypes...)>::~function()
{ {
if (__f_ == (__base*)&__buf_) if (__f_ == (__base*)&__buf_)
__f_->destroy(); __f_->destroy();
@ -1376,9 +1376,9 @@ function<_R(_ArgTypes...)>::~function()
__f_->destroy_deallocate(); __f_->destroy_deallocate();
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
void void
function<_R(_ArgTypes...)>::swap(function& __f) _NOEXCEPT function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
{ {
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) 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_); _VSTD::swap(__f_, __f.__f_);
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
_R _Rp
function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
{ {
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0) if (__f_ == 0)
@ -1426,61 +1426,61 @@ function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
#ifndef _LIBCPP_NO_RTTI #ifndef _LIBCPP_NO_RTTI
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
const std::type_info& const std::type_info&
function<_R(_ArgTypes...)>::target_type() const _NOEXCEPT function<_Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
{ {
if (__f_ == 0) if (__f_ == 0)
return typeid(void); return typeid(void);
return __f_->target_type(); return __f_->target_type();
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
template <typename _T> template <typename _Tp>
_T* _Tp*
function<_R(_ArgTypes...)>::target() _NOEXCEPT function<_Rp(_ArgTypes...)>::target() _NOEXCEPT
{ {
if (__f_ == 0) if (__f_ == 0)
return (_T*)0; return (_Tp*)0;
return (_T*)__f_->target(typeid(_T)); return (_Tp*)__f_->target(typeid(_Tp));
} }
template<class _R, class ..._ArgTypes> template<class _Rp, class ..._ArgTypes>
template <typename _T> template <typename _Tp>
const _T* const _Tp*
function<_R(_ArgTypes...)>::target() const _NOEXCEPT function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT
{ {
if (__f_ == 0) if (__f_ == 0)
return (const _T*)0; return (const _Tp*)0;
return (const _T*)__f_->target(typeid(_T)); return (const _Tp*)__f_->target(typeid(_Tp));
} }
#endif // _LIBCPP_NO_RTTI #endif // _LIBCPP_NO_RTTI
template <class _R, class... _ArgTypes> template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
bool 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 inline _LIBCPP_INLINE_VISIBILITY
bool 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 inline _LIBCPP_INLINE_VISIBILITY
bool 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 inline _LIBCPP_INLINE_VISIBILITY
bool 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 inline _LIBCPP_INLINE_VISIBILITY
void 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);} {return __x.swap(__y);}
template<class _Tp> struct __is_bind_expression : public false_type {}; template<class _Tp> struct __is_bind_expression : public false_type {};
@ -1494,7 +1494,7 @@ template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
namespace placeholders namespace placeholders
{ {
template <int _N> struct __ph {}; template <int _Np> struct __ph {};
extern __ph<1> _1; extern __ph<1> _1;
extern __ph<2> _2; extern __ph<2> _2;
@ -1509,9 +1509,9 @@ extern __ph<10> _10;
} // placeholders } // placeholders
template<int _N> template<int _Np>
struct __is_placeholder<placeholders::__ph<_N> > struct __is_placeholder<placeholders::__ph<_Np> >
: public integral_constant<int, _N> {}; : public integral_constant<int, _Np> {};
template <class _Tp, class _Uj> template <class _Tp, class _Uj>
inline _LIBCPP_INLINE_VISIBILITY 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; struct __bind_return;
template <class _F, class ..._BoundArgs, class _TupleUj> template <class _Fp, class ..._BoundArgs, class _TupleUj>
struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj> struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
{ {
typedef typename __invoke_of typedef typename __invoke_of
< <
_F&, _Fp&,
typename __mu_return typename __mu_return
< <
_BoundArgs, _BoundArgs,
@ -1634,12 +1634,12 @@ struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj>
>::type type; >::type type;
}; };
template <class _F, class ..._BoundArgs, class _TupleUj> template <class _Fp, class ..._BoundArgs, class _TupleUj>
struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj> struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
{ {
typedef typename __invoke_of typedef typename __invoke_of
< <
_F&, _Fp&,
typename __mu_return typename __mu_return
< <
const _BoundArgs, const _BoundArgs,
@ -1648,20 +1648,20 @@ struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj>
>::type type; >::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 inline _LIBCPP_INLINE_VISIBILITY
typename __bind_return<_F, _BoundArgs, _Args>::type typename __bind_return<_Fp, _BoundArgs, _Args>::type
__apply_functor(_F& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, __apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
_Args&& __args) _Args&& __args)
{ {
return __invoke(__f, __mu(get<_Indx>(__bound_args), __args)...); return __invoke(__f, __mu(get<_Indx>(__bound_args), __args)...);
} }
template<class _F, class ..._BoundArgs> template<class _Fp, class ..._BoundArgs>
class __bind 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; typedef tuple<typename decay<_BoundArgs>::type...> _Td;
_Fd __f_; _Fd __f_;
_Td __bound_args_; _Td __bound_args_;
@ -1698,10 +1698,10 @@ public:
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS #endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
template <class _G, class ..._BA> template <class _Gp, class ..._BA>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __bind(_G&& __f, _BA&& ...__bound_args) explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
: __f_(_VSTD::forward<_G>(__f)), : __f_(_VSTD::forward<_Gp>(__f)),
__bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
template <class ..._Args> template <class ..._Args>
@ -1723,16 +1723,16 @@ public:
} }
}; };
template<class _F, class ..._BoundArgs> template<class _Fp, class ..._BoundArgs>
struct __is_bind_expression<__bind<_F, _BoundArgs...> > : public true_type {}; 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 class __bind_r
: public __bind<_F, _BoundArgs...> : public __bind<_Fp, _BoundArgs...>
{ {
typedef __bind<_F, _BoundArgs...> base; typedef __bind<_Fp, _BoundArgs...> base;
public: public:
typedef _R result_type; typedef _Rp result_type;
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS #ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
@ -1760,10 +1760,10 @@ public:
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS #endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
template <class _G, class ..._BA> template <class _Gp, class ..._BA>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __bind_r(_G&& __f, _BA&& ...__bound_args) explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
: base(_VSTD::forward<_G>(__f), : base(_VSTD::forward<_Gp>(__f),
_VSTD::forward<_BA>(__bound_args)...) {} _VSTD::forward<_BA>(__bound_args)...) {}
template <class ..._Args> template <class ..._Args>
@ -1783,25 +1783,25 @@ public:
} }
}; };
template<class _R, class _F, class ..._BoundArgs> template<class _Rp, class _Fp, class ..._BoundArgs>
struct __is_bind_expression<__bind_r<_R, _F, _BoundArgs...> > : public true_type {}; 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 inline _LIBCPP_INLINE_VISIBILITY
__bind<_F, _BoundArgs...> __bind<_Fp, _BoundArgs...>
bind(_F&& __f, _BoundArgs&&... __bound_args) bind(_Fp&& __f, _BoundArgs&&... __bound_args)
{ {
typedef __bind<_F, _BoundArgs...> type; typedef __bind<_Fp, _BoundArgs...> type;
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); 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 inline _LIBCPP_INLINE_VISIBILITY
__bind_r<_R, _F, _BoundArgs...> __bind_r<_Rp, _Fp, _BoundArgs...>
bind(_F&& __f, _BoundArgs&&... __bound_args) bind(_Fp&& __f, _BoundArgs&&... __bound_args)
{ {
typedef __bind_r<_R, _F, _BoundArgs...> type; typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
} }
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS

File diff suppressed because it is too large Load Diff

View File

@ -55,45 +55,45 @@ namespace std // purposefully not versioned
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template<class _E> template<class _Ep>
class _LIBCPP_VISIBLE initializer_list class _LIBCPP_VISIBLE initializer_list
{ {
const _E* __begin_; const _Ep* __begin_;
size_t __size_; size_t __size_;
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
initializer_list(const _E* __b, size_t __s) _NOEXCEPT initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
: __begin_(__b), : __begin_(__b),
__size_(__s) __size_(__s)
{} {}
public: public:
typedef _E value_type; typedef _Ep value_type;
typedef const _E& reference; typedef const _Ep& reference;
typedef const _E& const_reference; typedef const _Ep& const_reference;
typedef size_t size_type; typedef size_t size_type;
typedef const _E* iterator; typedef const _Ep* iterator;
typedef const _E* const_iterator; typedef const _Ep* const_iterator;
_LIBCPP_ALWAYS_INLINE initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} _LIBCPP_ALWAYS_INLINE initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}
_LIBCPP_ALWAYS_INLINE size_t size() const _NOEXCEPT {return __size_;} _LIBCPP_ALWAYS_INLINE size_t size() const _NOEXCEPT {return __size_;}
_LIBCPP_ALWAYS_INLINE const _E* begin() const _NOEXCEPT {return __begin_;} _LIBCPP_ALWAYS_INLINE const _Ep* begin() const _NOEXCEPT {return __begin_;}
_LIBCPP_ALWAYS_INLINE const _E* end() const _NOEXCEPT {return __begin_ + __size_;} _LIBCPP_ALWAYS_INLINE const _Ep* end() const _NOEXCEPT {return __begin_ + __size_;}
}; };
template<class _E> template<class _Ep>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
const _E* const _Ep*
begin(initializer_list<_E> __il) _NOEXCEPT begin(initializer_list<_Ep> __il) _NOEXCEPT
{ {
return __il.begin(); return __il.begin();
} }
template<class _E> template<class _Ep>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
const _E* const _Ep*
end(initializer_list<_E> __il) _NOEXCEPT end(initializer_list<_Ep> __il) _NOEXCEPT
{ {
return __il.end(); return __il.end();
} }

View File

@ -277,10 +277,10 @@ public:
__iom_t7(_MoneyT& __mon, bool __intl) __iom_t7(_MoneyT& __mon, bool __intl)
: __mon_(__mon), __intl_(__intl) {} : __mon_(__mon), __intl_(__intl) {}
template <class _CharT, class _Traits, class _M> template <class _CharT, class _Traits, class _Mp>
friend friend
basic_istream<_CharT, _Traits>& 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> 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); typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<_CharT, _Traits> _I; typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef money_get<_CharT, _I> _F; typedef money_get<_CharT, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
const _F& __mf = use_facet<_F>(__is.getloc()); const _Fp& __mf = use_facet<_Fp>(__is.getloc());
__mf.get(_I(__is), _I(), __x.__intl_, __is, __err, __x.__mon_); __mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
__is.setstate(__err); __is.setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -337,10 +337,10 @@ public:
__iom_t8(const _MoneyT& __mon, bool __intl) __iom_t8(const _MoneyT& __mon, bool __intl)
: __mon_(__mon), __intl_(__intl) {} : __mon_(__mon), __intl_(__intl) {}
template <class _CharT, class _Traits, class _M> template <class _CharT, class _Traits, class _Mp>
friend friend
basic_ostream<_CharT, _Traits>& 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> 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); typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _O; typedef ostreambuf_iterator<_CharT, _Traits> _Op;
typedef money_put<_CharT, _O> _F; typedef money_put<_CharT, _Op> _Fp;
const _F& __mf = use_facet<_F>(__os.getloc()); const _Fp& __mf = use_facet<_Fp>(__os.getloc());
if (__mf.put(_O(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed()) if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
__os.setstate(ios_base::badbit); __os.setstate(ios_base::badbit);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -396,10 +396,10 @@ public:
__iom_t9(tm* __tm, const _CharT* __fmt) __iom_t9(tm* __tm, const _CharT* __fmt)
: __tm_(__tm), __fmt_(__fmt) {} : __tm_(__tm), __fmt_(__fmt) {}
template <class _C, class _Traits> template <class _Cp, class _Traits>
friend friend
basic_istream<_C, _Traits>& basic_istream<_Cp, _Traits>&
operator>>(basic_istream<_C, _Traits>& __is, const __iom_t9<_C>& __x); operator>>(basic_istream<_Cp, _Traits>& __is, const __iom_t9<_Cp>& __x);
}; };
template <class _CharT, class _Traits> 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); typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<_CharT, _Traits> _I; typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef time_get<_CharT, _I> _F; typedef time_get<_CharT, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
const _F& __tf = use_facet<_F>(__is.getloc()); const _Fp& __tf = use_facet<_Fp>(__is.getloc());
__tf.get(_I(__is), _I(), __is, __err, __x.__tm_, __tf.get(_Ip(__is), _Ip(), __is, __err, __x.__tm_,
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)); __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
__is.setstate(__err); __is.setstate(__err);
} }
@ -457,10 +457,10 @@ public:
__iom_t10(const tm* __tm, const _CharT* __fmt) __iom_t10(const tm* __tm, const _CharT* __fmt)
: __tm_(__tm), __fmt_(__fmt) {} : __tm_(__tm), __fmt_(__fmt) {}
template <class _C, class _Traits> template <class _Cp, class _Traits>
friend friend
basic_ostream<_C, _Traits>& basic_ostream<_Cp, _Traits>&
operator<<(basic_ostream<_C, _Traits>& __os, const __iom_t10<_C>& __x); operator<<(basic_ostream<_Cp, _Traits>& __os, const __iom_t10<_Cp>& __x);
}; };
template <class _CharT, class _Traits> 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); typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _O; typedef ostreambuf_iterator<_CharT, _Traits> _Op;
typedef time_put<_CharT, _O> _F; typedef time_put<_CharT, _Op> _Fp;
const _F& __tf = use_facet<_F>(__os.getloc()); const _Fp& __tf = use_facet<_Fp>(__os.getloc());
if (__tf.put(_O(__os), __os, __os.fill(), __x.__tm_, if (__tf.put(_Op(__os), __os, __os.fill(), __x.__tm_,
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed()) __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed())
__os.setstate(ios_base::badbit); __os.setstate(ios_base::badbit);
} }

View File

@ -271,10 +271,10 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _
__is.tie()->flush(); __is.tie()->flush();
if (!__noskipws && (__is.flags() & ios_base::skipws)) 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()); const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
_I __i(__is); _Ip __i(__is);
_I __eof; _Ip __eof;
for (; __i != __eof; ++__i) for (; __i != __eof; ++__i)
if (!__ct.is(__ct.space, *__i)) if (!__ct.is(__ct.space, *__i))
break; break;
@ -342,10 +342,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -369,10 +369,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -396,10 +396,10 @@ basic_istream<_CharT, _Traits>::operator>>(long& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -423,10 +423,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -450,10 +450,10 @@ basic_istream<_CharT, _Traits>::operator>>(long long& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -477,10 +477,10 @@ basic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -504,10 +504,10 @@ basic_istream<_CharT, _Traits>::operator>>(float& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -531,10 +531,10 @@ basic_istream<_CharT, _Traits>::operator>>(double& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -558,10 +558,10 @@ basic_istream<_CharT, _Traits>::operator>>(long double& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -585,10 +585,10 @@ basic_istream<_CharT, _Traits>::operator>>(bool& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -612,10 +612,10 @@ basic_istream<_CharT, _Traits>::operator>>(void*& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; 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); this->setstate(__err);
} }
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
@ -639,11 +639,11 @@ basic_istream<_CharT, _Traits>::operator>>(short& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
long __temp; 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()) if (__temp < numeric_limits<short>::min())
{ {
__err |= ios_base::failbit; __err |= ios_base::failbit;
@ -679,11 +679,11 @@ basic_istream<_CharT, _Traits>::operator>>(int& __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef istreambuf_iterator<char_type, traits_type> _I; typedef istreambuf_iterator<char_type, traits_type> _Ip;
typedef num_get<char_type, _I> _F; typedef num_get<char_type, _Ip> _Fp;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
long __temp; 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()) if (__temp < numeric_limits<int>::min())
{ {
__err |= ios_base::failbit; __err |= ios_base::failbit;

View File

@ -1039,9 +1039,9 @@ template <class _Iter>
__wrap_iter<_Iter> __wrap_iter<_Iter>
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT; 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 _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 _B1, class _B2> _B2 move_backward(_B1, _B1, _B2);
template <class _Tp> template <class _Tp>
@ -1212,9 +1212,9 @@ private:
__wrap_iter<_Iter1> __wrap_iter<_Iter1>
operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT; 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 _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 _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2);
template <class _Tp> 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) #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto auto
begin(_C& __c) -> decltype(__c.begin()) begin(_Cp& __c) -> decltype(__c.begin())
{ {
return __c.begin(); return __c.begin();
} }
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto auto
begin(const _C& __c) -> decltype(__c.begin()) begin(const _Cp& __c) -> decltype(__c.begin())
{ {
return __c.begin(); return __c.begin();
} }
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto auto
end(_C& __c) -> decltype(__c.end()) end(_Cp& __c) -> decltype(__c.end())
{ {
return __c.end(); return __c.end();
} }
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
auto auto
end(const _C& __c) -> decltype(__c.end()) end(const _Cp& __c) -> decltype(__c.end())
{ {
return __c.end(); return __c.end();
} }
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN) #else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
typename _C::iterator typename _Cp::iterator
begin(_C& __c) begin(_Cp& __c)
{ {
return __c.begin(); return __c.begin();
} }
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
typename _C::const_iterator typename _Cp::const_iterator
begin(const _C& __c) begin(const _Cp& __c)
{ {
return __c.begin(); return __c.begin();
} }
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
typename _C::iterator typename _Cp::iterator
end(_C& __c) end(_Cp& __c)
{ {
return __c.end(); return __c.end();
} }
template <class _C> template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
typename _C::const_iterator typename _Cp::const_iterator
end(const _C& __c) end(const _Cp& __c)
{ {
return __c.end(); return __c.end();
} }
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN) #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 inline _LIBCPP_INLINE_VISIBILITY
_T* _Tp*
begin(_T (&__array)[_N]) begin(_Tp (&__array)[_Np])
{ {
return __array; return __array;
} }
template <class _T, size_t _N> template <class _Tp, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
_T* _Tp*
end(_T (&__array)[_N]) end(_Tp (&__array)[_Np])
{ {
return __array + _N; return __array + _Np;
} }
_LIBCPP_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD

View File

@ -1195,8 +1195,8 @@ list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
splice(end(), __c); splice(end(), __c);
else else
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__c.begin()), _I(__c.end())); 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()) if (base::__node_alloc() != __c.__node_alloc())
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__c.begin()), _I(__c.end())); assign(_Ip(__c.begin()), _Ip(__c.end()));
} }
else else
__move_assign(__c, true_type()); __move_assign(__c, true_type());
@ -1286,8 +1286,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
" referring to this list"); " referring to this list");
#endif #endif
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold); __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; size_type __ds = 0;
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds; ++__ds;
@ -1379,8 +1379,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
{ {
size_type __ds = 0; size_type __ds = 0;
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
++__ds; ++__ds;
@ -1434,8 +1434,8 @@ void
list<_Tp, _Alloc>::push_front(const value_type& __x) list<_Tp, _Alloc>::push_front(const value_type& __x)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
__link_nodes(*base::__end_.__next_, *__hold, *__hold); __link_nodes(*base::__end_.__next_, *__hold, *__hold);
++base::__sz(); ++base::__sz();
@ -1447,8 +1447,8 @@ void
list<_Tp, _Alloc>::push_back(const value_type& __x) list<_Tp, _Alloc>::push_back(const value_type& __x)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
__link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold); __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
++base::__sz(); ++base::__sz();
@ -1462,8 +1462,8 @@ void
list<_Tp, _Alloc>::push_front(value_type&& __x) list<_Tp, _Alloc>::push_front(value_type&& __x)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); 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)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
__link_nodes(*base::__end_.__next_, *__hold, *__hold); __link_nodes(*base::__end_.__next_, *__hold, *__hold);
++base::__sz(); ++base::__sz();
@ -1475,8 +1475,8 @@ void
list<_Tp, _Alloc>::push_back(value_type&& __x) list<_Tp, _Alloc>::push_back(value_type&& __x)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); 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)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
__link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold); __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
++base::__sz(); ++base::__sz();
@ -1491,8 +1491,8 @@ void
list<_Tp, _Alloc>::emplace_front(_Args&&... __args) list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); 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)...); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
__link_nodes(*base::__end_.__next_, *__hold, *__hold); __link_nodes(*base::__end_.__next_, *__hold, *__hold);
++base::__sz(); ++base::__sz();
@ -1505,8 +1505,8 @@ void
list<_Tp, _Alloc>::emplace_back(_Args&&... __args) list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); 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)...); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
__link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold); __link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
++base::__sz(); ++base::__sz();
@ -1519,8 +1519,8 @@ typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args) list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
{ {
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold); __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"); " referring to this list");
#endif #endif
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold); __link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
@ -1708,8 +1708,8 @@ list<_Tp, _Alloc>::resize(size_type __n)
__n -= base::__sz(); __n -= base::__sz();
size_type __ds = 0; size_type __ds = 0;
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
++__ds; ++__ds;
@ -1767,8 +1767,8 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__n -= base::__sz(); __n -= base::__sz();
size_type __ds = 0; size_type __ds = 0;
__node_allocator& __na = base::__node_alloc(); __node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _D; typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _D> __hold(__node_alloc_traits::allocate(__na, 1), _D(__na, 1)); unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0; __hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds; ++__ds;

View File

@ -385,7 +385,7 @@ template <class _Key, class _Tp, class _Compare, bool = is_empty<_Compare>::valu
class __map_value_compare class __map_value_compare
: private _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; typedef pair<const _Key, _Tp> _CP;
public: public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@ -402,25 +402,25 @@ public:
bool operator()(const _CP& __x, const _CP& __y) const bool operator()(const _CP& __x, const _CP& __y) const
{return static_cast<const _Compare&>(*this)(__x.first, __y.first);} {return static_cast<const _Compare&>(*this)(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return static_cast<const _Compare&>(*this)(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _CP& __x, const _Key& __y) const bool operator()(const _CP& __x, const _Key& __y) const
{return static_cast<const _Compare&>(*this)(__x.first, __y);} {return static_cast<const _Compare&>(*this)(__x.first, __y);}
_LIBCPP_INLINE_VISIBILITY _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);} {return static_cast<const _Compare&>(*this)(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return static_cast<const _Compare&>(*this)(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return static_cast<const _Compare&>(*this)(__x.first, __y);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _CP& __y) const bool operator()(const _Key& __x, const _CP& __y) const
{return static_cast<const _Compare&>(*this)(__x, __y.first);} {return static_cast<const _Compare&>(*this)(__x, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return static_cast<const _Compare&>(*this)(__x, __y.first);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Key& __y) const bool operator()(const _Key& __x, const _Key& __y) const
@ -432,7 +432,7 @@ class __map_value_compare<_Key, _Tp, _Compare, false>
{ {
_Compare comp; _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; typedef pair<const _Key, _Tp> _CP;
public: public:
@ -451,25 +451,25 @@ public:
bool operator()(const _CP& __x, const _CP& __y) const bool operator()(const _CP& __x, const _CP& __y) const
{return comp(__x.first, __y.first);} {return comp(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return comp(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _CP& __x, const _Key& __y) const bool operator()(const _CP& __x, const _Key& __y) const
{return comp(__x.first, __y);} {return comp(__x.first, __y);}
_LIBCPP_INLINE_VISIBILITY _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);} {return comp(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return comp(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return comp(__x.first, __y);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _CP& __y) const bool operator()(const _Key& __x, const _CP& __y) const
{return comp(__x, __y.first);} {return comp(__x, __y.first);}
_LIBCPP_INLINE_VISIBILITY _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);} {return comp(__x, __y.first);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Key& __y) const bool operator()(const _Key& __x, const _Key& __y) const
@ -918,17 +918,17 @@ public:
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(_P&& __p) pair<iterator, bool> insert(_Pp&& __p)
{return __tree_.__insert_unique(_VSTD::forward<_P>(__p));} {return __tree_.__insert_unique(_VSTD::forward<_Pp>(__p));}
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __pos, _P&& __p) iterator insert(const_iterator __pos, _Pp&& __p)
{return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_P>(__p));} {return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_Pp>(__p));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@ -1006,8 +1006,8 @@ private:
typedef typename __base::__node_const_pointer __node_const_pointer; typedef typename __base::__node_const_pointer __node_const_pointer;
typedef typename __base::__node_base_pointer __node_base_pointer; typedef typename __base::__node_base_pointer __node_base_pointer;
typedef typename __base::__node_base_const_pointer __node_base_const_pointer; typedef typename __base::__node_base_const_pointer __node_base_const_pointer;
typedef __map_node_destructor<__node_allocator> _D; typedef __map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__node_holder __construct_node(); __node_holder __construct_node();
@ -1202,7 +1202,7 @@ typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
map<_Key, _Tp, _Compare, _Allocator>::__construct_node() map<_Key, _Tp, _Compare, _Allocator>::__construct_node()
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __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) map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__h.get_deleter().__second_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) map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args)
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...); __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) map<_Key, _Tp, _Compare, _Allocator>::__construct_node(const key_type& __k)
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
@ -1665,17 +1665,17 @@ public:
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(_P&& __p) iterator insert(_Pp&& __p)
{return __tree_.__insert_multi(_VSTD::forward<_P>(__p));} {return __tree_.__insert_multi(_VSTD::forward<_Pp>(__p));}
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __pos, _P&& __p) iterator insert(const_iterator __pos, _Pp&& __p)
{return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_P>(__p));} {return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_Pp>(__p));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@ -1748,8 +1748,8 @@ private:
typedef typename __base::__node_allocator __node_allocator; typedef typename __base::__node_allocator __node_allocator;
typedef typename __base::__node_pointer __node_pointer; typedef typename __base::__node_pointer __node_pointer;
typedef typename __base::__node_const_pointer __node_const_pointer; typedef typename __base::__node_const_pointer __node_const_pointer;
typedef __map_node_destructor<__node_allocator> _D; typedef __map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__node_holder __construct_node(); __node_holder __construct_node();
@ -1784,7 +1784,7 @@ typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node() multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node()
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __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) multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__h.get_deleter().__second_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) multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args)
{ {
__node_allocator& __na = __tree_.__node_alloc(); __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)); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);

View File

@ -1064,10 +1064,10 @@ struct __const_void_pointer<_Ptr, _Alloc, false>
#endif #endif
}; };
template <class _T> template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
_T* _Tp*
__to_raw_pointer(_T* __p) _NOEXCEPT __to_raw_pointer(_Tp* __p) _NOEXCEPT
{ {
return __p; return __p;
} }
@ -2517,20 +2517,20 @@ public:
"unique_ptr constructed with null function pointer deleter"); "unique_ptr constructed with null function pointer deleter");
} }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P, template <class _Pp,
class = typename enable_if<is_same<_P, pointer>::value>::type 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) : __ptr_(__p)
{ {
static_assert(!is_pointer<deleter_type>::value, static_assert(!is_pointer<deleter_type>::value,
"unique_ptr constructed with null function pointer deleter"); "unique_ptr constructed with null function pointer deleter");
} }
template <class _P, template <class _Pp,
class = typename enable_if<is_same<_P, pointer>::value>::type 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, is_reference<deleter_type>::value,
deleter_type, deleter_type,
typename add_lvalue_reference<const deleter_type>::type>::type __d) typename add_lvalue_reference<const deleter_type>::type>::type __d)
@ -2544,11 +2544,11 @@ public:
_NOEXCEPT _NOEXCEPT
: __ptr_(pointer(), __d) {} : __ptr_(pointer(), __d) {}
template <class _P, template <class _Pp,
class = typename enable_if<is_same<_P, pointer>::value || class = typename enable_if<is_same<_Pp, pointer>::value ||
is_same<_P, nullptr_t>::value>::type 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 _NOEXCEPT
: __ptr_(__p, _VSTD::move(__d)) : __ptr_(__p, _VSTD::move(__d))
{ {
@ -2628,10 +2628,10 @@ public:
} }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P, template <class _Pp,
class = typename enable_if<is_same<_P, pointer>::value>::type 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(); pointer __tmp = __ptr_.first();
__ptr_.first() = __p; __ptr_.first() = __p;
@ -3116,13 +3116,13 @@ public:
bool unique() const _NOEXCEPT {return use_count() == 1;} bool unique() const _NOEXCEPT {return use_count() == 1;}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
/*explicit*/ operator bool() const _NOEXCEPT {return get() != 0;} /*explicit*/ operator bool() const _NOEXCEPT {return get() != 0;}
template <class _U> template <class _Up>
_LIBCPP_INLINE_VISIBILITY _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_;} {return __cntrl_ < __p.__cntrl_;}
template <class _U> template <class _Up>
_LIBCPP_INLINE_VISIBILITY _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_;} {return __cntrl_ < __p.__cntrl_;}
#ifndef _LIBCPP_NO_RTTI #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 inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>& 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 //enum class
struct _LIBCPP_VISIBLE pointer_safety struct _LIBCPP_VISIBLE pointer_safety

View File

@ -464,23 +464,23 @@ private:
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _F> template <class _Fp>
class __call_once_param class __call_once_param
{ {
_F __f_; _Fp __f_;
public: public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {} explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {}
#else #else
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __call_once_param(const _F& __f) : __f_(__f) {} explicit __call_once_param(const _Fp& __f) : __f_(__f) {}
#endif #endif
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void operator()() 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()); __execute(_Index());
} }
@ -495,17 +495,17 @@ private:
#else #else
template <class _F> template <class _Fp>
class __call_once_param class __call_once_param
{ {
_F __f_; _Fp __f_;
public: public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {} explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {}
#else #else
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __call_once_param(const _F& __f) : __f_(__f) {} explicit __call_once_param(const _Fp& __f) : __f_(__f) {}
#endif #endif
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@ -517,11 +517,11 @@ public:
#endif #endif
template <class _F> template <class _Fp>
void void
__call_once_proxy(void* __vp) __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)(); (*__p)();
} }
@ -536,10 +536,10 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
{ {
if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul) if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
{ {
typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G; typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _Gp;
__call_once_param<_G> __p(_G(__decay_copy(_VSTD::forward<_Callable>(__func)), __call_once_param<_Gp> __p(_Gp(__decay_copy(_VSTD::forward<_Callable>(__func)),
__decay_copy(_VSTD::forward<_Args>(__args))...)); __decay_copy(_VSTD::forward<_Args>(__args))...));
__call_once(__flag.__state_, &__p, &__call_once_proxy<_G>); __call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>);
} }
} }

View File

@ -342,11 +342,11 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_typ
try try
{ {
#endif // _LIBCPP_NO_EXCEPTIONS #endif // _LIBCPP_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _I; typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef ostreambuf_iterator<_CharT, _Traits> _O; typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_I __i(__sb); _Ip __i(__sb);
_I __eof; _Ip __eof;
_O __o(*this); _Op __o(*this);
size_t __c = 0; size_t __c = 0;
for (; __i != __eof; ++__i, ++__o, ++__c) for (; __i != __eof; ++__i, ++__o, ++__c)
{ {
@ -388,8 +388,8 @@ basic_ostream<_CharT, _Traits>::operator<<(bool __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -415,8 +415,8 @@ basic_ostream<_CharT, _Traits>::operator<<(short __n)
if (__s) if (__s)
{ {
ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield;
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), if (__f.put(*this, *this, this->fill(),
__flags == ios_base::oct || __flags == ios_base::hex ? __flags == ios_base::oct || __flags == ios_base::hex ?
static_cast<long>(static_cast<unsigned short>(__n)) : static_cast<long>(static_cast<unsigned short>(__n)) :
@ -444,8 +444,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -471,8 +471,8 @@ basic_ostream<_CharT, _Traits>::operator<<(int __n)
if (__s) if (__s)
{ {
ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield; ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield;
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), if (__f.put(*this, *this, this->fill(),
__flags == ios_base::oct || __flags == ios_base::hex ? __flags == ios_base::oct || __flags == ios_base::hex ?
static_cast<long>(static_cast<unsigned int>(__n)) : static_cast<long>(static_cast<unsigned int>(__n)) :
@ -500,8 +500,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed()) if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -526,8 +526,8 @@ basic_ostream<_CharT, _Traits>::operator<<(long __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -552,8 +552,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -578,8 +578,8 @@ basic_ostream<_CharT, _Traits>::operator<<(long long __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -604,8 +604,8 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -630,8 +630,8 @@ basic_ostream<_CharT, _Traits>::operator<<(float __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed()) if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -656,8 +656,8 @@ basic_ostream<_CharT, _Traits>::operator<<(double __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -682,8 +682,8 @@ basic_ostream<_CharT, _Traits>::operator<<(long double __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); this->setstate(ios_base::badbit | ios_base::failbit);
} }
@ -708,8 +708,8 @@ basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _F; typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
const _F& __f = use_facet<_F>(this->getloc()); const _Fp& __f = use_facet<_Fp>(this->getloc());
if (__f.put(*this, *this, this->fill(), __n).failed()) if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit); 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); typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _I; typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
&__c, &__c,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
&__c + 1 : &__c + 1 :
@ -767,8 +767,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
if (__s) if (__s)
{ {
_CharT __c = __os.widen(__cn); _CharT __c = __os.widen(__cn);
typedef ostreambuf_iterator<_CharT, _Traits> _I; typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
&__c, &__c,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
&__c + 1 : &__c + 1 :
@ -799,8 +799,8 @@ operator<<(basic_ostream<char, _Traits>& __os, char __c)
typename basic_ostream<char, _Traits>::sentry __s(__os); typename basic_ostream<char, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<char, _Traits> _I; typedef ostreambuf_iterator<char, _Traits> _Ip;
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
&__c, &__c,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
&__c + 1 : &__c + 1 :
@ -831,8 +831,8 @@ operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
typename basic_ostream<char, _Traits>::sentry __s(__os); typename basic_ostream<char, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<char, _Traits> _I; typedef ostreambuf_iterator<char, _Traits> _Ip;
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
(char*)&__c, (char*)&__c,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
(char*)&__c + 1 : (char*)&__c + 1 :
@ -863,8 +863,8 @@ operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
typename basic_ostream<char, _Traits>::sentry __s(__os); typename basic_ostream<char, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<char, _Traits> _I; typedef ostreambuf_iterator<char, _Traits> _Ip;
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
(char*)&__c, (char*)&__c,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
(char*)&__c + 1 : (char*)&__c + 1 :
@ -895,9 +895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
typename basic_ostream<_CharT, _Traits>::sentry __s(__os); typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _I; typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
size_t __len = _Traits::length(__str); size_t __len = _Traits::length(__str);
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
__str, __str,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
__str + __len : __str + __len :
@ -928,7 +928,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
typename basic_ostream<_CharT, _Traits>::sentry __s(__os); typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _I; typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
size_t __len = char_traits<char>::length(__strn); size_t __len = char_traits<char>::length(__strn);
const int __bs = 100; const int __bs = 100;
_CharT __wbb[__bs]; _CharT __wbb[__bs];
@ -943,7 +943,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
} }
for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p) for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p)
*__p = __os.widen(*__strn); *__p = __os.widen(*__strn);
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
__wb, __wb,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
__wb + __len : __wb + __len :
@ -974,9 +974,9 @@ operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
typename basic_ostream<char, _Traits>::sentry __s(__os); typename basic_ostream<char, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<char, _Traits> _I; typedef ostreambuf_iterator<char, _Traits> _Ip;
size_t __len = _Traits::length(__str); size_t __len = _Traits::length(__str);
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
__str, __str,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
__str + __len : __str + __len :
@ -1007,9 +1007,9 @@ operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str)
typename basic_ostream<char, _Traits>::sentry __s(__os); typename basic_ostream<char, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<char, _Traits> _I; typedef ostreambuf_iterator<char, _Traits> _Ip;
size_t __len = _Traits::length((const char*)__str); size_t __len = _Traits::length((const char*)__str);
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
(const char*)__str, (const char*)__str,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
(const char*)__str + __len : (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); typename basic_ostream<char, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<char, _Traits> _I; typedef ostreambuf_iterator<char, _Traits> _Ip;
size_t __len = _Traits::length((const char*)__str); size_t __len = _Traits::length((const char*)__str);
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
(const char*)__str, (const char*)__str,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
(const char*)__str + __len : (const char*)__str + __len :
@ -1073,8 +1073,8 @@ basic_ostream<_CharT, _Traits>::put(char_type __c)
sentry __s(*this); sentry __s(*this);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _O; typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_O __o(*this); _Op __o(*this);
*__o = __c; *__o = __c;
if (__o.failed()) if (__o.failed())
this->setstate(ios_base::badbit); this->setstate(ios_base::badbit);
@ -1100,8 +1100,8 @@ basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
sentry __sen(*this); sentry __sen(*this);
if (__sen && __n) if (__sen && __n)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _O; typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_O __o(*this); _Op __o(*this);
for (; __n; --__n, ++__o, ++__s) for (; __n; --__n, ++__o, ++__s)
{ {
*__o = *__s; *__o = *__s;
@ -1240,9 +1240,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
typename basic_ostream<_CharT, _Traits>::sentry __s(__os); typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) if (__s)
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _I; typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
size_t __len = __str.size(); size_t __len = __str.size();
if (__pad_and_output(_I(__os), if (__pad_and_output(_Ip(__os),
__str.data(), __str.data(),
(__os.flags() & ios_base::adjustfield) == ios_base::left ? (__os.flags() & ios_base::adjustfield) == ios_base::left ?
__str.data() + __len : __str.data() + __len :
@ -1270,10 +1270,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
return __os << __ec.category().name() << ':' << __ec.value(); 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 inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>& 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(); return __os << __p.get();
} }

File diff suppressed because it is too large Load Diff

View File

@ -414,27 +414,27 @@ struct __ratio_less1
static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2; static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2;
}; };
template <class _R1, class _R2, bool _Odd, intmax_t _Q> template <class _R1, class _R2, bool _Odd, intmax_t _Qp>
struct __ratio_less1<_R1, _R2, _Odd, _Q, 0, _Q, 0> struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, 0>
{ {
static const bool value = false; static const bool value = false;
}; };
template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M2> template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M2>
struct __ratio_less1<_R1, _R2, _Odd, _Q, 0, _Q, _M2> struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, _M2>
{ {
static const bool value = !_Odd; 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>
struct __ratio_less1<_R1, _R2, _Odd, _Q, _M1, _Q, 0> struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, 0>
{ {
static const bool value = _Odd; 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> 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>, static const bool value = __ratio_less1<ratio<_R1::den, _M1>,
ratio<_R2::den, _M2>, !_Odd>::value; ratio<_R2::den, _M2>, !_Odd>::value;

View File

@ -2794,49 +2794,49 @@ private:
match_results<const _CharT*, _Allocator>& __m, match_results<const _CharT*, _Allocator>& __m,
regex_constants::match_flag_type __flags, bool) const; 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 friend
bool 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); regex_constants::match_flag_type);
template <class _A, class _C, class _T> template <class _Ap, class _Cp, class _Tp>
friend friend
bool bool
regex_search(const _C*, const _C*, match_results<const _C*, _A>&, regex_search(const _Cp*, const _Cp*, match_results<const _Cp*, _Ap>&,
const basic_regex<_C, _T>&, regex_constants::match_flag_type); 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 friend
bool bool
regex_search(_B, _B, const basic_regex<_C, _T>&, regex_search(_Bp, _Bp, const basic_regex<_Cp, _Tp>&,
regex_constants::match_flag_type); regex_constants::match_flag_type);
template <class _C, class _T> template <class _Cp, class _Tp>
friend friend
bool bool
regex_search(const _C*, const _C*, regex_search(const _Cp*, const _Cp*,
const basic_regex<_C, _T>&, regex_constants::match_flag_type); 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 friend
bool 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); regex_constants::match_flag_type);
template <class _ST, class _SA, class _C, class _T> template <class _ST, class _SA, class _Cp, class _Tp>
friend friend
bool bool
regex_search(const basic_string<_C, _ST, _SA>& __s, regex_search(const basic_string<_Cp, _ST, _SA>& __s,
const basic_regex<_C, _T>& __e, const basic_regex<_Cp, _Tp>& __e,
regex_constants::match_flag_type __flags); 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 friend
bool bool
regex_search(const basic_string<_C, _ST, _SA>& __s, regex_search(const basic_string<_Cp, _ST, _SA>& __s,
match_results<typename basic_string<_C, _ST, _SA>::const_iterator, _A>&, match_results<typename basic_string<_Cp, _ST, _SA>::const_iterator, _Ap>&,
const basic_regex<_C, _T>& __e, const basic_regex<_Cp, _Tp>& __e,
regex_constants::match_flag_type __flags); regex_constants::match_flag_type __flags);
template <class, class> friend class __lookahead; template <class, class> friend class __lookahead;
@ -5263,12 +5263,12 @@ public:
// swap: // swap:
void swap(match_results& __m); void swap(match_results& __m);
template <class _B, class _A> template <class _Bp, class _Ap>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void __assign(_BidirectionalIterator __f, _BidirectionalIterator __l, 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()); __matches_.resize(__m.size());
for (size_type __i = 0; __i < __matches_.size(); ++__i) for (size_type __i = 0; __i < __matches_.size(); ++__i)
{ {
@ -5297,16 +5297,16 @@ private:
template <class, class> friend class basic_regex; 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 friend
bool 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); regex_constants::match_flag_type);
template <class _B, class _A> template <class _Bp, class _Ap>
friend friend
bool 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; template <class, class> friend class __lookahead;
}; };
@ -5497,7 +5497,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
{ {
vector<__state> __states; vector<__state> __states;
ptrdiff_t __j = 0; ptrdiff_t __j = 0;
ptrdiff_t _N = _VSTD::distance(__first, __last); ptrdiff_t _Np = _VSTD::distance(__first, __last);
__node* __st = __start_.get(); __node* __st = __start_.get();
if (__st) if (__st)
{ {
@ -5563,7 +5563,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
{ {
deque<__state> __states; deque<__state> __states;
ptrdiff_t __highest_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(); __node* __st = __start_.get();
if (__st) if (__st)
{ {
@ -5588,7 +5588,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
if (!__matched || __highest_j < __s.__current_ - __s.__first_) if (!__matched || __highest_j < __s.__current_ - __s.__first_)
__highest_j = __s.__current_ - __s.__first_; __highest_j = __s.__current_ - __s.__first_;
__matched = true; __matched = true;
if (__highest_j == _N) if (__highest_j == _Np)
__states.clear(); __states.clear();
else else
__states.pop_back(); __states.pop_back();
@ -5643,7 +5643,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
__state __best_state; __state __best_state;
ptrdiff_t __j = 0; ptrdiff_t __j = 0;
ptrdiff_t __highest_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(); __node* __st = __start_.get();
if (__st) if (__st)
{ {
@ -5673,7 +5673,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
__best_state = __s; __best_state = __s;
} }
__matched = true; __matched = true;
if (__highest_j == _N) if (__highest_j == _Np)
__states.clear(); __states.clear();
else else
__states.pop_back(); __states.pop_back();
@ -6088,11 +6088,11 @@ public:
regex_constants::match_flag_type __m = regex_constants::match_flag_type __m =
regex_constants::match_default); regex_constants::match_default);
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template <size_t _N> template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a, regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b, _BidirectionalIterator __b,
const regex_type& __re, const regex_type& __re,
const int (&__submatches)[_N], const int (&__submatches)[_Np],
regex_constants::match_flag_type __m = regex_constants::match_flag_type __m =
regex_constants::match_default); regex_constants::match_default);
regex_token_iterator(const regex_token_iterator&); regex_token_iterator(const regex_token_iterator&);
@ -6194,15 +6194,15 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template <class _BidirectionalIterator, class _CharT, class _Traits> 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, _CharT, _Traits>::
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type& __re, const regex_type& __re,
const int (&__submatches)[_N], const int (&__submatches)[_Np],
regex_constants::match_flag_type __m) regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m), : __position_(__a, __b, __re, __m),
_N_(0), _N_(0),
__subs_(__submatches, __submatches + _N) __subs_(__submatches, __submatches + _Np)
{ {
__init(__a, __b); __init(__a, __b);
} }

View File

@ -419,10 +419,10 @@ public:
error_condition(int __val, const error_category& __cat) _NOEXCEPT error_condition(int __val, const error_category& __cat) _NOEXCEPT
: __val_(__val), __cat_(&__cat) {} : __val_(__val), __cat_(&__cat) {}
template <class _E> template <class _Ep>
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
error_condition(_E __e, error_condition(_Ep __e,
typename enable_if<is_error_condition_enum<_E>::value>::type* = 0 typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0
) _NOEXCEPT ) _NOEXCEPT
{*this = make_error_condition(__e);} {*this = make_error_condition(__e);}
@ -433,14 +433,14 @@ public:
__cat_ = &__cat; __cat_ = &__cat;
} }
template <class _E> template <class _Ep>
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
typename enable_if typename enable_if
< <
is_error_condition_enum<_E>::value, is_error_condition_enum<_Ep>::value,
error_condition& error_condition&
>::type >::type
operator=(_E __e) _NOEXCEPT operator=(_Ep __e) _NOEXCEPT
{*this = make_error_condition(__e); return *this;} {*this = make_error_condition(__e); return *this;}
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
@ -491,10 +491,10 @@ public:
error_code(int __val, const error_category& __cat) _NOEXCEPT error_code(int __val, const error_category& __cat) _NOEXCEPT
: __val_(__val), __cat_(&__cat) {} : __val_(__val), __cat_(&__cat) {}
template <class _E> template <class _Ep>
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
error_code(_E __e, error_code(_Ep __e,
typename enable_if<is_error_code_enum<_E>::value>::type* = 0 typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0
) _NOEXCEPT ) _NOEXCEPT
{*this = make_error_code(__e);} {*this = make_error_code(__e);}
@ -505,14 +505,14 @@ public:
__cat_ = &__cat; __cat_ = &__cat;
} }
template <class _E> template <class _Ep>
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE
typename enable_if typename enable_if
< <
is_error_code_enum<_E>::value, is_error_code_enum<_Ep>::value,
error_code& error_code&
>::type >::type
operator=(_E __e) _NOEXCEPT operator=(_Ep __e) _NOEXCEPT
{*this = make_error_code(__e); return *this;} {*this = make_error_code(__e); return *this;}
_LIBCPP_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE

View File

@ -267,15 +267,15 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
thread() : __t_(0) {} thread() : __t_(0) {}
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _F, class ..._Args, template <class _Fp, class ..._Args,
class = typename enable_if class = typename enable_if
< <
!is_same<typename decay<_F>::type, thread>::value !is_same<typename decay<_Fp>::type, thread>::value
>::type >::type
> >
explicit thread(_F&& __f, _Args&&... __args); explicit thread(_Fp&& __f, _Args&&... __args);
#else // _LIBCPP_HAS_NO_VARIADICS #else // _LIBCPP_HAS_NO_VARIADICS
template <class _F> explicit thread(_F __f); template <class _Fp> explicit thread(_Fp __f);
#endif #endif
~thread(); ~thread();
@ -322,34 +322,34 @@ __thread_specific_ptr<__thread_struct>& __thread_local_data();
#ifndef _LIBCPP_HAS_NO_VARIADICS #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 inline _LIBCPP_INLINE_VISIBILITY
void 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))...); __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
} }
template <class _F> template <class _Fp>
void* void*
__thread_proxy(void* __vp) __thread_proxy(void* __vp)
{ {
__thread_local_data().reset(new __thread_struct); __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));
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index; typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
__threaad_execute(*__p, _Index()); __threaad_execute(*__p, _Index());
return nullptr; return nullptr;
} }
template <class _F, class ..._Args, template <class _Fp, class ..._Args,
class class
> >
thread::thread(_F&& __f, _Args&&... __args) thread::thread(_Fp&& __f, _Args&&... __args)
{ {
typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G; typedef tuple<typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
_VSTD::unique_ptr<_G> __p(new _G(__decay_copy(_VSTD::forward<_F>(__f)), _VSTD::unique_ptr<_Gp> __p(new _Gp(__decay_copy(_VSTD::forward<_Fp>(__f)),
__decay_copy(_VSTD::forward<_Args>(__args))...)); __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) if (__ec == 0)
__p.release(); __p.release();
else else
@ -358,21 +358,21 @@ thread::thread(_F&& __f, _Args&&... __args)
#else // _LIBCPP_HAS_NO_VARIADICS #else // _LIBCPP_HAS_NO_VARIADICS
template <class _F> template <class _Fp>
void* void*
__thread_proxy(void* __vp) __thread_proxy(void* __vp)
{ {
__thread_local_data().reset(new __thread_struct); __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)(); (*__p)();
return nullptr; return nullptr;
} }
template <class _F> template <class _Fp>
thread::thread(_F __f) thread::thread(_Fp __f)
{ {
std::unique_ptr<_F> __p(new _F(__f)); std::unique_ptr<_Fp> __p(new _Fp(__f));
int __ec = pthread_create(&__t_, 0, &__thread_proxy<_F>, __p.get()); int __ec = pthread_create(&__t_, 0, &__thread_proxy<_Fp>, __p.get());
if (__ec == 0) if (__ec == 0)
__p.release(); __p.release();
else else

View File

@ -359,10 +359,10 @@ struct __all<>
static const bool value = true; static const bool value = true;
}; };
template <bool _B0, bool ... _B> template <bool _B0, bool ... _Bp>
struct __all<_B0, _B...> struct __all<_B0, _Bp...>
{ {
static const bool value = _B0 && __all<_B...>::value; static const bool value = _B0 && __all<_Bp...>::value;
}; };
// __tuple_impl // __tuple_impl
@ -577,12 +577,12 @@ public:
template <class _Alloc> template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc&, const tuple&) {} tuple(allocator_arg_t, const _Alloc&, const tuple&) {}
template <class _U> template <class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
tuple(array<_U, 0>) {} tuple(array<_Up, 0>) {}
template <class _Alloc, class _U> template <class _Alloc, class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc&, array<_U, 0>) {} tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void swap(tuple&) _NOEXCEPT {} void swap(tuple&) _NOEXCEPT {}
}; };
@ -684,14 +684,14 @@ forward_as_tuple(_Tp&&... __t)
return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...); return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
} }
template <size_t _I> template <size_t _Ip>
struct __tuple_equal struct __tuple_equal
{ {
template <class _Tp, class _Up> template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Up& __y) 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); return !(__x == __y);
} }
template <size_t _I> template <size_t _Ip>
struct __tuple_less struct __tuple_less
{ {
template <class _Tp, class _Up> template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Up& __y) bool operator()(const _Tp& __x, const _Up& __y)
{ {
return __tuple_less<_I-1>()(__x, __y) || return __tuple_less<_Ip-1>()(__x, __y) ||
(!__tuple_less<_I-1>()(__y, __x) && get<_I-1>(__x) < get<_I-1>(__y)); (!__tuple_less<_Ip-1>()(__y, __x) && get<_Ip-1>(__x) < get<_Ip-1>(__y));
} }
}; };
@ -835,7 +835,7 @@ tuple_cat()
return tuple<>(); 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; struct __tuple_cat_return_ref_imp;
template <class ..._Types, size_t ..._I0, class _Tuple0> template <class ..._Types, size_t ..._I0, class _Tuple0>

View File

@ -148,7 +148,7 @@ namespace std
_LIBCPP_BEGIN_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;}; struct _LIBCPP_VISIBLE conditional {typedef _If type;};
template <class _If, class _Then> template <class _If, class _Then>
struct _LIBCPP_VISIBLE conditional<false, _If, _Then> {typedef _Then type;}; struct _LIBCPP_VISIBLE conditional<false, _If, _Then> {typedef _Then type;};
@ -1418,215 +1418,215 @@ struct __member_pointer_traits_imp
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...), true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false>
{ {
typedef _Class _ClassType; typedef _Class _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false>
{ {
typedef _Class const _ClassType; typedef _Class const _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false>
{ {
typedef _Class volatile _ClassType; typedef _Class volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false>
{ {
typedef _Class const volatile _ClassType; typedef _Class const volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
#if __has_feature(cxx_reference_qualified_functions) #if __has_feature(cxx_reference_qualified_functions)
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) &, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false>
{ {
typedef _Class& _ClassType; typedef _Class& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false>
{ {
typedef _Class const& _ClassType; typedef _Class const& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) volatile&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false>
{ {
typedef _Class volatile& _ClassType; typedef _Class volatile& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const volatile&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false>
{ {
typedef _Class const volatile& _ClassType; typedef _Class const volatile& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) &&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false>
{ {
typedef _Class&& _ClassType; typedef _Class&& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const&&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false>
{ {
typedef _Class const&& _ClassType; typedef _Class const&& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) volatile&&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false>
{ {
typedef _Class volatile&& _ClassType; typedef _Class volatile&& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __member_pointer_traits_imp<_R (_Class::*)(_Param...) const volatile&&, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false>
{ {
typedef _Class const volatile&& _ClassType; typedef _Class const volatile&& _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
#endif // __has_feature(cxx_reference_qualified_functions) #endif // __has_feature(cxx_reference_qualified_functions)
#else // _LIBCPP_HAS_NO_VARIADICS #else // _LIBCPP_HAS_NO_VARIADICS
template <class _R, class _Class> template <class _Rp, class _Class>
struct __member_pointer_traits_imp<_R (_Class::*)(), true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false>
{ {
typedef _Class _ClassType; typedef _Class _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0> template <class _Rp, class _Class, class _P0>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0), true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false>
{ {
typedef _Class _ClassType; typedef _Class _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1> template <class _Rp, class _Class, class _P0, class _P1>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1), true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false>
{ {
typedef _Class _ClassType; typedef _Class _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1, class _P2> template <class _Rp, class _Class, class _P0, class _P1, class _P2>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2), true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false>
{ {
typedef _Class _ClassType; typedef _Class _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class> template <class _Rp, class _Class>
struct __member_pointer_traits_imp<_R (_Class::*)() const, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false>
{ {
typedef _Class const _ClassType; typedef _Class const _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0> template <class _Rp, class _Class, class _P0>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0) const, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false>
{ {
typedef _Class const _ClassType; typedef _Class const _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1> template <class _Rp, class _Class, class _P0, class _P1>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1) const, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false>
{ {
typedef _Class const _ClassType; typedef _Class const _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1, class _P2> template <class _Rp, class _Class, class _P0, class _P1, class _P2>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2) const, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false>
{ {
typedef _Class const _ClassType; typedef _Class const _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class> template <class _Rp, class _Class>
struct __member_pointer_traits_imp<_R (_Class::*)() volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false>
{ {
typedef _Class volatile _ClassType; typedef _Class volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0> template <class _Rp, class _Class, class _P0>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0) volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false>
{ {
typedef _Class volatile _ClassType; typedef _Class volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1> template <class _Rp, class _Class, class _P0, class _P1>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1) volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false>
{ {
typedef _Class volatile _ClassType; typedef _Class volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1, class _P2> template <class _Rp, class _Class, class _P0, class _P1, class _P2>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2) volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false>
{ {
typedef _Class volatile _ClassType; typedef _Class volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class> template <class _Rp, class _Class>
struct __member_pointer_traits_imp<_R (_Class::*)() const volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false>
{ {
typedef _Class const volatile _ClassType; typedef _Class const volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0> template <class _Rp, class _Class, class _P0>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0) const volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false>
{ {
typedef _Class const volatile _ClassType; typedef _Class const volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1> template <class _Rp, class _Class, class _P0, class _P1>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1) const volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false>
{ {
typedef _Class const volatile _ClassType; typedef _Class const volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _R, class _Class, class _P0, class _P1, class _P2> template <class _Rp, class _Class, class _P0, class _P1, class _P2>
struct __member_pointer_traits_imp<_R (_Class::*)(_P0, _P1, _P2) const volatile, true, false> struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false>
{ {
typedef _Class const volatile _ClassType; typedef _Class const volatile _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
template <class _R, class _Class> template <class _Rp, class _Class>
struct __member_pointer_traits_imp<_R _Class::*, false, true> struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
{ {
typedef _Class _ClassType; typedef _Class _ClassType;
typedef _R _ReturnType; typedef _Rp _ReturnType;
}; };
template <class _MP> template <class _MP>
@ -1673,21 +1673,21 @@ struct __result_of_mp<_MP, _Tp, true>
template <class _MP, class _Tp, bool> template <class _MP, class _Tp, bool>
struct __result_of_mdp; struct __result_of_mdp;
template <class _R, class _Class, class _Tp> template <class _Rp, class _Class, class _Tp>
struct __result_of_mdp<_R _Class::*, _Tp, false> 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> template <class _Rp, class _Class, class _Tp>
struct __result_of_mdp<_R _Class::*, _Tp, true> 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> template <class _Rp, class _Class, class _Tp>
struct __result_of_mp<_R _Class::*, _Tp, false> struct __result_of_mp<_Rp _Class::*, _Tp, false>
: public __result_of_mdp<_R _Class::*, _Tp, : public __result_of_mdp<_Rp _Class::*, _Tp,
is_base_of<_Class, typename remove_reference<_Tp>::type>::value> 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> template <class _MP, class _Tp, bool>
struct __result_of_mdp; struct __result_of_mdp;
template <class _R, class _Class, class _Tp> template <class _Rp, class _Class, class _Tp>
struct __result_of_mdp<_R _Class::*, _Tp, false> 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> template <class _Rp, class _Class, class _Tp>
struct __result_of_mdp<_R _Class::*, _Tp, true> 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> template <class _Rp, class _Class, class _Tp>
struct __result_of_mp<_R _Class::*, _Tp, false> struct __result_of_mp<_Rp _Class::*, _Tp, false>
: public __result_of_mdp<_R _Class::*, _Tp, : public __result_of_mdp<_Rp _Class::*, _Tp,
is_base_of<_Class, typename remove_reference<_Tp>::type>::value> 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 // function types are not constructible
template <class _R, class... _A1, class... _A2> template <class _Rp, class... _A1, class... _A2>
struct __is_constructible<false, _R(_A1...), _A2...> struct __is_constructible<false, _Rp(_A1...), _A2...>
: public false_type : public false_type
{}; {};
@ -1956,22 +1956,22 @@ struct _LIBCPP_VISIBLE is_constructible
// Array types are default constructible if their element type // Array types are default constructible if their element type
// is default constructible // is default constructible
template <class _A, size_t _N> template <class _Ap, size_t _Np>
struct __is_constructible<false, _A[_N]> struct __is_constructible<false, _Ap[_Np]>
: public is_constructible<typename remove_all_extents<_A>::type> : public is_constructible<typename remove_all_extents<_Ap>::type>
{}; {};
// Otherwise array types are not constructible by this syntax // Otherwise array types are not constructible by this syntax
template <class _A, size_t _N, class ..._Args> template <class _Ap, size_t _Np, class ..._Args>
struct __is_constructible<false, _A[_N], _Args...> struct __is_constructible<false, _Ap[_Np], _Args...>
: public false_type : public false_type
{}; {};
// Incomplete array types are not constructible // Incomplete array types are not constructible
template <class _A, class ..._Args> template <class _Ap, class ..._Args>
struct __is_constructible<false, _A[], _Args...> struct __is_constructible<false, _Ap[], _Args...>
: public false_type : 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 // Array types are default constructible if their element type
// is default constructible // is default constructible
template <class _A, size_t _N> template <class _Ap, size_t _Np>
struct __is_constructible0_imp<false, _A[_N]> struct __is_constructible0_imp<false, _Ap[_Np]>
: public is_constructible<typename remove_all_extents<_A>::type> : public is_constructible<typename remove_all_extents<_Ap>::type>
{}; {};
template <class _A, size_t _N, class _A0> template <class _Ap, size_t _Np, class _A0>
struct __is_constructible1_imp<false, _A[_N], _A0> struct __is_constructible1_imp<false, _Ap[_Np], _A0>
: public false_type : public false_type
{}; {};
template <class _A, size_t _N, class _A0, class _A1> template <class _Ap, size_t _Np, class _A0, class _A1>
struct __is_constructible2_imp<false, _A[_N], _A0, _A1> struct __is_constructible2_imp<false, _Ap[_Np], _A0, _A1>
: public false_type : public false_type
{}; {};
// Incomplete array types are not constructible // Incomplete array types are not constructible
template <class _A> template <class _Ap>
struct __is_constructible0_imp<false, _A[]> struct __is_constructible0_imp<false, _Ap[]>
: public false_type : public false_type
{}; {};
template <class _A, class _A0> template <class _Ap, class _A0>
struct __is_constructible1_imp<false, _A[], _A0> struct __is_constructible1_imp<false, _Ap[], _A0>
: public false_type : public false_type
{}; {};
template <class _A, class _A0, class _A1> template <class _Ap, class _A0, class _A1>
struct __is_constructible2_imp<false, _A[], _A0, _A1> struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
: public false_type : public false_type
{}; {};
@ -2761,134 +2761,134 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_trivial
// Check for complete types // Check for complete types
template <class ..._T> struct __check_complete; template <class ..._Tp> struct __check_complete;
template <> template <>
struct __check_complete<> struct __check_complete<>
{ {
}; };
template <class _H, class _T0, class ..._T> template <class _Hp, class _T0, class ..._Tp>
struct __check_complete<_H, _T0, _T...> struct __check_complete<_Hp, _T0, _Tp...>
: private __check_complete<_H>, : private __check_complete<_Hp>,
private __check_complete<_T0, _T...> private __check_complete<_T0, _Tp...>
{ {
}; };
template <class _H> template <class _Hp>
struct __check_complete<_H, _H> struct __check_complete<_Hp, _Hp>
: private __check_complete<_H> : private __check_complete<_Hp>
{ {
}; };
template <class _T> template <class _Tp>
struct __check_complete<_T> 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> template <class _Tp>
struct __check_complete<_T&> struct __check_complete<_Tp&>
: private __check_complete<_T> : private __check_complete<_Tp>
{ {
}; };
template <class _T> template <class _Tp>
struct __check_complete<_T&&> struct __check_complete<_Tp&&>
: private __check_complete<_T> : private __check_complete<_Tp>
{ {
}; };
template <class _R, class ..._Param> template <class _Rp, class ..._Param>
struct __check_complete<_R (*)(_Param...)> struct __check_complete<_Rp (*)(_Param...)>
: private __check_complete<_Param...> : private __check_complete<_Param...>
{ {
}; };
template <class _R, class ..._Param> template <class _Rp, class ..._Param>
struct __check_complete<_R (_Param...)> struct __check_complete<_Rp (_Param...)>
: private __check_complete<_Param...> : private __check_complete<_Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...)> struct __check_complete<_Rp (_Class::*)(_Param...)>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) const> struct __check_complete<_Rp (_Class::*)(_Param...) const>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) volatile> struct __check_complete<_Rp (_Class::*)(_Param...) volatile>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) const volatile> struct __check_complete<_Rp (_Class::*)(_Param...) const volatile>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
#if __has_feature(cxx_reference_qualified_functions) #if __has_feature(cxx_reference_qualified_functions)
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) &> struct __check_complete<_Rp (_Class::*)(_Param...) &>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) const&> struct __check_complete<_Rp (_Class::*)(_Param...) const&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) volatile&> struct __check_complete<_Rp (_Class::*)(_Param...) volatile&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) const volatile&> struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) &&> struct __check_complete<_Rp (_Class::*)(_Param...) &&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) const&&> struct __check_complete<_Rp (_Class::*)(_Param...) const&&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) volatile&&> struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
template <class _R, class _Class, class ..._Param> template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_R (_Class::*)(_Param...) const volatile&&> struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&>
: private __check_complete<_Class, _Param...> : private __check_complete<_Class, _Param...>
{ {
}; };
#endif #endif
template <class _R, class _Class> template <class _Rp, class _Class>
struct __check_complete<_R _Class::*> struct __check_complete<_Rp _Class::*>
: private __check_complete<_Class> : private __check_complete<_Class>
{ {
}; };
@ -2904,70 +2904,70 @@ __invoke(__any, _Args&& ...__args)
// bullets 1 and 2 // bullets 1 and 2
template <class _F, class _A0, class ..._Args> template <class _Fp, class _A0, class ..._Args>
auto 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)...)); -> 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 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)...)); -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
// bullets 3 and 4 // bullets 3 and 4
template <class _F, class _A0> template <class _Fp, class _A0>
auto auto
__invoke(_F&& __f, _A0&& __a0) __invoke(_Fp&& __f, _A0&& __a0)
-> decltype(_VSTD::forward<_A0>(__a0).*__f); -> decltype(_VSTD::forward<_A0>(__a0).*__f);
template <class _F, class _A0> template <class _Fp, class _A0>
auto auto
__invoke(_F&& __f, _A0&& __a0) __invoke(_Fp&& __f, _A0&& __a0)
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f); -> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
// bullet 5 // bullet 5
template <class _F, class ..._Args> template <class _Fp, class ..._Args>
auto auto
__invoke(_F&& __f, _Args&& ...__args) __invoke(_Fp&& __f, _Args&& ...__args)
-> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...)); -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));
// __invokable // __invokable
template <class _F, class ..._Args> template <class _Fp, class ..._Args>
struct __invokable_imp struct __invokable_imp
: private __check_complete<_F, _Args...> : private __check_complete<_Fp, _Args...>
{ {
typedef decltype( typedef decltype(
__invoke(_VSTD::declval<_F>(), _VSTD::declval<_Args>()...) __invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)
) type; ) type;
static const bool value = !is_same<type, __nat>::value; static const bool value = !is_same<type, __nat>::value;
}; };
template <class _F, class ..._Args> template <class _Fp, class ..._Args>
struct __invokable struct __invokable
: public integral_constant<bool, : public integral_constant<bool,
__invokable_imp<_F, _Args...>::value> __invokable_imp<_Fp, _Args...>::value>
{ {
}; };
// __invoke_of // __invoke_of
template <bool _Invokable, class _F, class ..._Args> template <bool _Invokable, class _Fp, class ..._Args>
struct __invoke_of_imp // false struct __invoke_of_imp // false
{ {
}; };
template <class _F, class ..._Args> template <class _Fp, class ..._Args>
struct __invoke_of_imp<true, _F, _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 struct __invoke_of
: public __invoke_of_imp<__invokable<_F, _Args...>::value, _F, _Args...> : public __invoke_of_imp<__invokable<_Fp, _Args...>::value, _Fp, _Args...>
{ {
}; };

View File

@ -644,8 +644,8 @@ private:
typedef typename __table::__node_traits __node_traits; typedef typename __table::__node_traits __node_traits;
typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node_allocator __node_allocator;
typedef typename __table::__node __node; typedef typename __table::__node __node;
typedef __hash_map_node_destructor<__node_allocator> _D; typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits; typedef allocator_traits<allocator_type> __alloc_traits;
public: public:
typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::pointer pointer;
@ -776,21 +776,21 @@ public:
pair<iterator, bool> insert(const value_type& __x) pair<iterator, bool> insert(const value_type& __x)
{return __table_.__insert_unique(__x);} {return __table_.__insert_unique(__x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(_P&& __x) pair<iterator, bool> insert(_Pp&& __x)
{return __table_.__insert_unique(_VSTD::forward<_P>(__x));} {return __table_.__insert_unique(_VSTD::forward<_Pp>(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x) iterator insert(const_iterator, const value_type& __x)
{return insert(__x).first;} {return insert(__x).first;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, _P&& __x) iterator insert(const_iterator, _Pp&& __x)
{return insert(_VSTD::forward<_P>(__x)).first;} {return insert(_VSTD::forward<_Pp>(__x)).first;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last); void insert(_InputIterator __first, _InputIterator __last);
@ -1065,7 +1065,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
_Args&&... __args) _Args&&... __args)
{ {
__node_allocator& __na = __table_.__node_alloc(); __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), __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
_VSTD::forward<_A0>(__a0)); _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __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) unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
{ {
__node_allocator& __na = __table_.__node_alloc(); __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_), __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
_VSTD::forward<_A0>(__a0)); _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __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) unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
{ {
__node_allocator& __na = __table_.__node_alloc(); __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); __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __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_traits __node_traits;
typedef typename __table::__node_allocator __node_allocator; typedef typename __table::__node_allocator __node_allocator;
typedef typename __table::__node __node; typedef typename __table::__node __node;
typedef __hash_map_node_destructor<__node_allocator> _D; typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _D> __node_holder; typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits; typedef allocator_traits<allocator_type> __alloc_traits;
public: public:
typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::pointer pointer;
@ -1395,21 +1395,21 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(_P&& __x) iterator insert(_Pp&& __x)
{return __table_.__insert_multi(_VSTD::forward<_P>(__x));} {return __table_.__insert_multi(_VSTD::forward<_Pp>(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, const value_type& __x) iterator insert(const_iterator __p, const value_type& __x)
{return __table_.__insert_multi(__p.__i_, __x);} {return __table_.__insert_multi(__p.__i_, __x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P, template <class _Pp,
class = typename enable_if<is_constructible<value_type, _P>::value>::type> class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, _P&& __x) iterator insert(const_iterator __p, _Pp&& __x)
{return __table_.__insert_multi(__p.__i_, _VSTD::forward<_P>(__x));} {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_Pp>(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last); void insert(_InputIterator __first, _InputIterator __last);
@ -1675,7 +1675,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
_A0&& __a0, _Args&&... __args) _A0&& __a0, _Args&&... __args)
{ {
__node_allocator& __na = __table_.__node_alloc(); __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), __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
_VSTD::forward<_A0>(__a0)); _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __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) unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
{ {
__node_allocator& __na = __table_.__node_alloc(); __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_), __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
_VSTD::forward<_A0>(__a0)); _VSTD::forward<_A0>(__a0));
__h.get_deleter().__first_constructed = true; __h.get_deleter().__first_constructed = true;

View File

@ -180,12 +180,12 @@ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardItera
return __first2; return __first2;
} }
template<class _Tp, size_t _N> template<class _Tp, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
void 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> template <class _Tp>

View File

@ -495,14 +495,14 @@ struct __bit_shift_right : binary_function<_Tp, _Tp, _Tp>
{return __x >> __y;} {return __x >> __y;}
}; };
template <class _Tp, class _F> template <class _Tp, class _Fp>
struct __apply_expr : unary_function<_Tp, _Tp> struct __apply_expr : unary_function<_Tp, _Tp>
{ {
private: private:
_F __f_; _Fp __f_;
public: public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit __apply_expr(_F __f) : __f_(__f) {} explicit __apply_expr(_Fp __f) : __f_(__f) {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const _Tp operator()(const _Tp& __x) const
@ -690,7 +690,7 @@ private:
ptrdiff_t __ul_; ptrdiff_t __ul_;
ptrdiff_t __sn_; ptrdiff_t __sn_;
ptrdiff_t __n_; 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); sizeof(ptrdiff_t) * __CHAR_BIT__ - 1);
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@ -699,8 +699,8 @@ private:
__size_(__e.size()), __size_(__e.size()),
__n_(__n) __n_(__n)
{ {
ptrdiff_t __neg_n = static_cast<ptrdiff_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_) >> _N); __sn_ = __neg_n | static_cast<ptrdiff_t>(static_cast<size_t>(-__n_) >> _Np);
__ul_ = ((__size_ - __n_) & ~__neg_n) | ((__n_ + 1) & __neg_n); __ul_ = ((__size_ - __n_) & ~__neg_n) | ((__n_ + 1) & __neg_n);
} }
public: public:
@ -709,7 +709,7 @@ public:
result_type operator[](size_t __j) const result_type operator[](size_t __j) const
{ {
ptrdiff_t __i = static_cast<size_t>(__j); 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); return (__expr_[(__i + __n_) & __m] & __m) | (value_type() & ~__m);
} }

View File

@ -1146,8 +1146,8 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
} }
else else
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__x.begin()), _I(__x.end())); 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()) if (__base::__alloc() != __c.__alloc())
{ {
typedef move_iterator<iterator> _I; typedef move_iterator<iterator> _Ip;
assign(_I(__c.begin()), _I(__c.end())); assign(_Ip(__c.begin()), _Ip(__c.end()));
} }
else else
__move_assign(__c, true_type()); __move_assign(__c, true_type());