Compare commits
25 Commits
release_30
...
centos5
Author | SHA1 | Date | |
---|---|---|---|
![]() |
96f126b9e8 | ||
![]() |
7c97b3ce6f | ||
![]() |
5415e8841d | ||
![]() |
7d0f6af56a | ||
![]() |
d2a2b14562 | ||
![]() |
e75965016d | ||
![]() |
3ba994d21e | ||
![]() |
76fe67f7a6 | ||
![]() |
d0a9c59bb9 | ||
![]() |
1a20e57e37 | ||
![]() |
a4dcf54b23 | ||
![]() |
bad86a1622 | ||
![]() |
4a4eaa3bf1 | ||
![]() |
b3fdb18d3f | ||
![]() |
619c2c22d8 | ||
![]() |
2d7ecd8fda | ||
![]() |
e3582e5899 | ||
![]() |
6facac3fe9 | ||
![]() |
ddab15593b | ||
![]() |
f596e63a0c | ||
![]() |
5ecb06d475 | ||
![]() |
297be35c48 | ||
![]() |
b3e839d7bc | ||
![]() |
a25261ee9c | ||
![]() |
5bd8211ac9 |
12
CREDITS.TXT
12
CREDITS.TXT
@@ -20,15 +20,3 @@ D: Minor patches and bug fixes.
|
||||
N: Bjorn Reese
|
||||
E: breese@users.sourceforge.net
|
||||
D: Initial regex prototype
|
||||
|
||||
N: David Chisnall
|
||||
E: theraven at theravensnest dot org
|
||||
D: FreeBSD port and libcxxrt support.
|
||||
|
||||
N: Ruben Van Boxem
|
||||
E: vanboxem dot ruben at gmail dot com
|
||||
D: Initial Windows patches.
|
||||
|
||||
N: Arvid Picciani
|
||||
E: aep at exys dot org
|
||||
D: Minor patches and musl port.
|
||||
|
38
Makefile
38
Makefile
@@ -15,9 +15,6 @@ else
|
||||
INSTALL_PREFIX="$(SDKROOT)"
|
||||
endif
|
||||
|
||||
help::
|
||||
echo Use make install DSTROOT=<destination>
|
||||
|
||||
installsrc:: $(SRCROOT)
|
||||
|
||||
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
||||
@@ -29,34 +26,13 @@ clean::
|
||||
|
||||
installhdrs::
|
||||
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext/*
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/include
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext/*
|
||||
|
||||
install:: installhdrs $(DESTDIR)
|
||||
|
||||
|
@@ -21,13 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
template <class _C, bool _IsConst> class __bit_iterator;
|
||||
template <class _C> class __bit_const_reference;
|
||||
|
||||
template <class _Tp>
|
||||
struct __has_storage_type
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template <class _C, bool = __has_storage_type<_C>::value>
|
||||
template <class _C>
|
||||
class __bit_reference
|
||||
{
|
||||
typedef typename _C::__storage_type __storage_type;
|
||||
@@ -72,11 +66,6 @@ private:
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
};
|
||||
|
||||
template <class _C>
|
||||
class __bit_reference<_C, false>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _C, class _D>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
@@ -153,25 +142,25 @@ __find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
// do middle whole words
|
||||
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
||||
if (*__first.__seg_)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(*__first.__seg_)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(*__first.__seg_)));
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
}
|
||||
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
||||
}
|
||||
@@ -187,11 +176,11 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = ~(*__first.__seg_ & __m);
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
@@ -200,7 +189,7 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
{
|
||||
__storage_type __b = ~*__first.__seg_;
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
}
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
@@ -208,7 +197,7 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = ~(*__first.__seg_ & __m);
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
}
|
||||
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
||||
}
|
||||
@@ -238,20 +227,20 @@ __count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__r = _VSTD::__pop_count(*__first.__seg_ & __m);
|
||||
__r = _STD::__pop_count(*__first.__seg_ & __m);
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
// do middle whole words
|
||||
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
||||
__r += _VSTD::__pop_count(*__first.__seg_);
|
||||
__r += _STD::__pop_count(*__first.__seg_);
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__r += _VSTD::__pop_count(*__first.__seg_ & __m);
|
||||
__r += _STD::__pop_count(*__first.__seg_ & __m);
|
||||
}
|
||||
return __r;
|
||||
}
|
||||
@@ -269,20 +258,20 @@ __count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__r = _VSTD::__pop_count(~(*__first.__seg_ & __m));
|
||||
__r = _STD::__pop_count(~(*__first.__seg_ & __m));
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
// do middle whole words
|
||||
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
||||
__r += _VSTD::__pop_count(~*__first.__seg_);
|
||||
__r += _STD::__pop_count(~*__first.__seg_);
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__r += _VSTD::__pop_count(~(*__first.__seg_ & __m));
|
||||
__r += _STD::__pop_count(~(*__first.__seg_ & __m));
|
||||
}
|
||||
return __r;
|
||||
}
|
||||
@@ -310,7 +299,7 @@ __fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
*__first.__seg_ &= ~__m;
|
||||
__n -= __dn;
|
||||
@@ -318,7 +307,7 @@ __fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
}
|
||||
// do middle whole words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
|
||||
_STD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
@@ -340,7 +329,7 @@ __fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
*__first.__seg_ |= __m;
|
||||
__n -= __dn;
|
||||
@@ -348,7 +337,7 @@ __fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
}
|
||||
// do middle whole words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
|
||||
_STD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
@@ -380,7 +369,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
fill(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, bool __value)
|
||||
{
|
||||
_VSTD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value);
|
||||
_STD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value);
|
||||
}
|
||||
|
||||
// copy
|
||||
@@ -401,7 +390,7 @@ __copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
@@ -415,7 +404,7 @@ __copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst
|
||||
// __first.__ctz_ == 0;
|
||||
// do middle words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
|
||||
_STD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
__result.__seg_ += __nw;
|
||||
// do last word
|
||||
@@ -448,12 +437,12 @@ __copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsCon
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz_f = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
|
||||
__storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
||||
*__result.__seg_ &= ~__m;
|
||||
if (__result.__ctz_ > __first.__ctz_)
|
||||
@@ -491,7 +480,7 @@ __copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsCon
|
||||
{
|
||||
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
__storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__storage_type __dn = _STD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
||||
*__result.__seg_ &= ~__m;
|
||||
*__result.__seg_ |= __b << __result.__ctz_;
|
||||
@@ -537,7 +526,7 @@ __copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C,
|
||||
// do first word
|
||||
if (__last.__ctz_ != 0)
|
||||
{
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
__n -= __dn;
|
||||
unsigned __clz = __bits_per_word - __last.__ctz_;
|
||||
__storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz);
|
||||
@@ -554,7 +543,7 @@ __copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C,
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
__result.__seg_ -= __nw;
|
||||
__last.__seg_ -= __nw;
|
||||
_VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
|
||||
_STD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last word
|
||||
if (__n > 0)
|
||||
@@ -584,13 +573,13 @@ __copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_
|
||||
// do first word
|
||||
if (__last.__ctz_ != 0)
|
||||
{
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
__n -= __dn;
|
||||
unsigned __clz_l = __bits_per_word - __last.__ctz_;
|
||||
__storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l);
|
||||
__storage_type __b = *__last.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min(__dn, static_cast<difference_type>(__result.__ctz_));
|
||||
__storage_type __ddn = _STD::min(__dn, static_cast<difference_type>(__result.__ctz_));
|
||||
if (__ddn > 0)
|
||||
{
|
||||
__m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r);
|
||||
@@ -634,7 +623,7 @@ __copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_
|
||||
__m = ~__storage_type(0) << (__bits_per_word - __n);
|
||||
__storage_type __b = *--__last.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__result.__ctz_));
|
||||
__storage_type __dn = _STD::min(__n, static_cast<difference_type>(__result.__ctz_));
|
||||
__m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r);
|
||||
*__result.__seg_ &= ~__m;
|
||||
*__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_);
|
||||
@@ -672,7 +661,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator<_C, false>
|
||||
move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result)
|
||||
{
|
||||
return _VSTD::copy(__first, __last, __result);
|
||||
return _STD::copy(__first, __last, __result);
|
||||
}
|
||||
|
||||
// move_backward
|
||||
@@ -682,17 +671,17 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator<_C, false>
|
||||
move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result)
|
||||
{
|
||||
return _VSTD::copy(__first, __last, __result);
|
||||
return _STD::copy(__first, __last, __result);
|
||||
}
|
||||
|
||||
// swap_ranges
|
||||
|
||||
template <class __C1, class __C2>
|
||||
__bit_iterator<__C2, false>
|
||||
__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
||||
__bit_iterator<__C2, false> __result)
|
||||
template <class _C1, class _C2>
|
||||
__bit_iterator<_C2, false>
|
||||
__swap_ranges_aligned(__bit_iterator<_C1, false> __first, __bit_iterator<_C1, false> __last,
|
||||
__bit_iterator<_C2, false> __result)
|
||||
{
|
||||
typedef __bit_iterator<__C1, false> _I1;
|
||||
typedef __bit_iterator<_C1, false> _I1;
|
||||
typedef typename _I1::difference_type difference_type;
|
||||
typedef typename _I1::__storage_type __storage_type;
|
||||
static const unsigned __bits_per_word = _I1::__bits_per_word;
|
||||
@@ -703,7 +692,7 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
||||
__storage_type __b1 = *__first.__seg_ & __m;
|
||||
@@ -737,12 +726,12 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <class __C1, class __C2>
|
||||
__bit_iterator<__C2, false>
|
||||
__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
||||
__bit_iterator<__C2, false> __result)
|
||||
template <class _C1, class _C2>
|
||||
__bit_iterator<_C2, false>
|
||||
__swap_ranges_unaligned(__bit_iterator<_C1, false> __first, __bit_iterator<_C1, false> __last,
|
||||
__bit_iterator<_C2, false> __result)
|
||||
{
|
||||
typedef __bit_iterator<__C1, false> _I1;
|
||||
typedef __bit_iterator<_C1, false> _I1;
|
||||
typedef typename _I1::difference_type difference_type;
|
||||
typedef typename _I1::__storage_type __storage_type;
|
||||
static const unsigned __bits_per_word = _I1::__bits_per_word;
|
||||
@@ -753,13 +742,13 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz_f = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b1 = *__first.__seg_ & __m;
|
||||
*__first.__seg_ &= ~__m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
|
||||
__storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
||||
__storage_type __b2 = *__result.__seg_ & __m;
|
||||
*__result.__seg_ &= ~__m;
|
||||
@@ -814,7 +803,7 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
|
||||
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b1 = *__first.__seg_ & __m;
|
||||
*__first.__seg_ &= ~__m;
|
||||
__storage_type __dn = _VSTD::min<__storage_type>(__n, __clz_r);
|
||||
__storage_type __dn = _STD::min<__storage_type>(__n, __clz_r);
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
||||
__storage_type __b2 = *__result.__seg_ & __m;
|
||||
*__result.__seg_ &= ~__m;
|
||||
@@ -837,11 +826,11 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <class __C1, class __C2>
|
||||
template <class _C1, class _C2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator<__C2, false>
|
||||
swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1,
|
||||
__bit_iterator<__C2, false> __first2)
|
||||
__bit_iterator<_C2, false>
|
||||
swap_ranges(__bit_iterator<_C1, false> __first1, __bit_iterator<_C1, false> __last1,
|
||||
__bit_iterator<_C2, false> __first2)
|
||||
{
|
||||
if (__first1.__ctz_ == __first2.__ctz_)
|
||||
return __swap_ranges_aligned(__first1, __last1, __first2);
|
||||
@@ -888,13 +877,13 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __
|
||||
if (__d1 <= __bit_array<_C>::capacity())
|
||||
{
|
||||
__bit_array<_C> __b(__d1);
|
||||
_VSTD::copy(__first, __middle, __b.begin());
|
||||
_VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first));
|
||||
_STD::copy(__first, __middle, __b.begin());
|
||||
_STD::copy(__b.begin(), __b.end(), _STD::copy(__middle, __last, __first));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
__bit_iterator<_C, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle);
|
||||
__bit_iterator<_C, false> __mp = _STD::swap_ranges(__first, __middle, __middle);
|
||||
__first = __middle;
|
||||
__middle = __mp;
|
||||
__d2 -= __d1;
|
||||
@@ -905,14 +894,14 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __
|
||||
if (__d2 <= __bit_array<_C>::capacity())
|
||||
{
|
||||
__bit_array<_C> __b(__d2);
|
||||
_VSTD::copy(__middle, __last, __b.begin());
|
||||
_VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last));
|
||||
_STD::copy(__middle, __last, __b.begin());
|
||||
_STD::copy_backward(__b.begin(), __b.end(), _STD::copy_backward(__first, __middle, __last));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
__bit_iterator<_C, false> __mp = __first + __d2;
|
||||
_VSTD::swap_ranges(__first, __mp, __middle);
|
||||
_STD::swap_ranges(__first, __mp, __middle);
|
||||
__first = __mp;
|
||||
__d1 -= __d2;
|
||||
}
|
||||
@@ -939,12 +928,12 @@ __equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __
|
||||
if (__first1.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz_f = __bits_per_word - __first1.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = *__first1.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __first2.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
|
||||
__storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
|
||||
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
||||
if (__first2.__ctz_ > __first1.__ctz_)
|
||||
if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_)))
|
||||
@@ -983,7 +972,7 @@ __equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __
|
||||
{
|
||||
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = *__first1.__seg_ & __m;
|
||||
__storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__storage_type __dn = _STD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
||||
if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_))
|
||||
return false;
|
||||
@@ -1017,7 +1006,7 @@ __equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __la
|
||||
if (__first1.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz = __bits_per_word - __first1.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
||||
if ((*__first2.__seg_ & __m) != (*__first1.__seg_ & __m))
|
||||
@@ -1213,15 +1202,15 @@ private:
|
||||
template <class _D, bool _IC> friend __bit_iterator<_D, false> copy_backward(__bit_iterator<_D, _IC> __first,
|
||||
__bit_iterator<_D, _IC> __last,
|
||||
__bit_iterator<_D, false> __result);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_unaligned(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class _C1, class _C2>friend __bit_iterator<_C2, false> __swap_ranges_aligned(__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C2, false>);
|
||||
template <class _C1, class _C2>friend __bit_iterator<_C2, false> __swap_ranges_unaligned(__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C2, false>);
|
||||
template <class _C1, class _C2>friend __bit_iterator<_C2, false> swap_ranges(__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C2, false>);
|
||||
template <class _D> friend __bit_iterator<_D, false> rotate(__bit_iterator<_D, false>,
|
||||
__bit_iterator<_D, false>,
|
||||
__bit_iterator<_D, false>);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#define _LIBCPP_VERSION 1001
|
||||
#define _LIBCPP_VERSION 1000
|
||||
|
||||
#define _LIBCPP_ABI_VERSION 1
|
||||
|
||||
@@ -50,10 +50,6 @@
|
||||
#ifdef _WIN32
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
// Compiler intrinsics (GCC or MSVC)
|
||||
# if (defined(_MSC_VER) && _MSC_VER >= 1400) || (__GNUC__ >= 4 && __GNUC_MINOR__ > 3)
|
||||
# define _LIBCP_HAS_IS_BASE_OF
|
||||
# endif
|
||||
#endif // _WIN32
|
||||
|
||||
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||
@@ -150,9 +146,6 @@ typedef __char32_t char32_t;
|
||||
|
||||
#if !(__has_feature(cxx_auto_type))
|
||||
#define _LIBCPP_HAS_NO_AUTO_TYPE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#endif
|
||||
|
||||
@@ -164,27 +157,10 @@ typedef __char32_t char32_t;
|
||||
#define _LIBCPP_HAS_NO_TRAILING_RETURN
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_generalized_initializers))
|
||||
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif
|
||||
|
||||
#if __has_feature(is_base_of)
|
||||
# define _LIBCP_HAS_IS_BASE_OF
|
||||
#endif
|
||||
|
||||
// Objective-C++ features (opt-in)
|
||||
#if __has_feature(objc_arc)
|
||||
#define _LIBCPP_HAS_OBJC_ARC
|
||||
#endif
|
||||
|
||||
#if __has_feature(objc_arc_weak)
|
||||
#define _LIBCPP_HAS_OBJC_ARC_WEAK
|
||||
#endif
|
||||
|
||||
// Inline namespaces are available in Clang regardless of C++ dialect.
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
|
||||
#define _LIBCPP_END_NAMESPACE_STD } }
|
||||
#define _VSTD std::_LIBCPP_NAMESPACE
|
||||
#define _STD std::_LIBCPP_NAMESPACE
|
||||
|
||||
namespace std {
|
||||
inline namespace _LIBCPP_NAMESPACE {
|
||||
@@ -203,10 +179,6 @@ namespace std {
|
||||
# define _NOEXCEPT_(x)
|
||||
#endif
|
||||
|
||||
#if __has_feature(underlying_type)
|
||||
# define _LIBCXX_UNDERLYING_TYPE(T) __underlying_type(T)
|
||||
#endif
|
||||
|
||||
// end defined(__clang__)
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
@@ -256,7 +228,6 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
|
||||
@@ -267,7 +238,7 @@ namespace std {
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
|
||||
#define _LIBCPP_END_NAMESPACE_STD } }
|
||||
#define _VSTD std::_LIBCPP_NAMESPACE
|
||||
#define _STD std::_LIBCPP_NAMESPACE
|
||||
|
||||
namespace std {
|
||||
namespace _LIBCPP_NAMESPACE {
|
||||
@@ -305,32 +276,4 @@ template <unsigned> struct __static_assert_check {};
|
||||
#define __has_feature(__x) 0
|
||||
#endif
|
||||
|
||||
#if __APPLE__ || __FreeBSD__ || _WIN32
|
||||
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
|
||||
#endif
|
||||
|
||||
#if __APPLE__ || __FreeBSD__
|
||||
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||
#endif
|
||||
|
||||
#if __APPLE__ || __FreeBSD__
|
||||
#define _LIBCPP_WCTYPE_IS_MASK
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_DEBUG2
|
||||
# if _LIBCPP_DEBUG2 == 0
|
||||
# define _LIBCPP_DEBUG_LEVEL 1
|
||||
# elif _LIBCPP_DEBUG2 == 1
|
||||
# define _LIBCPP_DEBUG_LEVEL 2
|
||||
# else
|
||||
# error Supported values for _LIBCPP_DEBUG2 are 0 and 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_DEBUG2
|
||||
# include <__debug>
|
||||
#else
|
||||
# define _LIBCPP_ASSERT(x, m) ((void)0)
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CONFIG
|
||||
|
191
include/__debug
191
include/__debug
@@ -1,191 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===--------------------------- __debug ----------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_DEBUG_H
|
||||
#define _LIBCPP_DEBUG_H
|
||||
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
|
||||
# include <cstdlib>
|
||||
# include <cstdio>
|
||||
# include <cstddef>
|
||||
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
|
||||
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
struct _LIBCPP_VISIBLE __c_node;
|
||||
|
||||
struct _LIBCPP_VISIBLE __i_node
|
||||
{
|
||||
void* __i_;
|
||||
__i_node* __next_;
|
||||
__c_node* __c_;
|
||||
|
||||
__i_node(const __i_node&) = delete;
|
||||
__i_node& operator=(const __i_node&) = delete;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__i_node(void* __i, __i_node* __next, __c_node* __c)
|
||||
: __i_(__i), __next_(__next), __c_(__c) {}
|
||||
~__i_node();
|
||||
};
|
||||
|
||||
struct _LIBCPP_VISIBLE __c_node
|
||||
{
|
||||
void* __c_;
|
||||
__c_node* __next_;
|
||||
__i_node** beg_;
|
||||
__i_node** end_;
|
||||
__i_node** cap_;
|
||||
|
||||
__c_node(const __c_node&) = delete;
|
||||
__c_node& operator=(const __c_node&) = delete;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__c_node(void* __c, __c_node* __next)
|
||||
: __c_(__c), __next_(__next), beg_(nullptr), end_(nullptr), cap_(nullptr) {}
|
||||
virtual ~__c_node();
|
||||
|
||||
virtual bool __dereferenceable(const void*) const = 0;
|
||||
virtual bool __decrementable(const void*) const = 0;
|
||||
virtual bool __addable(const void*, ptrdiff_t) const = 0;
|
||||
virtual bool __subscriptable(const void*, ptrdiff_t) const = 0;
|
||||
|
||||
void __add(__i_node* __i);
|
||||
_LIBCPP_HIDDEN void __remove(__i_node* __i);
|
||||
};
|
||||
|
||||
template <class _Cont>
|
||||
struct _C_node
|
||||
: public __c_node
|
||||
{
|
||||
_C_node(void* __c, __c_node* __n)
|
||||
: __c_node(__c, __n) {}
|
||||
|
||||
virtual bool __dereferenceable(const void*) const;
|
||||
virtual bool __decrementable(const void*) const;
|
||||
virtual bool __addable(const void*, ptrdiff_t) const;
|
||||
virtual bool __subscriptable(const void*, ptrdiff_t) const;
|
||||
};
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__dereferenceable(const void* __i) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__dereferenceable(__j);
|
||||
}
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__decrementable(const void* __i) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__decrementable(__j);
|
||||
}
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__addable(__j, __n);
|
||||
}
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__subscriptable(__j, __n);
|
||||
}
|
||||
|
||||
class _LIBCPP_VISIBLE __libcpp_db
|
||||
{
|
||||
__c_node** __cbeg_;
|
||||
__c_node** __cend_;
|
||||
size_t __csz_;
|
||||
__i_node** __ibeg_;
|
||||
__i_node** __iend_;
|
||||
size_t __isz_;
|
||||
|
||||
__libcpp_db();
|
||||
public:
|
||||
__libcpp_db(const __libcpp_db&) = delete;
|
||||
__libcpp_db& operator=(const __libcpp_db&) = delete;
|
||||
~__libcpp_db();
|
||||
|
||||
class __db_c_iterator;
|
||||
class __db_c_const_iterator;
|
||||
class __db_i_iterator;
|
||||
class __db_i_const_iterator;
|
||||
|
||||
__db_c_const_iterator __c_end() const;
|
||||
__db_i_const_iterator __i_end() const;
|
||||
|
||||
template <class _Cont>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __insert_c(_Cont* __c)
|
||||
{
|
||||
__c_node* __n = __insert_c(static_cast<void*>(__c));
|
||||
::new(__n) _C_node<_Cont>(__n->__c_, __n->__next_);
|
||||
}
|
||||
|
||||
void __insert_i(void* __i);
|
||||
__c_node* __insert_c(void* __c);
|
||||
void __erase_c(void* __c);
|
||||
|
||||
void __insert_ic(void* __i, const void* __c);
|
||||
void __iterator_copy(void* __i, const void* __i0);
|
||||
void __erase_i(void* __i);
|
||||
|
||||
void* __find_c_from_i(void* __i) const;
|
||||
void __invalidate_all(void* __c);
|
||||
__c_node* __find_c_and_lock(void* __c) const;
|
||||
__c_node* __find_c(void* __c) const;
|
||||
void unlock() const;
|
||||
|
||||
void swap(void* __c1, void* __c2);
|
||||
|
||||
|
||||
bool __dereferenceable(const void* __i) const;
|
||||
bool __decrementable(const void* __i) const;
|
||||
bool __addable(const void* __i, ptrdiff_t __n) const;
|
||||
bool __subscriptable(const void* __i, ptrdiff_t __n) const;
|
||||
bool __comparable(const void* __i, const void* __j) const;
|
||||
private:
|
||||
_LIBCPP_HIDDEN
|
||||
__i_node* __insert_iterator(void* __i);
|
||||
_LIBCPP_HIDDEN
|
||||
__i_node* __find_iterator(const void* __i) const;
|
||||
|
||||
friend _LIBCPP_VISIBLE __libcpp_db* __get_db();
|
||||
};
|
||||
|
||||
_LIBCPP_VISIBLE __libcpp_db* __get_db();
|
||||
_LIBCPP_VISIBLE const __libcpp_db* __get_const_db();
|
||||
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_DEBUG_H
|
||||
|
@@ -314,8 +314,8 @@ class __func<_F, _Alloc, _R()>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R()>* __clone() const;
|
||||
virtual void __clone(__base<_R()>*) const;
|
||||
virtual void destroy();
|
||||
@@ -396,9 +396,9 @@ class __func<_F, _Alloc, _R(_A0)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
: __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -479,9 +479,9 @@ class __func<_F, _Alloc, _R(_A0, _A1)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
: __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0, _A1)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0, _A1)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -562,9 +562,9 @@ class __func<_F, _Alloc, _R(_A0, _A1, _A2)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
: __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0, _A1, _A2)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0, _A1, _A2)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -831,7 +831,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R()>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -878,7 +878,7 @@ function<_R()>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R>
|
||||
@@ -1133,7 +1133,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_A0)>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1180,7 +1180,7 @@ function<_R(_A0)>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class _A0>
|
||||
@@ -1435,7 +1435,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_A0, _A1)>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1482,7 +1482,7 @@ function<_R(_A0, _A1)>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class _A0, class _A1>
|
||||
@@ -1737,7 +1737,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_A0, _A1, _A2)>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1784,7 +1784,7 @@ function<_R(_A0, _A1, _A2)>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class _A0, class _A1, class _A2>
|
||||
@@ -1909,7 +1909,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __mu_return1<true, _Ti, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
|
||||
{
|
||||
__ti(_VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
__ti(_STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
}
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
@@ -1947,7 +1947,7 @@ __mu(_Ti&, _Uj& __uj)
|
||||
// compiler bug workaround
|
||||
typename tuple_element<_Indx, _Uj>::type __t = get<_Indx>(__uj);
|
||||
return __t;
|
||||
// return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
|
||||
// return _STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
|
||||
}
|
||||
|
||||
template <class _Ti, class _Uj>
|
||||
@@ -2051,8 +2051,8 @@ class __bind
|
||||
public:
|
||||
template <class _G, class ..._BA>
|
||||
explicit __bind(_G&& __f, _BA&& ...__bound_args)
|
||||
: __f_(_VSTD::forward<_G>(__f)),
|
||||
__bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
: __f_(_STD::forward<_G>(__f)),
|
||||
__bound_args_(_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
@@ -2085,21 +2085,21 @@ public:
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
|
||||
: base(_VSTD::forward<_G>(__f),
|
||||
_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
: base(_STD::forward<_G>(__f),
|
||||
_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
result_type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||
return base::operator()(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
result_type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||
return base::operator()(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2112,7 +2112,7 @@ __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
template<class _R, class _F, class ..._BoundArgs>
|
||||
@@ -2121,7 +2121,7 @@ __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@@ -287,18 +287,18 @@ template <class _F, class _A0, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
|
||||
-> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
|
||||
return (_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
|
||||
-> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...);
|
||||
return ((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
// bullets 3 and 4
|
||||
@@ -307,18 +307,18 @@ template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype(_VSTD::forward<_A0>(__a0).*__f)
|
||||
-> decltype(_STD::forward<_A0>(__a0).*__f)
|
||||
{
|
||||
return _VSTD::forward<_A0>(__a0).*__f;
|
||||
return _STD::forward<_A0>(__a0).*__f;
|
||||
}
|
||||
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
|
||||
-> decltype((*_STD::forward<_A0>(__a0)).*__f)
|
||||
{
|
||||
return (*_VSTD::forward<_A0>(__a0)).*__f;
|
||||
return (*_STD::forward<_A0>(__a0)).*__f;
|
||||
}
|
||||
|
||||
// bullet 5
|
||||
@@ -327,15 +327,15 @@ template <class _F, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _Args&& ...__args)
|
||||
-> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...))
|
||||
-> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return _VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...);
|
||||
return _STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _Tp, class ..._Args>
|
||||
struct __invoke_return
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_Args>()...)) type;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
typename __invoke_of<type&, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args) const
|
||||
{
|
||||
return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
|
||||
return __invoke(get(), _STD::forward<_ArgTypes>(__args)...);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -842,7 +842,7 @@ struct __4th_helper
|
||||
template <class _T1, class _R>
|
||||
struct __4th_helper<_T1, _R, true>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _R>::type type;
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
@@ -959,13 +959,13 @@ struct __invoke_return
|
||||
template <class _F>
|
||||
struct __invoke_return<_F, false>
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_F>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_F>())) type;
|
||||
};
|
||||
|
||||
template <class _Tp, class _A0>
|
||||
struct __invoke_return0
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>())) type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _A0>
|
||||
@@ -983,16 +983,16 @@ struct __invoke_return0<_R _T::*, _A0*>
|
||||
template <class _Tp, class _A0, class _A1>
|
||||
struct __invoke_return1
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
|
||||
_VSTD::declval<_A1>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>(),
|
||||
_STD::declval<_A1>())) type;
|
||||
};
|
||||
|
||||
template <class _Tp, class _A0, class _A1, class _A2>
|
||||
struct __invoke_return2
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
|
||||
_VSTD::declval<_A1>(),
|
||||
_VSTD::declval<_A2>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>(),
|
||||
_STD::declval<_A1>(),
|
||||
_STD::declval<_A2>())) type;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
size_t __next_prime(size_t __n);
|
||||
size_t __next_prime(size_t);
|
||||
|
||||
template <class _NodePtr>
|
||||
struct __hash_node_base
|
||||
@@ -54,12 +54,11 @@ struct __hash_node
|
||||
value_type __value_;
|
||||
};
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
|
||||
template <class _ConstNodePtr> class __hash_const_iterator;
|
||||
template <class _HashIterator> class __hash_map_iterator;
|
||||
template <class _HashIterator> class __hash_map_const_iterator;
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
class _LIBCPP_VISIBLE unordered_map;
|
||||
template <class, class, class, class> class __hash_table;
|
||||
template <class> class __hash_const_iterator;
|
||||
template <class> class __hash_map_iterator;
|
||||
template <class> class __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> class _LIBCPP_VISIBLE unordered_map;
|
||||
|
||||
template <class _NodePtr>
|
||||
class _LIBCPP_VISIBLE __hash_iterator
|
||||
@@ -86,7 +85,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
|
||||
pointer operator->() const {return _STD::addressof(__node_->__value_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_iterator& operator++()
|
||||
@@ -164,7 +163,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
|
||||
pointer operator->() const {return _STD::addressof(__node_->__value_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_iterator& operator++()
|
||||
@@ -200,7 +199,7 @@ private:
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
||||
};
|
||||
|
||||
template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class> class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
|
||||
template <class _NodePtr>
|
||||
class _LIBCPP_VISIBLE __hash_local_iterator
|
||||
@@ -388,7 +387,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator(__bucket_list_deallocator&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __data_(_VSTD::move(__x.__data_))
|
||||
: __data_(_STD::move(__x.__data_))
|
||||
{
|
||||
__x.size() = 0;
|
||||
}
|
||||
@@ -412,7 +411,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Alloc> class __hash_map_node_destructor;
|
||||
template <class> class __hash_map_node_destructor;
|
||||
|
||||
template <class _Alloc>
|
||||
class __hash_node_destructor
|
||||
@@ -432,17 +431,16 @@ public:
|
||||
bool __value_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_node_destructor(allocator_type& __na,
|
||||
bool __constructed = false) _NOEXCEPT
|
||||
explicit __hash_node_destructor(allocator_type& __na) _NOEXCEPT
|
||||
: __na_(__na),
|
||||
__value_constructed(__constructed)
|
||||
__value_constructed(false)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__value_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
|
||||
if (__p)
|
||||
__alloc_traits::deallocate(__na_, __p, 1);
|
||||
}
|
||||
@@ -689,7 +687,7 @@ public:
|
||||
return __bc != 0 ? (float)size() / __bc : 0.f;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
|
||||
{max_load_factor() = _VSTD::max(__mlf, load_factor());}
|
||||
{max_load_factor() = _STD::max(__mlf, load_factor());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY local_iterator begin(size_type __n)
|
||||
{return local_iterator(__bucket_list_[__n], __n, bucket_count());}
|
||||
@@ -742,8 +740,8 @@ private:
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{
|
||||
__bucket_list_.get_deleter().__alloc() =
|
||||
_VSTD::move(__u.__bucket_list_.get_deleter().__alloc());
|
||||
__node_alloc() = _VSTD::move(__u.__node_alloc());
|
||||
_STD::move(__u.__bucket_list_.get_deleter().__alloc());
|
||||
__node_alloc() = _STD::move(__u.__node_alloc());
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
|
||||
@@ -770,7 +768,7 @@ private:
|
||||
__swap_alloc(_A& __x, _A& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_A>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
@@ -860,15 +858,15 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
|
||||
is_nothrow_move_constructible<__first_node>::value &&
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value)
|
||||
: __bucket_list_(_VSTD::move(__u.__bucket_list_)),
|
||||
__p1_(_VSTD::move(__u.__p1_)),
|
||||
__p2_(_VSTD::move(__u.__p2_)),
|
||||
__p3_(_VSTD::move(__u.__p3_))
|
||||
: __bucket_list_(_STD::move(__u.__bucket_list_)),
|
||||
__p1_(_STD::move(__u.__p1_)),
|
||||
__p2_(_STD::move(__u.__p2_)),
|
||||
__p3_(_STD::move(__u.__p3_))
|
||||
{
|
||||
if (size() > 0)
|
||||
{
|
||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
__u.__p1_.first().__next_ = nullptr;
|
||||
__u.size() = 0;
|
||||
}
|
||||
@@ -879,8 +877,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
|
||||
const allocator_type& __a)
|
||||
: __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
|
||||
__p1_(__node_allocator(__a)),
|
||||
__p2_(0, _VSTD::move(__u.hash_function())),
|
||||
__p3_(_VSTD::move(__u.__p3_))
|
||||
__p2_(0, _STD::move(__u.hash_function())),
|
||||
__p3_(_STD::move(__u.__p3_))
|
||||
{
|
||||
if (__a == allocator_type(__u.__node_alloc()))
|
||||
{
|
||||
@@ -892,7 +890,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
|
||||
__p1_.first().__next_ = __u.__p1_.first().__next_;
|
||||
__u.__p1_.first().__next_ = nullptr;
|
||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
size() = __u.size();
|
||||
__u.size() = 0;
|
||||
}
|
||||
@@ -946,7 +944,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
|
||||
while (__np != nullptr)
|
||||
{
|
||||
__node_pointer __next = __np->__next_;
|
||||
__node_traits::destroy(__na, _VSTD::addressof(__np->__value_));
|
||||
__node_traits::destroy(__na, _STD::addressof(__np->__value_));
|
||||
__node_traits::deallocate(__na, __np, 1);
|
||||
__np = __next;
|
||||
}
|
||||
@@ -982,14 +980,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
||||
__u.__bucket_list_.get_deleter().size() = 0;
|
||||
__move_assign_alloc(__u);
|
||||
size() = __u.size();
|
||||
hash_function() = _VSTD::move(__u.hash_function());
|
||||
hash_function() = _STD::move(__u.hash_function());
|
||||
max_load_factor() = __u.max_load_factor();
|
||||
key_eq() = _VSTD::move(__u.key_eq());
|
||||
key_eq() = _STD::move(__u.key_eq());
|
||||
__p1_.first().__next_ = __u.__p1_.first().__next_;
|
||||
if (size() > 0)
|
||||
{
|
||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
__u.__p1_.first().__next_ = nullptr;
|
||||
__u.size() = 0;
|
||||
}
|
||||
@@ -1004,8 +1002,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
||||
__move_assign(__u, true_type());
|
||||
else
|
||||
{
|
||||
hash_function() = _VSTD::move(__u.hash_function());
|
||||
key_eq() = _VSTD::move(__u.key_eq());
|
||||
hash_function() = _STD::move(__u.hash_function());
|
||||
key_eq() = _STD::move(__u.key_eq());
|
||||
max_load_factor() = __u.max_load_factor();
|
||||
if (bucket_count() != 0)
|
||||
{
|
||||
@@ -1017,7 +1015,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
||||
const_iterator __i = __u.begin();
|
||||
while (__cache != nullptr && __u.size() != 0)
|
||||
{
|
||||
__cache->__value_ = _VSTD::move(__u.remove(__i++)->__value_);
|
||||
__cache->__value_ = _STD::move(__u.remove(__i++)->__value_);
|
||||
__node_pointer __next = __cache->__next_;
|
||||
__node_insert_multi(__cache);
|
||||
__cache = __next;
|
||||
@@ -1036,7 +1034,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
||||
while (__u.size() != 0)
|
||||
{
|
||||
__node_holder __h =
|
||||
__construct_node(_VSTD::move(__u.remove(__i++)->__value_));
|
||||
__construct_node(_STD::move(__u.remove(__i++)->__value_));
|
||||
__node_insert_multi(__h.get());
|
||||
__h.release();
|
||||
}
|
||||
@@ -1169,7 +1167,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT
|
||||
__deallocate(__p1_.first().__next_);
|
||||
__p1_.first().__next_ = nullptr;
|
||||
size_type __bc = bucket_count();
|
||||
for (size_type __i = 0; __i < __bc; ++__i)
|
||||
for (size_type __i; __i < __bc; ++__i)
|
||||
__bucket_list_[__i] = nullptr;
|
||||
size() = 0;
|
||||
}
|
||||
@@ -1202,7 +1200,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
|
||||
{
|
||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||
{
|
||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
||||
rehash(_STD::max<size_type>(2 * __bc + 1,
|
||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||
__bc = bucket_count();
|
||||
__chash = __nd->__hash_ % __bc;
|
||||
@@ -1211,7 +1209,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
|
||||
__node_pointer __pn = __bucket_list_[__chash];
|
||||
if (__pn == nullptr)
|
||||
{
|
||||
__pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
__pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
__nd->__next_ = __pn->__next_;
|
||||
__pn->__next_ = __nd;
|
||||
// fix up __bucket_list_
|
||||
@@ -1241,7 +1239,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
|
||||
size_type __bc = bucket_count();
|
||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||
{
|
||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
||||
rehash(_STD::max<size_type>(2 * __bc + 1,
|
||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||
__bc = bucket_count();
|
||||
}
|
||||
@@ -1249,7 +1247,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
|
||||
__node_pointer __pn = __bucket_list_[__chash];
|
||||
if (__pn == nullptr)
|
||||
{
|
||||
__pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
__pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
__cp->__next_ = __pn->__next_;
|
||||
__pn->__next_ = __cp;
|
||||
// fix up __bucket_list_
|
||||
@@ -1302,7 +1300,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
|
||||
size_type __bc = bucket_count();
|
||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||
{
|
||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
||||
rehash(_STD::max<size_type>(2 * __bc + 1,
|
||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||
__bc = bucket_count();
|
||||
}
|
||||
@@ -1346,7 +1344,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
|
||||
__node_holder __h = __construct_node(__x, __hash);
|
||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||
{
|
||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
||||
rehash(_STD::max<size_type>(2 * __bc + 1,
|
||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||
__bc = bucket_count();
|
||||
__chash = __hash % __bc;
|
||||
@@ -1355,7 +1353,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
|
||||
__node_pointer __pn = __bucket_list_[__chash];
|
||||
if (__pn == nullptr)
|
||||
{
|
||||
__pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
__pn = static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
__h->__next_ = __pn->__next_;
|
||||
__pn->__next_ = __h.get();
|
||||
// fix up __bucket_list_
|
||||
@@ -1385,7 +1383,7 @@ template <class... _Args>
|
||||
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique(_Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
pair<iterator, bool> __r = __node_insert_unique(__h.get());
|
||||
if (__r.second)
|
||||
__h.release();
|
||||
@@ -1397,7 +1395,7 @@ template <class... _Args>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_multi(_Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __node_insert_multi(__h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1409,7 +1407,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
|
||||
const_iterator __p, _Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __node_insert_multi(__p, __h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1422,7 +1420,7 @@ template <class _P>
|
||||
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_P&& __x)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_P>(__x));
|
||||
__node_holder __h = __construct_node(_STD::forward<_P>(__x));
|
||||
pair<iterator, bool> __r = __node_insert_unique(__h.get());
|
||||
if (__r.second)
|
||||
__h.release();
|
||||
@@ -1438,7 +1436,7 @@ template <class _P>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_P&& __x)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_P>(__x));
|
||||
__node_holder __h = __construct_node(_STD::forward<_P>(__x));
|
||||
iterator __r = __node_insert_multi(__h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1450,7 +1448,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
|
||||
_P&& __x)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_P>(__x));
|
||||
__node_holder __h = __construct_node(_STD::forward<_P>(__x));
|
||||
iterator __r = __node_insert_multi(__p, __h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1485,13 +1483,13 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n)
|
||||
{
|
||||
__n = __next_prime(_VSTD::max<size_type>(__n, size() > 0));
|
||||
__n = __next_prime(_STD::max<size_type>(__n, size() > 0));
|
||||
size_type __bc = bucket_count();
|
||||
if (__n > __bc)
|
||||
__rehash(__n);
|
||||
else
|
||||
{
|
||||
__n = _VSTD::max<size_type>
|
||||
__n = _STD::max<size_type>
|
||||
(
|
||||
__n,
|
||||
__next_prime(size_t(ceil(float(size()) / max_load_factor())))
|
||||
@@ -1513,7 +1511,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
|
||||
{
|
||||
for (size_type __i = 0; __i < __nbc; ++__i)
|
||||
__bucket_list_[__i] = nullptr;
|
||||
__node_pointer __pp(static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())));
|
||||
__node_pointer __pp(static_cast<__node_pointer>(_STD::addressof(__p1_.first())));
|
||||
__node_pointer __cp = __pp->__next_;
|
||||
if (__cp != nullptr)
|
||||
{
|
||||
@@ -1613,7 +1611,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_Args>(__args)...);
|
||||
__h.get_deleter().__value_constructed = true;
|
||||
__h->__hash_ = hash_function()(__h->__value_);
|
||||
__h->__next_ = nullptr;
|
||||
@@ -1629,11 +1627,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::move(__v));
|
||||
__h.get_deleter().__value_constructed = true;
|
||||
__h->__hash_ = __hash;
|
||||
__h->__next_ = nullptr;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1644,11 +1642,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
|
||||
__h.get_deleter().__value_constructed = true;
|
||||
__h->__hash_ = hash_function()(__h->__value_);
|
||||
__h->__next_ = nullptr;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1660,11 +1658,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
|
||||
__h.get_deleter().__value_constructed = true;
|
||||
__h->__hash_ = __hash;
|
||||
__h->__next_ = nullptr;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
@@ -1738,7 +1736,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
|
||||
// Fix up __bucket_list_
|
||||
// if __pn is not in same bucket (before begin is not in same bucket) &&
|
||||
// if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
|
||||
if (__pn == _VSTD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
|
||||
if (__pn == _STD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
|
||||
{
|
||||
if (__cn->__next_ == nullptr || __cn->__next_->__hash_ % __bc != __chash)
|
||||
__bucket_list_[__chash] = nullptr;
|
||||
@@ -1754,7 +1752,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
|
||||
__pn->__next_ = __cn->__next_;
|
||||
__cn->__next_ = nullptr;
|
||||
--size();
|
||||
return __node_holder(__cn, _D(__node_alloc(), true));
|
||||
return __node_holder(__cn, _D(__node_alloc()));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
@@ -1869,19 +1867,19 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
|
||||
__bucket_list_.reset(__u.__bucket_list_.release());
|
||||
__u.__bucket_list_.reset(__npp);
|
||||
}
|
||||
_VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
|
||||
_STD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
|
||||
__swap_alloc(__bucket_list_.get_deleter().__alloc(),
|
||||
__u.__bucket_list_.get_deleter().__alloc());
|
||||
__swap_alloc(__node_alloc(), __u.__node_alloc());
|
||||
_VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
|
||||
_STD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
|
||||
__p2_.swap(__u.__p2_);
|
||||
__p3_.swap(__u.__p3_);
|
||||
if (size() > 0)
|
||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||
static_cast<__node_pointer>(_STD::addressof(__p1_.first()));
|
||||
if (__u.size() > 0)
|
||||
__u.__bucket_list_[__u.__p1_.first().__next_->__hash_ % __u.bucket_count()] =
|
||||
static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
|
||||
static_cast<__node_pointer>(_STD::addressof(__u.__p1_.first()));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
|
@@ -19,11 +19,7 @@
|
||||
#include <cstdint>
|
||||
#include <cctype>
|
||||
#include <locale.h>
|
||||
#if _WIN32
|
||||
# include <support/win32/locale_win32.h>
|
||||
#elif (__GLIBC__ || __APPLE__ || __FreeBSD__)
|
||||
# include <xlocale.h>
|
||||
#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD_
|
||||
#include <xlocale.h>
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -141,10 +137,10 @@ locale
|
||||
locale::combine(const locale& __other) const
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (!_VSTD::has_facet<_Facet>(__other))
|
||||
if (!_STD::has_facet<_Facet>(__other))
|
||||
throw runtime_error("locale::combine: locale missing facet");
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other)));
|
||||
return locale(*this, &const_cast<_Facet&>(_STD::use_facet<_Facet>(__other)));
|
||||
}
|
||||
|
||||
template <class _Facet>
|
||||
@@ -231,18 +227,18 @@ collate<_CharT>::do_compare(const char_type* __lo1, const char_type* __hi1,
|
||||
|
||||
template <class _CharT>
|
||||
long
|
||||
collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
|
||||
collate<_CharT>::do_hash(const char_type* lo, const char_type* hi) const
|
||||
{
|
||||
size_t __h = 0;
|
||||
const size_t __sr = __CHAR_BIT__ * sizeof(size_t) - 8;
|
||||
const size_t __mask = size_t(0xF) << (__sr + 4);
|
||||
for(const char_type* __p = __lo; __p != __hi; ++__p)
|
||||
size_t h = 0;
|
||||
const size_t sr = __CHAR_BIT__ * sizeof(size_t) - 8;
|
||||
const size_t mask = size_t(0xF) << (sr + 4);
|
||||
for(const char_type* p = lo; p != hi; ++p)
|
||||
{
|
||||
__h = (__h << 4) + *__p;
|
||||
size_t __g = __h & __mask;
|
||||
__h ^= __g | (__g >> __sr);
|
||||
h = (h << 4) + *p;
|
||||
size_t g = h & mask;
|
||||
h ^= g | (g >> sr);
|
||||
}
|
||||
return static_cast<long>(__h);
|
||||
return static_cast<long>(h);
|
||||
}
|
||||
|
||||
extern template class _LIBCPP_VISIBLE collate<char>;
|
||||
@@ -296,7 +292,7 @@ bool
|
||||
locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
|
||||
const basic_string<_CharT, _Traits, _Allocator>& __y) const
|
||||
{
|
||||
return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare(
|
||||
return _STD::use_facet<_STD::collate<_CharT> >(*this).compare(
|
||||
__x.data(), __x.data() + __x.size(),
|
||||
__y.data(), __y.data() + __y.size()) < 0;
|
||||
}
|
||||
@@ -306,36 +302,9 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
|
||||
class _LIBCPP_VISIBLE ctype_base
|
||||
{
|
||||
public:
|
||||
#if __GLIBC__
|
||||
typedef unsigned short mask;
|
||||
static const mask space = _ISspace;
|
||||
static const mask print = _ISprint;
|
||||
static const mask cntrl = _IScntrl;
|
||||
static const mask upper = _ISupper;
|
||||
static const mask lower = _ISlower;
|
||||
static const mask alpha = _ISalpha;
|
||||
static const mask digit = _ISdigit;
|
||||
static const mask punct = _ISpunct;
|
||||
static const mask xdigit = _ISxdigit;
|
||||
static const mask blank = _ISblank;
|
||||
#elif _WIN32
|
||||
typedef unsigned short mask;
|
||||
static const mask space = _SPACE;
|
||||
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
|
||||
static const mask cntrl = _CONTROL;
|
||||
static const mask upper = _UPPER;
|
||||
static const mask lower = _LOWER;
|
||||
static const mask alpha = _ALPHA;
|
||||
static const mask digit = _DIGIT;
|
||||
static const mask punct = _PUNCT;
|
||||
static const mask xdigit = _HEX;
|
||||
static const mask blank = _BLANK;
|
||||
#elif (__APPLE__ || __FreeBSD__)
|
||||
#if __APPLE__
|
||||
typedef __uint32_t mask;
|
||||
#elif __FreeBSD__
|
||||
typedef unsigned long mask;
|
||||
#endif
|
||||
|
||||
#if __APPLE__
|
||||
static const mask space = _CTYPE_S;
|
||||
static const mask print = _CTYPE_R;
|
||||
static const mask cntrl = _CTYPE_C;
|
||||
@@ -346,19 +315,18 @@ public:
|
||||
static const mask punct = _CTYPE_P;
|
||||
static const mask xdigit = _CTYPE_X;
|
||||
static const mask blank = _CTYPE_B;
|
||||
#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
|
||||
typedef unsigned long mask;
|
||||
static const mask space = 1<<0;
|
||||
static const mask print = 1<<1;
|
||||
static const mask cntrl = 1<<2;
|
||||
static const mask upper = 1<<3;
|
||||
static const mask lower = 1<<4;
|
||||
static const mask alpha = 1<<5;
|
||||
static const mask digit = 1<<6;
|
||||
static const mask punct = 1<<7;
|
||||
static const mask xdigit = 1<<8;
|
||||
static const mask blank = 1<<9;
|
||||
#endif // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
|
||||
#else // __APPLE__
|
||||
static const mask space = _ISspace;
|
||||
static const mask print = _ISprint;
|
||||
static const mask cntrl = _IScntrl;
|
||||
static const mask upper = _ISupper;
|
||||
static const mask lower = _ISlower;
|
||||
static const mask alpha = _ISalpha;
|
||||
static const mask digit = _ISdigit;
|
||||
static const mask punct = _ISpunct;
|
||||
static const mask xdigit = _ISxdigit;
|
||||
static const mask blank = _ISblank;
|
||||
#endif // __APPLE__
|
||||
static const mask alnum = alpha | digit;
|
||||
static const mask graph = alnum | punct;
|
||||
|
||||
@@ -483,7 +451,7 @@ public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool is(mask __m, char_type __c) const
|
||||
{
|
||||
return isascii(__c) ? __tab_[__c] & __m : false;
|
||||
return isascii(__c) ? (__tab_ ? __tab_[__c] & __m : isctype(__c, __m)) : false;
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
@@ -569,10 +537,6 @@ public:
|
||||
#endif
|
||||
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
||||
static const mask* classic_table() _NOEXCEPT;
|
||||
#if defined(__GLIBC__)
|
||||
static const int* __classic_upper_table() _NOEXCEPT;
|
||||
static const int* __classic_lower_table() _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
~ctype();
|
||||
|
@@ -21,8 +21,8 @@
|
||||
#ifdef _LIBCPP_SHARED_LOCK
|
||||
|
||||
namespace ting {
|
||||
template <class _Mutex> class shared_lock;
|
||||
template <class _Mutex> class upgrade_lock;
|
||||
template <class> class shared_lock;
|
||||
template <class> class upgrade_lock;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_SHARED_LOCK
|
||||
@@ -190,8 +190,8 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unique_lock& __u)
|
||||
{
|
||||
_VSTD::swap(__m_, __u.__m_);
|
||||
_VSTD::swap(__owns_, __u.__owns_);
|
||||
_STD::swap(__m_, __u.__m_);
|
||||
_STD::swap(__owns_, __u.__owns_);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex_type* release()
|
||||
@@ -429,7 +429,7 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
|
||||
_Predicate __pred)
|
||||
{
|
||||
return wait_until(__lk, chrono::steady_clock::now() + __d,
|
||||
_VSTD::move(__pred));
|
||||
_STD::move(__pred));
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -141,14 +141,14 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__split_buffer& __c, true_type)
|
||||
void __move_assign_alloc(const __split_buffer& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _VSTD::move(__c.__alloc());
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__split_buffer& __c, false_type) _NOEXCEPT
|
||||
void __move_assign_alloc(const __split_buffer& __c, false_type) _NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -162,7 +162,7 @@ private:
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n)
|
||||
__alloc_rr& __a = this->__alloc();
|
||||
do
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_));
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), value_type());
|
||||
++this->__end_;
|
||||
--__n;
|
||||
} while (__n > 0);
|
||||
@@ -227,7 +227,7 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_referen
|
||||
__alloc_rr& __a = this->__alloc();
|
||||
do
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), __x);
|
||||
++this->__end_;
|
||||
--__n;
|
||||
} while (__n > 0);
|
||||
@@ -249,14 +249,14 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIt
|
||||
if (__end_ == __end_cap())
|
||||
{
|
||||
size_type __old_cap = __end_cap() - __first_;
|
||||
size_type __new_cap = _VSTD::max<size_type>(2 * __old_cap, 8);
|
||||
size_type __new_cap = _STD::max<size_type>(2 * __old_cap, 8);
|
||||
__split_buffer __buf(__new_cap, 0, __a);
|
||||
for (pointer __p = __begin_; __p != __end_; ++__p, ++__buf.__end_)
|
||||
__alloc_traits::construct(__buf.__alloc(),
|
||||
_VSTD::__to_raw_pointer(__buf.__end_), _VSTD::move(*__p));
|
||||
_STD::__to_raw_pointer(__buf.__end_), _STD::move(*__p));
|
||||
swap(__buf);
|
||||
}
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
|
||||
++this->__end_;
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _F
|
||||
__alloc_rr& __a = this->__alloc();
|
||||
for (; __first != __last; ++__first)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
|
||||
++this->__end_;
|
||||
}
|
||||
}
|
||||
@@ -356,10 +356,10 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
|
||||
template <class _Tp, class _Allocator>
|
||||
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __first_(_VSTD::move(__c.__first_)),
|
||||
__begin_(_VSTD::move(__c.__begin_)),
|
||||
__end_(_VSTD::move(__c.__end_)),
|
||||
__end_cap_(_VSTD::move(__c.__end_cap_))
|
||||
: __first_(_STD::move(__c.__first_)),
|
||||
__begin_(_STD::move(__c.__begin_)),
|
||||
__end_(_STD::move(__c.__end_)),
|
||||
__end_cap_(_STD::move(__c.__end_cap_))
|
||||
{
|
||||
__c.__first_ = nullptr;
|
||||
__c.__begin_ = nullptr;
|
||||
@@ -421,10 +421,10 @@ __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{
|
||||
_VSTD::swap(__first_, __x.__first_);
|
||||
_VSTD::swap(__begin_, __x.__begin_);
|
||||
_VSTD::swap(__end_, __x.__end_);
|
||||
_VSTD::swap(__end_cap(), __x.__end_cap());
|
||||
_STD::swap(__first_, __x.__first_);
|
||||
_STD::swap(__begin_, __x.__begin_);
|
||||
_STD::swap(__end_, __x.__end_);
|
||||
_STD::swap(__end_cap(), __x.__end_cap());
|
||||
__swap_alloc(__alloc(), __x.__alloc());
|
||||
}
|
||||
|
||||
@@ -437,10 +437,10 @@ __split_buffer<_Tp, _Allocator>::reserve(size_type __n)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__n, 0, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,10 +458,10 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
__t.__end_ = __t.__begin_ + (__end_ - __begin_);
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
@@ -481,7 +481,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
|
||||
{
|
||||
difference_type __d = __end_cap() - __end_;
|
||||
__d = (__d + 1) / 2;
|
||||
__begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__begin_ = _STD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__end_ += __d;
|
||||
}
|
||||
else
|
||||
@@ -490,13 +490,13 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__begin_-1), __x);
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__begin_-1), __x);
|
||||
--__begin_;
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
|
||||
{
|
||||
difference_type __d = __end_cap() - __end_;
|
||||
__d = (__d + 1) / 2;
|
||||
__begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__begin_ = _STD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__end_ += __d;
|
||||
}
|
||||
else
|
||||
@@ -521,14 +521,14 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__begin_-1),
|
||||
_VSTD::move(__x));
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__begin_-1),
|
||||
_STD::move(__x));
|
||||
--__begin_;
|
||||
}
|
||||
|
||||
@@ -545,7 +545,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
{
|
||||
difference_type __d = __begin_ - __first_;
|
||||
__d = (__d + 1) / 2;
|
||||
__end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
|
||||
__end_ = _STD::move(__begin_, __end_, __begin_ - __d);
|
||||
__begin_ -= __d;
|
||||
}
|
||||
else
|
||||
@@ -554,13 +554,13 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_), __x);
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_), __x);
|
||||
++__end_;
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
{
|
||||
difference_type __d = __begin_ - __first_;
|
||||
__d = (__d + 1) / 2;
|
||||
__end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
|
||||
__end_ = _STD::move(__begin_, __end_, __begin_ - __d);
|
||||
__begin_ -= __d;
|
||||
}
|
||||
else
|
||||
@@ -585,14 +585,14 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
|
||||
_VSTD::move(__x));
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_),
|
||||
_STD::move(__x));
|
||||
++__end_;
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
{
|
||||
difference_type __d = __begin_ - __first_;
|
||||
__d = (__d + 1) / 2;
|
||||
__end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
|
||||
__end_ = _STD::move(__begin_, __end_, __begin_ - __d);
|
||||
__begin_ -= __d;
|
||||
}
|
||||
else
|
||||
@@ -618,14 +618,14 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
++__end_;
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ typename __stdinbuf<_CharT>::int_type
|
||||
__stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
{
|
||||
char __extbuf[__limit];
|
||||
int __nread = _VSTD::max(1, __encoding_);
|
||||
int __nread = _STD::max(1, __encoding_);
|
||||
for (int __i = 0; __i < __nread; ++__i)
|
||||
{
|
||||
char __c = getc(__file_);
|
||||
@@ -120,7 +120,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
&__1buf, &__1buf + 1, __inxt);
|
||||
switch (__r)
|
||||
{
|
||||
case _VSTD::codecvt_base::ok:
|
||||
case _STD::codecvt_base::ok:
|
||||
break;
|
||||
case codecvt_base::partial:
|
||||
__st_ = __sv_st;
|
||||
@@ -136,11 +136,11 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
break;
|
||||
case codecvt_base::error:
|
||||
return traits_type::eof();
|
||||
case _VSTD::codecvt_base::noconv:
|
||||
case _STD::codecvt_base::noconv:
|
||||
__1buf = static_cast<char_type>(__extbuf[0]);
|
||||
break;
|
||||
}
|
||||
} while (__r == _VSTD::codecvt_base::partial);
|
||||
} while (__r == _STD::codecvt_base::partial);
|
||||
}
|
||||
if (!__consume)
|
||||
{
|
||||
@@ -166,9 +166,9 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
|
||||
switch (__cv_->out(__st_, &__ci, &__ci + 1, __inxt,
|
||||
__extbuf, __extbuf + sizeof(__extbuf), __enxt))
|
||||
{
|
||||
case _VSTD::codecvt_base::ok:
|
||||
case _STD::codecvt_base::ok:
|
||||
break;
|
||||
case _VSTD::codecvt_base::noconv:
|
||||
case _STD::codecvt_base::noconv:
|
||||
__extbuf[0] = static_cast<char>(__c);
|
||||
__enxt = __extbuf + 1;
|
||||
break;
|
||||
@@ -288,12 +288,12 @@ __stdoutbuf<_CharT>::sync()
|
||||
__r = __cv_->unshift(__st_, __extbuf,
|
||||
__extbuf + sizeof(__extbuf),
|
||||
__extbe);
|
||||
if (__r == codecvt_base::error)
|
||||
return -1;
|
||||
size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
|
||||
if (fwrite(__extbuf, 1, __nmemb, __file_) != __nmemb)
|
||||
return -1;
|
||||
} while (__r == codecvt_base::partial);
|
||||
if (__r == codecvt_base::error)
|
||||
return -1;
|
||||
if (fflush(__file_))
|
||||
return -1;
|
||||
return 0;
|
||||
|
@@ -21,19 +21,13 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator> class __tree;
|
||||
template <class _Tp, class _NodePtr, class _DiffType>
|
||||
class _LIBCPP_VISIBLE __tree_iterator;
|
||||
template <class _Tp, class _ConstNodePtr, class _DiffType>
|
||||
class _LIBCPP_VISIBLE __tree_const_iterator;
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
class _LIBCPP_VISIBLE map;
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
class _LIBCPP_VISIBLE multimap;
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
class _LIBCPP_VISIBLE set;
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
class _LIBCPP_VISIBLE multiset;
|
||||
template <class, class, class> class __tree;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE __tree_iterator;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE __tree_const_iterator;
|
||||
template <class, class, class, class> class _LIBCPP_VISIBLE map;
|
||||
template <class, class, class, class> class _LIBCPP_VISIBLE multimap;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE set;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE multiset;
|
||||
|
||||
/*
|
||||
|
||||
@@ -500,7 +494,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
|
||||
}
|
||||
}
|
||||
|
||||
template <class _Allocator> class __map_node_destructor;
|
||||
template <class> class __map_node_destructor;
|
||||
|
||||
template <class _Allocator>
|
||||
class __tree_node_destructor
|
||||
@@ -529,7 +523,7 @@ public:
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__value_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
|
||||
if (__p)
|
||||
__alloc_traits::deallocate(__na_, __p, 1);
|
||||
}
|
||||
@@ -604,7 +598,7 @@ public:
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_node(_Args&& ...__args)
|
||||
: __value_(_VSTD::forward<_Args>(__args)...) {}
|
||||
: __value_(_STD::forward<_Args>(__args)...) {}
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_node(const value_type& __v)
|
||||
@@ -612,8 +606,8 @@ public:
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
};
|
||||
|
||||
template <class _TreeIterator> class __map_iterator;
|
||||
template <class _TreeIterator> class __map_const_iterator;
|
||||
template <class> class __map_iterator;
|
||||
template <class> class __map_const_iterator;
|
||||
|
||||
template <class _Tp, class _NodePtr, class _DiffType>
|
||||
class _LIBCPP_VISIBLE __tree_iterator
|
||||
@@ -1075,7 +1069,7 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__node_alloc() = _VSTD::move(__t.__node_alloc());}
|
||||
{__node_alloc() = _STD::move(__t.__node_alloc());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t, false_type) _NOEXCEPT {}
|
||||
|
||||
@@ -1090,7 +1084,7 @@ private:
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1284,9 +1278,9 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_constructible<__node_allocator>::value &&
|
||||
is_nothrow_move_constructible<value_compare>::value)
|
||||
: __begin_node_(_VSTD::move(__t.__begin_node_)),
|
||||
__pair1_(_VSTD::move(__t.__pair1_)),
|
||||
__pair3_(_VSTD::move(__t.__pair3_))
|
||||
: __begin_node_(_STD::move(__t.__begin_node_)),
|
||||
__pair1_(_STD::move(__t.__pair1_)),
|
||||
__pair3_(_STD::move(__t.__pair3_))
|
||||
{
|
||||
if (size() == 0)
|
||||
__begin_node() = __end_node();
|
||||
@@ -1302,7 +1296,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
|
||||
: __pair1_(__node_allocator(__a)),
|
||||
__pair3_(0, _VSTD::move(__t.value_comp()))
|
||||
__pair3_(0, _STD::move(__t.value_comp()))
|
||||
{
|
||||
if (__a == __t.__alloc())
|
||||
{
|
||||
@@ -1335,7 +1329,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
|
||||
__begin_node_ = __t.__begin_node_;
|
||||
__pair1_.first() = __t.__pair1_.first();
|
||||
__move_assign_alloc(__t);
|
||||
__pair3_ = _VSTD::move(__t.__pair3_);
|
||||
__pair3_ = _STD::move(__t.__pair3_);
|
||||
if (size() == 0)
|
||||
__begin_node() = __end_node();
|
||||
else
|
||||
@@ -1355,7 +1349,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
|
||||
__move_assign(__t, true_type());
|
||||
else
|
||||
{
|
||||
value_comp() = _VSTD::move(__t.value_comp());
|
||||
value_comp() = _STD::move(__t.value_comp());
|
||||
const_iterator __e = end();
|
||||
if (size() != 0)
|
||||
{
|
||||
@@ -1366,7 +1360,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
while (__cache != nullptr && __t.size() != 0)
|
||||
{
|
||||
__cache->__value_ = _VSTD::move(__t.remove(__t.begin())->__value_);
|
||||
__cache->__value_ = _STD::move(__t.remove(__t.begin())->__value_);
|
||||
__node_pointer __next = __detach(__cache);
|
||||
__node_insert_multi(__cache);
|
||||
__cache = __next;
|
||||
@@ -1389,7 +1383,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
|
||||
}
|
||||
}
|
||||
while (__t.size() != 0)
|
||||
__insert_multi(__e, _VSTD::move(__t.remove(__t.begin())->__value_));
|
||||
__insert_multi(__e, _STD::move(__t.remove(__t.begin())->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1424,7 +1418,7 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
|
||||
destroy(static_cast<__node_pointer>(__nd->__left_));
|
||||
destroy(static_cast<__node_pointer>(__nd->__right_));
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_traits::destroy(__na, _VSTD::addressof(__nd->__value_));
|
||||
__node_traits::destroy(__na, _STD::addressof(__nd->__value_));
|
||||
__node_traits::deallocate(__na, __nd, 1);
|
||||
}
|
||||
}
|
||||
@@ -1437,7 +1431,7 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
|
||||
(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value))
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__begin_node_, __t.__begin_node_);
|
||||
swap(__pair1_.first(), __t.__pair1_.first());
|
||||
__swap_alloc(__node_alloc(), __t.__node_alloc());
|
||||
@@ -1661,10 +1655,10 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
|
||||
else if (value_comp()(*__hint, __v)) // check after
|
||||
{
|
||||
// *__hint < __v
|
||||
const_iterator __next = _VSTD::next(__hint);
|
||||
const_iterator __next = _STD::next(__hint);
|
||||
if (__next == end() || value_comp()(__v, *__next))
|
||||
{
|
||||
// *__hint < __v < *_VSTD::next(__hint)
|
||||
// *__hint < __v < *_STD::next(__hint)
|
||||
if (__hint.__ptr_->__right_ == nullptr)
|
||||
{
|
||||
__parent = const_cast<__node_pointer&>(__hint.__ptr_);
|
||||
@@ -1710,7 +1704,7 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args)
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_Args>(__args)...);
|
||||
__h.get_deleter().__value_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
@@ -1720,7 +1714,7 @@ template <class... _Args>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
__tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_equal(__parent, __h->__value_);
|
||||
__node_pointer __r = static_cast<__node_pointer>(__child);
|
||||
@@ -1739,7 +1733,7 @@ template <class... _Args>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique(const_iterator __p, _Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_equal(__p, __parent, __h->__value_);
|
||||
__node_pointer __r = static_cast<__node_pointer>(__child);
|
||||
@@ -1756,7 +1750,7 @@ template <class... _Args>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
|
||||
__insert_node_at(__parent, __child, __h.get());
|
||||
@@ -1769,7 +1763,7 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
|
||||
_Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_Args>(__args)...);
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
|
||||
__insert_node_at(__parent, __child, __h.get());
|
||||
@@ -1783,7 +1777,7 @@ template <class _V>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
pair<iterator, bool> __r = __node_insert_unique(__h.get());
|
||||
if (__r.second)
|
||||
__h.release();
|
||||
@@ -1795,7 +1789,7 @@ template <class _V>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _V&& __v)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
iterator __r = __node_insert_unique(__p, __h.get());
|
||||
if (__r.__ptr_ == __h.get())
|
||||
__h.release();
|
||||
@@ -1807,7 +1801,7 @@ template <class _V>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_multi(_V&& __v)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
|
||||
__insert_node_at(__parent, __child, __h.get());
|
||||
@@ -1819,7 +1813,7 @@ template <class _V>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _V&& __v)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_V>(__v));
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
|
||||
__insert_node_at(__parent, __child, __h.get());
|
||||
@@ -1834,9 +1828,9 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v)
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), __v);
|
||||
__h.get_deleter().__value_constructed = true;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1962,7 +1956,7 @@ __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p)
|
||||
__begin_node() = __r.__ptr_;
|
||||
--size();
|
||||
__node_allocator& __na = __node_alloc();
|
||||
__node_traits::destroy(__na, const_cast<value_type*>(_VSTD::addressof(*__p)));
|
||||
__node_traits::destroy(__na, const_cast<value_type*>(_STD::addressof(*__p)));
|
||||
__tree_remove(__end_node()->__left_,
|
||||
static_cast<__node_base_pointer>(__np));
|
||||
__node_traits::deallocate(__na, __np, 1);
|
||||
@@ -2064,7 +2058,7 @@ __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const
|
||||
else if (value_comp()(__rt->__value_, __k))
|
||||
__rt = static_cast<__node_const_pointer>(__rt->__right_);
|
||||
else
|
||||
return _VSTD::distance(
|
||||
return _STD::distance(
|
||||
__lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt),
|
||||
__upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result)
|
||||
);
|
||||
|
@@ -214,7 +214,11 @@ struct __tuple_convertible_imp : public false_type {};
|
||||
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
|
||||
struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
|
||||
: public integral_constant<bool,
|
||||
#if 1 // waiting on cwg 1170
|
||||
is_convertible<_Tp0, _Up0>::value &&
|
||||
#else
|
||||
is_constructible<_Up0, _Tp0>::value &&
|
||||
#endif
|
||||
__tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
|
||||
|
||||
template <>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -136,10 +136,10 @@ struct _LIBCPP_VISIBLE array
|
||||
|
||||
// No explicit construct/copy/destroy for aggregate type
|
||||
_LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u)
|
||||
{_VSTD::fill_n(__elems_, _Size, __u);}
|
||||
{_STD::fill_n(__elems_, _Size, __u);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{_VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
{_STD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
|
||||
// iterators:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -225,7 +225,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
{
|
||||
return _VSTD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
|
||||
return _STD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
@@ -241,7 +241,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
|
||||
return _STD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
@@ -326,7 +326,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
_Tp&&
|
||||
get(array<_Tp, _Size>&& __a) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::move(__a[_Ip]);
|
||||
return _STD::move(__a[_Ip]);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@@ -129,15 +129,6 @@ template <size_t N> struct hash<std::bitset<N>>;
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
class __bitset;
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
struct __has_storage_type<__bitset<_N_words, _Size> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
class __bitset
|
||||
{
|
||||
@@ -204,7 +195,7 @@ template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
|
||||
{
|
||||
_VSTD::fill_n(__first_, _N_words, __storage_type(0));
|
||||
_STD::fill_n(__first_, _N_words, __storage_type(0));
|
||||
}
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
@@ -214,8 +205,8 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, false_type)
|
||||
__storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)];
|
||||
for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word)
|
||||
__t[__i] = static_cast<__storage_type>(__v);
|
||||
_VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
|
||||
_VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
|
||||
_STD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
|
||||
_STD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
|
||||
__storage_type(0));
|
||||
}
|
||||
|
||||
@@ -225,7 +216,7 @@ void
|
||||
__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type)
|
||||
{
|
||||
__first_[0] = __v;
|
||||
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||
_STD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||
}
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
@@ -286,7 +277,7 @@ unsigned long
|
||||
__bitset<_N_words, _Size>::to_ulong(false_type) const
|
||||
{
|
||||
const_iterator __e = __make_iter(_Size);
|
||||
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
|
||||
const_iterator __i = _STD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
|
||||
if (__i != __e)
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw overflow_error("bitset to_ulong overflow error");
|
||||
@@ -309,7 +300,7 @@ unsigned long long
|
||||
__bitset<_N_words, _Size>::to_ullong(false_type) const
|
||||
{
|
||||
const_iterator __e = __make_iter(_Size);
|
||||
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
|
||||
const_iterator __i = _STD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
|
||||
if (__i != __e)
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw overflow_error("bitset to_ullong overflow error");
|
||||
@@ -683,7 +674,7 @@ bitset<_Size>::bitset(const _CharT* __str,
|
||||
typename basic_string<_CharT>::size_type __n,
|
||||
_CharT __zero, _CharT __one)
|
||||
{
|
||||
size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
|
||||
size_t __rlen = _STD::min(__n, char_traits<_CharT>::length(__str));
|
||||
for (size_t __i = 0; __i < __rlen; ++__i)
|
||||
if (__str[__i] != __zero && __str[__i] != __one)
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -691,7 +682,7 @@ bitset<_Size>::bitset(const _CharT* __str,
|
||||
#else
|
||||
assert(!"bitset string ctor has invalid argument");
|
||||
#endif
|
||||
size_t _M = _VSTD::min(__rlen, _Size);
|
||||
size_t _M = _STD::min(__rlen, _Size);
|
||||
size_t __i = 0;
|
||||
for (; __i < _M; ++__i)
|
||||
{
|
||||
@@ -701,7 +692,7 @@ bitset<_Size>::bitset(const _CharT* __str,
|
||||
else
|
||||
(*this)[__i] = true;
|
||||
}
|
||||
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
_STD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
@@ -717,7 +708,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
#else
|
||||
assert(!"bitset string pos out of range");
|
||||
#endif
|
||||
size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
|
||||
size_t __rlen = _STD::min(__n, __str.size() - __pos);
|
||||
for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
|
||||
if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -725,7 +716,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
#else
|
||||
assert(!"bitset string ctor has invalid argument");
|
||||
#endif
|
||||
size_t _M = _VSTD::min(__rlen, _Size);
|
||||
size_t _M = _STD::min(__rlen, _Size);
|
||||
size_t __i = 0;
|
||||
for (; __i < _M; ++__i)
|
||||
{
|
||||
@@ -735,7 +726,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
else
|
||||
(*this)[__i] = true;
|
||||
}
|
||||
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
_STD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
@@ -769,9 +760,9 @@ template <size_t _Size>
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
|
||||
{
|
||||
__pos = _VSTD::min(__pos, _Size);
|
||||
_VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
|
||||
_VSTD::fill_n(base::__make_iter(0), __pos, false);
|
||||
__pos = _STD::min(__pos, _Size);
|
||||
_STD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
|
||||
_STD::fill_n(base::__make_iter(0), __pos, false);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -779,9 +770,9 @@ template <size_t _Size>
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
|
||||
{
|
||||
__pos = _VSTD::min(__pos, _Size);
|
||||
_VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
|
||||
_VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
|
||||
__pos = _STD::min(__pos, _Size);
|
||||
_STD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
|
||||
_STD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -790,7 +781,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::set() _NOEXCEPT
|
||||
{
|
||||
_VSTD::fill_n(base::__make_iter(0), _Size, true);
|
||||
_STD::fill_n(base::__make_iter(0), _Size, true);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -813,7 +804,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::reset() _NOEXCEPT
|
||||
{
|
||||
_VSTD::fill_n(base::__make_iter(0), _Size, false);
|
||||
_STD::fill_n(base::__make_iter(0), _Size, false);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -926,7 +917,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
bitset<_Size>::count() const _NOEXCEPT
|
||||
{
|
||||
return static_cast<size_t>(_VSTD::count(base::__make_iter(0), base::__make_iter(_Size), true));
|
||||
return static_cast<size_t>(_STD::count(base::__make_iter(0), base::__make_iter(_Size), true));
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
@@ -934,7 +925,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
|
||||
{
|
||||
return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
|
||||
return _STD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
@@ -1033,14 +1024,6 @@ struct _LIBCPP_VISIBLE hash<bitset<_Size> >
|
||||
{return __bs.__hash_code();}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x);
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_BITSET
|
||||
|
316
include/cerrno
316
include/cerrno
@@ -72,320 +72,4 @@ const int __elast2 = 105;
|
||||
|
||||
#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
|
||||
|
||||
// supply errno values likely to be missing, particularly on Windows
|
||||
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT 9901
|
||||
#endif
|
||||
|
||||
#ifndef EADDRINUSE
|
||||
#define EADDRINUSE 9902
|
||||
#endif
|
||||
|
||||
#ifndef EADDRNOTAVAIL
|
||||
#define EADDRNOTAVAIL 9903
|
||||
#endif
|
||||
|
||||
#ifndef EISCONN
|
||||
#define EISCONN 9904
|
||||
#endif
|
||||
|
||||
#ifndef EBADMSG
|
||||
#define EBADMSG 9905
|
||||
#endif
|
||||
|
||||
#ifndef ECONNABORTED
|
||||
#define ECONNABORTED 9906
|
||||
#endif
|
||||
|
||||
#ifndef EALREADY
|
||||
#define EALREADY 9907
|
||||
#endif
|
||||
|
||||
#ifndef ECONNREFUSED
|
||||
#define ECONNREFUSED 9908
|
||||
#endif
|
||||
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET 9909
|
||||
#endif
|
||||
|
||||
#ifndef EDESTADDRREQ
|
||||
#define EDESTADDRREQ 9910
|
||||
#endif
|
||||
|
||||
#ifndef EHOSTUNREACH
|
||||
#define EHOSTUNREACH 9911
|
||||
#endif
|
||||
|
||||
#ifndef EIDRM
|
||||
#define EIDRM 9912
|
||||
#endif
|
||||
|
||||
#ifndef EMSGSIZE
|
||||
#define EMSGSIZE 9913
|
||||
#endif
|
||||
|
||||
#ifndef ENETDOWN
|
||||
#define ENETDOWN 9914
|
||||
#endif
|
||||
|
||||
#ifndef ENETRESET
|
||||
#define ENETRESET 9915
|
||||
#endif
|
||||
|
||||
#ifndef ENETUNREACH
|
||||
#define ENETUNREACH 9916
|
||||
#endif
|
||||
|
||||
#ifndef ENOBUFS
|
||||
#define ENOBUFS 9917
|
||||
#endif
|
||||
|
||||
#ifndef ENOLINK
|
||||
#define ENOLINK 9918
|
||||
#endif
|
||||
|
||||
#ifndef ENODATA
|
||||
#define ENODATA 9919
|
||||
#endif
|
||||
|
||||
#ifndef ENOMSG
|
||||
#define ENOMSG 9920
|
||||
#endif
|
||||
|
||||
#ifndef ENOPROTOOPT
|
||||
#define ENOPROTOOPT 9921
|
||||
#endif
|
||||
|
||||
#ifndef ENOSR
|
||||
#define ENOSR 9922
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSOCK
|
||||
#define ENOTSOCK 9923
|
||||
#endif
|
||||
|
||||
#ifndef ENOSTR
|
||||
#define ENOSTR 9924
|
||||
#endif
|
||||
|
||||
#ifndef ENOTCONN
|
||||
#define ENOTCONN 9925
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSUP
|
||||
#define ENOTSUP 9926
|
||||
#endif
|
||||
|
||||
#ifndef ECANCELED
|
||||
#define ECANCELED 9927
|
||||
#endif
|
||||
|
||||
#ifndef EINPROGRESS
|
||||
#define EINPROGRESS 9928
|
||||
#endif
|
||||
|
||||
#ifndef EOPNOTSUPP
|
||||
#define EOPNOTSUPP 9929
|
||||
#endif
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
#define EWOULDBLOCK 9930
|
||||
#endif
|
||||
|
||||
#ifndef EOWNERDEAD
|
||||
#define EOWNERDEAD 9931
|
||||
#endif
|
||||
|
||||
#ifndef EPROTO
|
||||
#define EPROTO 9932
|
||||
#endif
|
||||
|
||||
#ifndef EPROTONOSUPPORT
|
||||
#define EPROTONOSUPPORT 9933
|
||||
#endif
|
||||
|
||||
#ifndef ENOTRECOVERABLE
|
||||
#define ENOTRECOVERABLE 9934
|
||||
#endif
|
||||
|
||||
#ifndef ETIME
|
||||
#define ETIME 9935
|
||||
#endif
|
||||
|
||||
#ifndef ETXTBSY
|
||||
#define ETXTBSY 9936
|
||||
#endif
|
||||
|
||||
#ifndef ETIMEDOUT
|
||||
#define ETIMEDOUT 9938
|
||||
#endif
|
||||
|
||||
#ifndef ELOOP
|
||||
#define ELOOP 9939
|
||||
#endif
|
||||
|
||||
#ifndef EOVERFLOW
|
||||
#define EOVERFLOW 9940
|
||||
#endif
|
||||
|
||||
#ifndef EPROTOTYPE
|
||||
#define EPROTOTYPE 9941
|
||||
#endif
|
||||
|
||||
#ifndef ENOSYS
|
||||
#define ENOSYS 9942
|
||||
#endif
|
||||
|
||||
#ifndef EINVAL
|
||||
#define EINVAL 9943
|
||||
#endif
|
||||
|
||||
#ifndef ERANGE
|
||||
#define ERANGE 9944
|
||||
#endif
|
||||
|
||||
#ifndef EILSEQ
|
||||
#define EILSEQ 9945
|
||||
#endif
|
||||
|
||||
// Windows Mobile doesn't appear to define these:
|
||||
|
||||
#ifndef E2BIG
|
||||
#define E2BIG 9946
|
||||
#endif
|
||||
|
||||
#ifndef EDOM
|
||||
#define EDOM 9947
|
||||
#endif
|
||||
|
||||
#ifndef EFAULT
|
||||
#define EFAULT 9948
|
||||
#endif
|
||||
|
||||
#ifndef EBADF
|
||||
#define EBADF 9949
|
||||
#endif
|
||||
|
||||
#ifndef EPIPE
|
||||
#define EPIPE 9950
|
||||
#endif
|
||||
|
||||
#ifndef EXDEV
|
||||
#define EXDEV 9951
|
||||
#endif
|
||||
|
||||
#ifndef EBUSY
|
||||
#define EBUSY 9952
|
||||
#endif
|
||||
|
||||
#ifndef ENOTEMPTY
|
||||
#define ENOTEMPTY 9953
|
||||
#endif
|
||||
|
||||
#ifndef ENOEXEC
|
||||
#define ENOEXEC 9954
|
||||
#endif
|
||||
|
||||
#ifndef EEXIST
|
||||
#define EEXIST 9955
|
||||
#endif
|
||||
|
||||
#ifndef EFBIG
|
||||
#define EFBIG 9956
|
||||
#endif
|
||||
|
||||
#ifndef ENAMETOOLONG
|
||||
#define ENAMETOOLONG 9957
|
||||
#endif
|
||||
|
||||
#ifndef ENOTTY
|
||||
#define ENOTTY 9958
|
||||
#endif
|
||||
|
||||
#ifndef EINTR
|
||||
#define EINTR 9959
|
||||
#endif
|
||||
|
||||
#ifndef ESPIPE
|
||||
#define ESPIPE 9960
|
||||
#endif
|
||||
|
||||
#ifndef EIO
|
||||
#define EIO 9961
|
||||
#endif
|
||||
|
||||
#ifndef EISDIR
|
||||
#define EISDIR 9962
|
||||
#endif
|
||||
|
||||
#ifndef ECHILD
|
||||
#define ECHILD 9963
|
||||
#endif
|
||||
|
||||
#ifndef ENOLCK
|
||||
#define ENOLCK 9964
|
||||
#endif
|
||||
|
||||
#ifndef ENOSPC
|
||||
#define ENOSPC 9965
|
||||
#endif
|
||||
|
||||
#ifndef ENXIO
|
||||
#define ENXIO 9966
|
||||
#endif
|
||||
|
||||
#ifndef ENODEV
|
||||
#define ENODEV 9967
|
||||
#endif
|
||||
|
||||
#ifndef ENOENT
|
||||
#define ENOENT 9968
|
||||
#endif
|
||||
|
||||
#ifndef ESRCH
|
||||
#define ESRCH 9969
|
||||
#endif
|
||||
|
||||
#ifndef ENOTDIR
|
||||
#define ENOTDIR 9970
|
||||
#endif
|
||||
|
||||
#ifndef ENOMEM
|
||||
#define ENOMEM 9971
|
||||
#endif
|
||||
|
||||
#ifndef EPERM
|
||||
#define EPERM 9972
|
||||
#endif
|
||||
|
||||
#ifndef EACCES
|
||||
#define EACCES 9973
|
||||
#endif
|
||||
|
||||
#ifndef EROFS
|
||||
#define EROFS 9974
|
||||
#endif
|
||||
|
||||
#ifndef EDEADLK
|
||||
#define EDEADLK 9975
|
||||
#endif
|
||||
|
||||
#ifndef EAGAIN
|
||||
#define EAGAIN 9976
|
||||
#endif
|
||||
|
||||
#ifndef ENFILE
|
||||
#define ENFILE 9977
|
||||
#endif
|
||||
|
||||
#ifndef EMFILE
|
||||
#define EMFILE 9978
|
||||
#endif
|
||||
|
||||
#ifndef EMLINK
|
||||
#define EMLINK 9979
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CERRNO
|
||||
|
@@ -407,7 +407,7 @@ public:
|
||||
(ratio_divide<_Period2, period>::type::den == 1 &&
|
||||
!treat_as_floating_point<_Rep2>::value)
|
||||
>::type* = 0)
|
||||
: __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
|
||||
: __rep_(_STD::chrono::duration_cast<duration>(__d).count()) {}
|
||||
|
||||
// observer
|
||||
|
||||
@@ -726,7 +726,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
time_point<_Clock, _ToDuration>
|
||||
time_point_cast(const time_point<_Clock, _Duration>& __t)
|
||||
{
|
||||
return time_point<_Clock, _ToDuration>(_VSTD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
|
||||
return time_point<_Clock, _ToDuration>(_STD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
|
||||
}
|
||||
|
||||
// time_point ==
|
||||
|
@@ -1173,7 +1173,7 @@ complex<typename __promote<_Tp, _Up>::type>
|
||||
pow(const complex<_Tp>& __x, const complex<_Up>& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
return _STD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
template<class _Tp, class _Up>
|
||||
@@ -1186,7 +1186,7 @@ typename enable_if
|
||||
pow(const complex<_Tp>& __x, const _Up& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
return _STD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
template<class _Tp, class _Up>
|
||||
@@ -1199,7 +1199,7 @@ typename enable_if
|
||||
pow(const _Tp& __x, const complex<_Up>& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
return _STD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
// asinh
|
||||
|
@@ -243,7 +243,7 @@ condition_variable_any::wait_for(_Lock& __lock,
|
||||
_Predicate __pred)
|
||||
{
|
||||
return wait_until(__lock, chrono::steady_clock::now() + __d,
|
||||
_VSTD::move(__pred));
|
||||
_STD::move(__pred));
|
||||
}
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
|
@@ -82,7 +82,7 @@ struct _LIBCPP_VISIBLE nullptr_t
|
||||
|
||||
inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
||||
|
||||
#define nullptr _VSTD::__get_nullptr_t()
|
||||
#define nullptr _STD::__get_nullptr_t()
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
|
@@ -106,9 +106,6 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
|
||||
#include <__config>
|
||||
#include <cwctype>
|
||||
#include <wchar.h>
|
||||
#if _WIN32
|
||||
#include <support/win32/support.h> // pull in *swprintf defines
|
||||
#endif // _WIN32
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
|
262
include/deque
262
include/deque
@@ -535,7 +535,7 @@ copy(_RAIter __f,
|
||||
__n = __bs;
|
||||
__m = __f + __n;
|
||||
}
|
||||
_VSTD::copy(__f, __m, __rb);
|
||||
_STD::copy(__f, __m, __rb);
|
||||
__f = __m;
|
||||
__r += __n;
|
||||
}
|
||||
@@ -562,7 +562,7 @@ copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__fe = __fb + __bs;
|
||||
}
|
||||
__r = _VSTD::copy(__fb, __fe, __r);
|
||||
__r = _STD::copy(__fb, __fe, __r);
|
||||
__n -= __bs;
|
||||
__f += __bs;
|
||||
}
|
||||
@@ -589,7 +589,7 @@ copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__fe = __fb + __bs;
|
||||
}
|
||||
__r = _VSTD::copy(__fb, __fe, __r);
|
||||
__r = _STD::copy(__fb, __fe, __r);
|
||||
__n -= __bs;
|
||||
__f += __bs;
|
||||
}
|
||||
@@ -610,7 +610,7 @@ copy_backward(_RAIter __f,
|
||||
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
|
||||
while (__f != __l)
|
||||
{
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _VSTD::prev(__r);
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
|
||||
pointer __rb = *__rp.__m_iter_;
|
||||
pointer __re = __rp.__ptr_ + 1;
|
||||
difference_type __bs = __re - __rb;
|
||||
@@ -621,7 +621,7 @@ copy_backward(_RAIter __f,
|
||||
__n = __bs;
|
||||
__m = __l - __n;
|
||||
}
|
||||
_VSTD::copy_backward(__m, __l, __re);
|
||||
_STD::copy_backward(__m, __l, __re);
|
||||
__l = __m;
|
||||
__r -= __n;
|
||||
}
|
||||
@@ -649,7 +649,7 @@ copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__lb = __le - __bs;
|
||||
}
|
||||
__r = _VSTD::copy_backward(__lb, __le, __r);
|
||||
__r = _STD::copy_backward(__lb, __le, __r);
|
||||
__n -= __bs;
|
||||
__l -= __bs - 1;
|
||||
}
|
||||
@@ -677,7 +677,7 @@ copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__lb = __le - __bs;
|
||||
}
|
||||
__r = _VSTD::copy_backward(__lb, __le, __r);
|
||||
__r = _STD::copy_backward(__lb, __le, __r);
|
||||
__n -= __bs;
|
||||
__l -= __bs - 1;
|
||||
}
|
||||
@@ -708,7 +708,7 @@ move(_RAIter __f,
|
||||
__n = __bs;
|
||||
__m = __f + __n;
|
||||
}
|
||||
_VSTD::move(__f, __m, __rb);
|
||||
_STD::move(__f, __m, __rb);
|
||||
__f = __m;
|
||||
__r += __n;
|
||||
}
|
||||
@@ -735,7 +735,7 @@ move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__fe = __fb + __bs;
|
||||
}
|
||||
__r = _VSTD::move(__fb, __fe, __r);
|
||||
__r = _STD::move(__fb, __fe, __r);
|
||||
__n -= __bs;
|
||||
__f += __bs;
|
||||
}
|
||||
@@ -762,7 +762,7 @@ move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__fe = __fb + __bs;
|
||||
}
|
||||
__r = _VSTD::move(__fb, __fe, __r);
|
||||
__r = _STD::move(__fb, __fe, __r);
|
||||
__n -= __bs;
|
||||
__f += __bs;
|
||||
}
|
||||
@@ -783,7 +783,7 @@ move_backward(_RAIter __f,
|
||||
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
|
||||
while (__f != __l)
|
||||
{
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _VSTD::prev(__r);
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
|
||||
pointer __rb = *__rp.__m_iter_;
|
||||
pointer __re = __rp.__ptr_ + 1;
|
||||
difference_type __bs = __re - __rb;
|
||||
@@ -794,7 +794,7 @@ move_backward(_RAIter __f,
|
||||
__n = __bs;
|
||||
__m = __l - __n;
|
||||
}
|
||||
_VSTD::move_backward(__m, __l, __re);
|
||||
_STD::move_backward(__m, __l, __re);
|
||||
__l = __m;
|
||||
__r -= __n;
|
||||
}
|
||||
@@ -822,7 +822,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__lb = __le - __bs;
|
||||
}
|
||||
__r = _VSTD::move_backward(__lb, __le, __r);
|
||||
__r = _STD::move_backward(__lb, __le, __r);
|
||||
__n -= __bs;
|
||||
__l -= __bs - 1;
|
||||
}
|
||||
@@ -850,7 +850,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
__bs = __n;
|
||||
__lb = __le - __bs;
|
||||
}
|
||||
__r = _VSTD::move_backward(__lb, __le, __r);
|
||||
__r = _STD::move_backward(__lb, __le, __r);
|
||||
__n -= __bs;
|
||||
__l -= __bs - 1;
|
||||
}
|
||||
@@ -961,7 +961,7 @@ protected:
|
||||
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__map_ = _VSTD::move(__c.__map_);
|
||||
__map_ = _STD::move(__c.__map_);
|
||||
__start_ = __c.__start_;
|
||||
size() = __c.size();
|
||||
__move_assign_alloc(__c);
|
||||
@@ -977,14 +977,14 @@ protected:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__deque_base& __c, true_type)
|
||||
void __move_assign_alloc(const __deque_base& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _VSTD::move(__c.__alloc());
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__deque_base& __c, false_type) _NOEXCEPT
|
||||
void __move_assign_alloc(const __deque_base& __c, false_type) _NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -998,7 +998,7 @@ private:
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
@@ -1097,9 +1097,9 @@ __deque_base<_Tp, _Allocator>::~__deque_base()
|
||||
template <class _Tp, class _Allocator>
|
||||
__deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __map_(_VSTD::move(__c.__map_)),
|
||||
__start_(_VSTD::move(__c.__start_)),
|
||||
__size_(_VSTD::move(__c.__size_))
|
||||
: __map_(_STD::move(__c.__map_)),
|
||||
__start_(_STD::move(__c.__start_)),
|
||||
__size_(_STD::move(__c.__size_))
|
||||
{
|
||||
__c.__start_ = 0;
|
||||
__c.size() = 0;
|
||||
@@ -1107,9 +1107,9 @@ __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
__deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_type& __a)
|
||||
: __map_(_VSTD::move(__c.__map_), __pointer_allocator(__a)),
|
||||
__start_(_VSTD::move(__c.__start_)),
|
||||
__size_(_VSTD::move(__c.size()), __a)
|
||||
: __map_(_STD::move(__c.__map_), __pointer_allocator(__a)),
|
||||
__start_(_STD::move(__c.__start_)),
|
||||
__size_(_STD::move(__c.size()), __a)
|
||||
{
|
||||
if (__a == __c.__alloc())
|
||||
{
|
||||
@@ -1133,8 +1133,8 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
__map_.swap(__c.__map_);
|
||||
_VSTD::swap(__start_, __c.__start_);
|
||||
_VSTD::swap(size(), __c.size());
|
||||
_STD::swap(__start_, __c.__start_);
|
||||
_STD::swap(size(), __c.size());
|
||||
__swap_alloc(__alloc(), __c.__alloc());
|
||||
}
|
||||
|
||||
@@ -1144,7 +1144,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
|
||||
{
|
||||
allocator_type& __a = __alloc();
|
||||
for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
|
||||
__alloc_traits::destroy(__a, _VSTD::addressof(*__i));
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__i));
|
||||
size() = 0;
|
||||
while (__map_.size() > 2)
|
||||
{
|
||||
@@ -1184,8 +1184,8 @@ public:
|
||||
|
||||
typedef typename __base::pointer pointer;
|
||||
typedef typename __base::const_pointer const_pointer;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1204,16 +1204,12 @@ public:
|
||||
typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0);
|
||||
deque(const deque& __c);
|
||||
deque(const deque& __c, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
deque(initializer_list<value_type> __il);
|
||||
deque(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
deque& operator=(const deque& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
|
||||
@@ -1231,10 +1227,8 @@ public:
|
||||
void assign(_RAIter __f, _RAIter __l,
|
||||
typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0);
|
||||
void assign(size_type __n, const value_type& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
allocator_type get_allocator() const _NOEXCEPT;
|
||||
|
||||
@@ -1319,11 +1313,9 @@ public:
|
||||
template <class _BiIter>
|
||||
iterator insert (const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, initializer_list<value_type> __il)
|
||||
{return insert(__p, __il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
void pop_front();
|
||||
void pop_back();
|
||||
iterator erase(const_iterator __p);
|
||||
@@ -1460,8 +1452,6 @@ deque<_Tp, _Allocator>::deque(const deque& __c, const allocator_type& __a)
|
||||
__append(__c.begin(), __c.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
|
||||
{
|
||||
@@ -1475,8 +1465,6 @@ deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator
|
||||
__append(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
deque<_Tp, _Allocator>&
|
||||
deque<_Tp, _Allocator>::operator=(const deque& __c)
|
||||
@@ -1495,14 +1483,14 @@ template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
deque<_Tp, _Allocator>::deque(deque&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __base(_VSTD::move(__c))
|
||||
: __base(_STD::move(__c))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
|
||||
: __base(_VSTD::move(__c), __a)
|
||||
: __base(_STD::move(__c), __a)
|
||||
{
|
||||
if (__a != __c.__alloc())
|
||||
{
|
||||
@@ -1574,11 +1562,11 @@ deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l,
|
||||
if (static_cast<size_type>(__l - __f) > __base::size())
|
||||
{
|
||||
_RAIter __m = __f + __base::size();
|
||||
_VSTD::copy(__f, __m, __base::begin());
|
||||
_STD::copy(__f, __m, __base::begin());
|
||||
__append(__m, __l);
|
||||
}
|
||||
else
|
||||
__erase_to_end(_VSTD::copy(__f, __l, __base::begin()));
|
||||
__erase_to_end(_STD::copy(__f, __l, __base::begin()));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -1587,12 +1575,12 @@ deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v)
|
||||
{
|
||||
if (__n > __base::size())
|
||||
{
|
||||
_VSTD::fill_n(__base::begin(), __base::size(), __v);
|
||||
_STD::fill_n(__base::begin(), __base::size(), __v);
|
||||
__n -= __base::size();
|
||||
__append(__n, __v);
|
||||
}
|
||||
else
|
||||
__erase_to_end(_VSTD::fill_n(__base::begin(), __n, __v));
|
||||
__erase_to_end(_STD::fill_n(__base::begin(), __n, __v));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -1738,7 +1726,7 @@ deque<_Tp, _Allocator>::push_back(const value_type& __v)
|
||||
if (__back_spare() == 0)
|
||||
__add_back_capacity();
|
||||
// __back_spare() >= 1
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__base::end()), __v);
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
@@ -1752,7 +1740,7 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
|
||||
if (__back_spare() == 0)
|
||||
__add_back_capacity();
|
||||
// __back_spare() >= 1
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::move(__v));
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
@@ -1767,7 +1755,7 @@ deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
if (__back_spare() == 0)
|
||||
__add_back_capacity();
|
||||
// __back_spare() >= 1
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::forward<_Args>(__args)...);
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
@@ -1782,7 +1770,7 @@ deque<_Tp, _Allocator>::push_front(const value_type& __v)
|
||||
if (__front_spare() == 0)
|
||||
__add_front_capacity();
|
||||
// __front_spare() >= 1
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), __v);
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
@@ -1797,7 +1785,7 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
|
||||
if (__front_spare() == 0)
|
||||
__add_front_capacity();
|
||||
// __front_spare() >= 1
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::move(__v));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
@@ -1813,7 +1801,7 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
|
||||
if (__front_spare() == 0)
|
||||
__add_front_capacity();
|
||||
// __front_spare() >= 1
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
@@ -1835,7 +1823,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
// __front_spare() >= 1
|
||||
if (__pos == 0)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), __v);
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
@@ -1843,14 +1831,14 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
{
|
||||
const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
|
||||
iterator __b = __base::begin();
|
||||
iterator __bm1 = _VSTD::prev(__b);
|
||||
iterator __bm1 = _STD::prev(__b);
|
||||
if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
|
||||
__vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
|
||||
__b = __move_and_check(_STD::next(__b), __b + __pos, __b, __vt);
|
||||
*__b = *__vt;
|
||||
}
|
||||
}
|
||||
@@ -1862,17 +1850,17 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
size_type __de = __base::size() - __pos;
|
||||
if (__de == 0)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__base::end()), __v);
|
||||
++__base::size();
|
||||
}
|
||||
else
|
||||
{
|
||||
const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
|
||||
iterator __e = __base::end();
|
||||
iterator __em1 = _VSTD::prev(__e);
|
||||
iterator __em1 = _STD::prev(__e);
|
||||
if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
|
||||
__vt = pointer_traits<const_pointer>::pointer_to(*__e);
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
|
||||
++__base::size();
|
||||
if (__de > 1)
|
||||
__e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
|
||||
@@ -1898,20 +1886,20 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
|
||||
// __front_spare() >= 1
|
||||
if (__pos == 0)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::move(__v));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
else
|
||||
{
|
||||
iterator __b = __base::begin();
|
||||
iterator __bm1 = _VSTD::prev(__b);
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
|
||||
iterator __bm1 = _STD::prev(__b);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
|
||||
*__b = _VSTD::move(__v);
|
||||
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
|
||||
*__b = _STD::move(__v);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1922,18 +1910,18 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
|
||||
size_type __de = __base::size() - __pos;
|
||||
if (__de == 0)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::move(__v));
|
||||
++__base::size();
|
||||
}
|
||||
else
|
||||
{
|
||||
iterator __e = __base::end();
|
||||
iterator __em1 = _VSTD::prev(__e);
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
|
||||
iterator __em1 = _STD::prev(__e);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
|
||||
++__base::size();
|
||||
if (__de > 1)
|
||||
__e = _VSTD::move_backward(__e - __de, __em1, __e);
|
||||
*--__e = _VSTD::move(__v);
|
||||
__e = _STD::move_backward(__e - __de, __em1, __e);
|
||||
*--__e = _STD::move(__v);
|
||||
}
|
||||
}
|
||||
return __base::begin() + __pos;
|
||||
@@ -1956,20 +1944,20 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
||||
// __front_spare() >= 1
|
||||
if (__pos == 0)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__base::begin()), _STD::forward<_Args>(__args)...);
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
else
|
||||
{
|
||||
iterator __b = __base::begin();
|
||||
iterator __bm1 = _VSTD::prev(__b);
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
|
||||
iterator __bm1 = _STD::prev(__b);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
|
||||
*__b = value_type(_VSTD::forward<_Args>(__args)...);
|
||||
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
|
||||
*__b = value_type(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1980,18 +1968,18 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
||||
size_type __de = __base::size() - __pos;
|
||||
if (__de == 0)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__base::end()), _STD::forward<_Args>(__args)...);
|
||||
++__base::size();
|
||||
}
|
||||
else
|
||||
{
|
||||
iterator __e = __base::end();
|
||||
iterator __em1 = _VSTD::prev(__e);
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
|
||||
iterator __em1 = _STD::prev(__e);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
|
||||
++__base::size();
|
||||
if (__de > 1)
|
||||
__e = _VSTD::move_backward(__e - __de, __em1, __e);
|
||||
*--__e = value_type(_VSTD::forward<_Args>(__args)...);
|
||||
__e = _STD::move_backward(__e - __de, __em1, __e);
|
||||
*--__e = value_type(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
}
|
||||
return __base::begin() + __pos;
|
||||
@@ -2018,7 +2006,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
||||
if (__n > __pos)
|
||||
{
|
||||
for (size_type __m = __n - __pos; __m; --__m, --__base::__start_, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__i), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__i), __v);
|
||||
__n = __pos;
|
||||
}
|
||||
if (__n > 0)
|
||||
@@ -2028,7 +2016,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
||||
__move_construct_backward_and_check(__old_begin, __obn, __i, __vt);
|
||||
if (__n < __pos)
|
||||
__old_begin = __move_and_check(__obn, __old_begin + __pos, __old_begin, __vt);
|
||||
_VSTD::fill_n(__old_begin, __n, *__vt);
|
||||
_STD::fill_n(__old_begin, __n, *__vt);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2044,7 +2032,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
||||
if (__n > __de)
|
||||
{
|
||||
for (size_type __m = __n - __de; __m; --__m, ++__i, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__i), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__i), __v);
|
||||
__n = __de;
|
||||
}
|
||||
if (__n > 0)
|
||||
@@ -2054,7 +2042,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
||||
__move_construct_and_check(__oen, __old_end, __i, __vt);
|
||||
if (__n < __de)
|
||||
__old_end = __move_backward_and_check(__old_end - __de, __oen, __old_end, __vt);
|
||||
_VSTD::fill_n(__old_end - __n, __n, *__vt);
|
||||
_STD::fill_n(__old_end - __n, __n, *__vt);
|
||||
}
|
||||
}
|
||||
return __base::begin() + __pos;
|
||||
@@ -2079,7 +2067,7 @@ typename deque<_Tp, _Allocator>::iterator
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type*)
|
||||
{
|
||||
size_type __n = _VSTD::distance(__f, __l);
|
||||
size_type __n = _STD::distance(__f, __l);
|
||||
size_type __pos = __p - __base::begin();
|
||||
size_type __to_end = __base::size() - __pos;
|
||||
allocator_type& __a = __base::__alloc();
|
||||
@@ -2094,9 +2082,9 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
_BiIter __m = __f;
|
||||
if (__n > __pos)
|
||||
{
|
||||
__m = __pos < __n / 2 ? _VSTD::prev(__l, __pos) : _VSTD::next(__f, __n - __pos);
|
||||
__m = __pos < __n / 2 ? _STD::prev(__l, __pos) : _STD::next(__f, __n - __pos);
|
||||
for (_BiIter __j = __m; __j != __f; --__base::__start_, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__i), *--__j);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__i), *--__j);
|
||||
__n = __pos;
|
||||
}
|
||||
if (__n > 0)
|
||||
@@ -2104,13 +2092,13 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
iterator __obn = __old_begin + __n;
|
||||
for (iterator __j = __obn; __j != __old_begin;)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__i), _VSTD::move(*--__j));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__i), _STD::move(*--__j));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
if (__n < __pos)
|
||||
__old_begin = _VSTD::move(__obn, __old_begin + __pos, __old_begin);
|
||||
_VSTD::copy(__m, __l, __old_begin);
|
||||
__old_begin = _STD::move(__obn, __old_begin + __pos, __old_begin);
|
||||
_STD::copy(__m, __l, __old_begin);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2126,19 +2114,19 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
size_type __de = __base::size() - __pos;
|
||||
if (__n > __de)
|
||||
{
|
||||
__m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
|
||||
__m = __de < __n / 2 ? _STD::next(__f, __de) : _STD::prev(__l, __n - __de);
|
||||
for (_BiIter __j = __m; __j != __l; ++__i, ++__j, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__i), *__j);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__i), *__j);
|
||||
__n = __de;
|
||||
}
|
||||
if (__n > 0)
|
||||
{
|
||||
iterator __oen = __old_end - __n;
|
||||
for (iterator __j = __oen; __j != __old_end; ++__i, ++__j, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__i), _VSTD::move(*__j));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__i), _STD::move(*__j));
|
||||
if (__n < __de)
|
||||
__old_end = _VSTD::move_backward(__old_end - __de, __oen, __old_end);
|
||||
_VSTD::copy_backward(__f, __m, __old_end);
|
||||
__old_end = _STD::move_backward(__old_end - __de, __oen, __old_end);
|
||||
_STD::copy_backward(__f, __m, __old_end);
|
||||
}
|
||||
}
|
||||
return __base::begin() + __pos;
|
||||
@@ -2161,14 +2149,14 @@ void
|
||||
deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
|
||||
typename enable_if<__is_forward_iterator<_ForIter>::value>::type*)
|
||||
{
|
||||
size_type __n = _VSTD::distance(__f, __l);
|
||||
size_type __n = _STD::distance(__f, __l);
|
||||
allocator_type& __a = __base::__alloc();
|
||||
size_type __back_capacity = __back_spare();
|
||||
if (__n > __back_capacity)
|
||||
__add_back_capacity(__n - __back_capacity);
|
||||
// __n <= __back_capacity
|
||||
for (iterator __i = __base::end(); __f != __l; ++__i, ++__f, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__i), *__f);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__i), *__f);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -2181,7 +2169,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)
|
||||
__add_back_capacity(__n - __back_capacity);
|
||||
// __n <= __back_capacity
|
||||
for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__i));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__i));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -2194,7 +2182,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
|
||||
__add_back_capacity(__n - __back_capacity);
|
||||
// __n <= __back_capacity
|
||||
for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__i), __v);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__i), __v);
|
||||
}
|
||||
|
||||
// Create front capacity for one block of elements.
|
||||
@@ -2252,10 +2240,10 @@ deque<_Tp, _Allocator>::__add_front_capacity()
|
||||
for (typename __base::__map_pointer __i = __base::__map_.begin();
|
||||
__i != __base::__map_.end(); ++__i)
|
||||
__buf.push_back(*__i);
|
||||
_VSTD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_VSTD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
_STD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_STD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_STD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
__base::__start_ = __base::__map_.size() == 1 ?
|
||||
__base::__block_size / 2 :
|
||||
__base::__start_ + __base::__block_size;
|
||||
@@ -2272,7 +2260,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
|
||||
size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
|
||||
// Number of unused blocks at back:
|
||||
size_type __back_capacity = __back_spare() / __base::__block_size;
|
||||
__back_capacity = _VSTD::min(__back_capacity, __nb); // don't take more than you need
|
||||
__back_capacity = _STD::min(__back_capacity, __nb); // don't take more than you need
|
||||
__nb -= __back_capacity; // number of blocks need to allocate
|
||||
// If __nb == 0, then we have sufficient capacity.
|
||||
if (__nb == 0)
|
||||
@@ -2339,10 +2327,10 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
|
||||
for (typename __base::__map_pointer __i = __base::__map_.begin();
|
||||
__i != __base::__map_.end(); ++__i)
|
||||
__buf.push_back(*__i);
|
||||
_VSTD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_VSTD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
_STD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_STD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_STD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
__base::__start_ += __ds;
|
||||
}
|
||||
}
|
||||
@@ -2400,10 +2388,10 @@ deque<_Tp, _Allocator>::__add_back_capacity()
|
||||
for (typename __base::__map_pointer __i = __base::__map_.end();
|
||||
__i != __base::__map_.begin();)
|
||||
__buf.push_front(*--__i);
|
||||
_VSTD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_VSTD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
_STD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_STD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_STD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2417,7 +2405,7 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
|
||||
size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
|
||||
// Number of unused blocks at front:
|
||||
size_type __front_capacity = __front_spare() / __base::__block_size;
|
||||
__front_capacity = _VSTD::min(__front_capacity, __nb); // don't take more than you need
|
||||
__front_capacity = _STD::min(__front_capacity, __nb); // don't take more than you need
|
||||
__nb -= __front_capacity; // number of blocks need to allocate
|
||||
// If __nb == 0, then we have sufficient capacity.
|
||||
if (__nb == 0)
|
||||
@@ -2486,10 +2474,10 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
|
||||
for (typename __base::__map_pointer __i = __base::__map_.end();
|
||||
__i != __base::__map_.begin();)
|
||||
__buf.push_front(*--__i);
|
||||
_VSTD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_VSTD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
_STD::swap(__base::__map_.__first_, __buf.__first_);
|
||||
_STD::swap(__base::__map_.__begin_, __buf.__begin_);
|
||||
_STD::swap(__base::__map_.__end_, __buf.__end_);
|
||||
_STD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
|
||||
__base::__start_ -= __ds;
|
||||
}
|
||||
}
|
||||
@@ -2537,7 +2525,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
|
||||
{
|
||||
// as if
|
||||
// for (; __f != __l; ++__f, ++__r)
|
||||
// *__r = _VSTD::move(*__f);
|
||||
// *__r = _STD::move(*__f);
|
||||
difference_type __n = __l - __f;
|
||||
while (__n > 0)
|
||||
{
|
||||
@@ -2551,7 +2539,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
|
||||
}
|
||||
if (__fb <= __vt && __vt < __fe)
|
||||
__vt = (const_iterator(__f.__m_iter_, __vt) -= __f - __r).__ptr_;
|
||||
__r = _VSTD::move(__fb, __fe, __r);
|
||||
__r = _STD::move(__fb, __fe, __r);
|
||||
__n -= __bs;
|
||||
__f += __bs;
|
||||
}
|
||||
@@ -2567,7 +2555,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
|
||||
{
|
||||
// as if
|
||||
// while (__f != __l)
|
||||
// *--__r = _VSTD::move(*--__l);
|
||||
// *--__r = _STD::move(*--__l);
|
||||
difference_type __n = __l - __f;
|
||||
while (__n > 0)
|
||||
{
|
||||
@@ -2582,7 +2570,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
|
||||
}
|
||||
if (__lb <= __vt && __vt < __le)
|
||||
__vt = (const_iterator(__l.__m_iter_, __vt) += __r - __l - 1).__ptr_;
|
||||
__r = _VSTD::move_backward(__lb, __le, __r);
|
||||
__r = _STD::move_backward(__lb, __le, __r);
|
||||
__n -= __bs;
|
||||
__l -= __bs - 1;
|
||||
}
|
||||
@@ -2599,7 +2587,7 @@ deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l,
|
||||
allocator_type& __a = __base::__alloc();
|
||||
// as if
|
||||
// for (; __f != __l; ++__r, ++__f, ++__base::size())
|
||||
// __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__f));
|
||||
// __alloc_traits::construct(__a, _STD::addressof(*__r), _STD::move(*__f));
|
||||
difference_type __n = __l - __f;
|
||||
while (__n > 0)
|
||||
{
|
||||
@@ -2614,7 +2602,7 @@ deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l,
|
||||
if (__fb <= __vt && __vt < __fe)
|
||||
__vt = (const_iterator(__f.__m_iter_, __vt) += __r - __f).__ptr_;
|
||||
for (; __fb != __fe; ++__fb, ++__r, ++__base::size())
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__fb));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__r), _STD::move(*__fb));
|
||||
__n -= __bs;
|
||||
__f += __bs;
|
||||
}
|
||||
@@ -2631,7 +2619,7 @@ deque<_Tp, _Allocator>::__move_construct_backward_and_check(iterator __f, iterat
|
||||
// as if
|
||||
// for (iterator __j = __l; __j != __f;)
|
||||
// {
|
||||
// __alloc_traitsconstruct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__j));
|
||||
// __alloc_traitsconstruct(__a, _STD::addressof(*--__r), _STD::move(*--__j));
|
||||
// --__base::__start_;
|
||||
// ++__base::size();
|
||||
// }
|
||||
@@ -2651,7 +2639,7 @@ deque<_Tp, _Allocator>::__move_construct_backward_and_check(iterator __f, iterat
|
||||
__vt = (const_iterator(__l.__m_iter_, __vt) -= __l - __r + 1).__ptr_;
|
||||
while (__le != __lb)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__le));
|
||||
__alloc_traits::construct(__a, _STD::addressof(*--__r), _STD::move(*--__le));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
}
|
||||
@@ -2671,8 +2659,8 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
|
||||
allocator_type& __a = __base::__alloc();
|
||||
if (__pos < (__base::size() - 1) / 2)
|
||||
{ // erase from front
|
||||
_VSTD::move_backward(__b, __p, _VSTD::next(__p));
|
||||
__alloc_traits::destroy(__a, _VSTD::addressof(*__b));
|
||||
_STD::move_backward(__b, __p, _STD::next(__p));
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__b));
|
||||
--__base::size();
|
||||
++__base::__start_;
|
||||
if (__front_spare() >= 2 * __base::__block_size)
|
||||
@@ -2684,8 +2672,8 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
|
||||
}
|
||||
else
|
||||
{ // erase from back
|
||||
iterator __i = _VSTD::move(_VSTD::next(__p), __base::end(), __p);
|
||||
__alloc_traits::destroy(__a, _VSTD::addressof(*__i));
|
||||
iterator __i = _STD::move(_STD::next(__p), __base::end(), __p);
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__i));
|
||||
--__base::size();
|
||||
if (__back_spare() >= 2 * __base::__block_size)
|
||||
{
|
||||
@@ -2709,9 +2697,9 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
|
||||
allocator_type& __a = __base::__alloc();
|
||||
if (__pos < (__base::size() - __n) / 2)
|
||||
{ // erase from front
|
||||
iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
|
||||
iterator __i = _STD::move_backward(__b, __p, __p + __n);
|
||||
for (; __b != __i; ++__b)
|
||||
__alloc_traits::destroy(__a, _VSTD::addressof(*__b));
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__b));
|
||||
__base::size() -= __n;
|
||||
__base::__start_ += __n;
|
||||
while (__front_spare() >= 2 * __base::__block_size)
|
||||
@@ -2723,9 +2711,9 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
|
||||
}
|
||||
else
|
||||
{ // erase from back
|
||||
iterator __i = _VSTD::move(__p + __n, __base::end(), __p);
|
||||
iterator __i = _STD::move(__p + __n, __base::end(), __p);
|
||||
for (iterator __e = __base::end(); __i != __e; ++__i)
|
||||
__alloc_traits::destroy(__a, _VSTD::addressof(*__i));
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__i));
|
||||
__base::size() -= __n;
|
||||
while (__back_spare() >= 2 * __base::__block_size)
|
||||
{
|
||||
@@ -2749,7 +2737,7 @@ deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
|
||||
iterator __b = __base::begin();
|
||||
difference_type __pos = __f - __b;
|
||||
for (iterator __p = __b + __pos; __p != __e; ++__p)
|
||||
__alloc_traits::destroy(__a, _VSTD::addressof(*__p));
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__p));
|
||||
__base::size() -= __n;
|
||||
while (__back_spare() >= 2 * __base::__block_size)
|
||||
{
|
||||
@@ -2783,7 +2771,7 @@ bool
|
||||
operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
|
||||
{
|
||||
const typename deque<_Tp, _Allocator>::size_type __sz = __x.size();
|
||||
return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __sz == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -2799,7 +2787,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
|
@@ -199,7 +199,7 @@ throw_with_nested (_Tp& __t, typename enable_if<
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
|
||||
throw __nested<typename remove_reference<_Tp>::type>(_STD::forward<_Tp>(__t));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ throw_with_nested (_Tp& __t, typename enable_if<
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw _VSTD::forward<_Tp>(__t);
|
||||
throw _STD::forward<_Tp>(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -1,46 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===------------------------- hash_set ------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_EXT_HASH
|
||||
#define _LIBCPP_EXT_HASH
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
namespace __gnu_cxx {
|
||||
using namespace std;
|
||||
|
||||
template <typename T> struct _LIBCPP_VISIBLE hash : public std::hash<T>
|
||||
{ };
|
||||
|
||||
template <> struct _LIBCPP_VISIBLE hash<const char*>
|
||||
: public unary_function<const char*, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const char *__c) const _NOEXCEPT
|
||||
{
|
||||
return __do_string_hash(__c, __c + strlen(__c));
|
||||
}
|
||||
};
|
||||
|
||||
template <> struct _LIBCPP_VISIBLE hash<char *>
|
||||
: public unary_function<char*, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(char *__c) const _NOEXCEPT
|
||||
{
|
||||
return __do_string_hash<const char *>(__c, __c + strlen(__c));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif _LIBCPP_EXT_HASH
|
@@ -203,11 +203,8 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
#include <__hash_table>
|
||||
#include <functional>
|
||||
#include <stdexcept>
|
||||
#include <ext/__hash>
|
||||
|
||||
#if __DEPRECATED
|
||||
#warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
|
||||
#endif
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -344,9 +341,9 @@ public:
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
if (__second_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
|
||||
if (__first_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
|
||||
if (__p)
|
||||
__alloc_traits::deallocate(__na_, __p, 1);
|
||||
}
|
||||
@@ -469,7 +466,6 @@ public:
|
||||
// types
|
||||
typedef _Key key_type;
|
||||
typedef _Tp mapped_type;
|
||||
typedef _Tp data_type;
|
||||
typedef _Hash hasher;
|
||||
typedef _Pred key_equal;
|
||||
typedef _Alloc allocator_type;
|
||||
@@ -553,8 +549,6 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
@@ -672,11 +666,11 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second));
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
@@ -748,7 +742,6 @@ public:
|
||||
// types
|
||||
typedef _Key key_type;
|
||||
typedef _Tp mapped_type;
|
||||
typedef _Tp data_type;
|
||||
typedef _Hash hasher;
|
||||
typedef _Pred key_equal;
|
||||
typedef _Alloc allocator_type;
|
||||
@@ -830,8 +823,6 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
@@ -972,9 +963,9 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
{
|
||||
_EqRng __xeq = __x.equal_range(__i->first);
|
||||
_EqRng __yeq = __y.equal_range(__i->first);
|
||||
if (_VSTD::distance(__xeq.first, __xeq.second) !=
|
||||
_VSTD::distance(__yeq.first, __yeq.second) ||
|
||||
!_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
if (_STD::distance(__xeq.first, __xeq.second) !=
|
||||
_STD::distance(__yeq.first, __yeq.second) ||
|
||||
!_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
return false;
|
||||
__i = __xeq.second;
|
||||
}
|
||||
|
@@ -196,17 +196,14 @@ template <class Value, class Hash, class Pred, class Alloc>
|
||||
#include <__config>
|
||||
#include <__hash_table>
|
||||
#include <functional>
|
||||
#include <ext/__hash>
|
||||
|
||||
#if __DEPRECATED
|
||||
#warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>
|
||||
#endif
|
||||
|
||||
namespace __gnu_cxx {
|
||||
|
||||
using namespace std;
|
||||
|
||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
template <class _Value, class _Hash = std::hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE hash_set
|
||||
{
|
||||
@@ -275,8 +272,6 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
@@ -495,8 +490,6 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
@@ -634,9 +627,9 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
{
|
||||
_EqRng __xeq = __x.equal_range(*__i);
|
||||
_EqRng __yeq = __y.equal_range(*__i);
|
||||
if (_VSTD::distance(__xeq.first, __xeq.second) !=
|
||||
_VSTD::distance(__yeq.first, __yeq.second) ||
|
||||
!_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
if (_STD::distance(__xeq.first, __xeq.second) !=
|
||||
_STD::distance(__yeq.first, __yeq.second) ||
|
||||
!_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
return false;
|
||||
__i = __xeq.second;
|
||||
}
|
||||
|
@@ -178,7 +178,7 @@ template <class T, class Allocator>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp, class _VoidPtr> struct __forward_list_node;
|
||||
template <class, class> struct __forward_list_node;
|
||||
|
||||
template <class _NodePtr>
|
||||
struct __forward_begin_node
|
||||
@@ -208,8 +208,8 @@ struct __forward_list_node
|
||||
value_type __value_;
|
||||
};
|
||||
|
||||
template<class _Tp, class _Alloc> class forward_list;
|
||||
template<class _NodeConstPtr> class __forward_list_const_iterator;
|
||||
template<class, class> class forward_list;
|
||||
template<class> class __forward_list_const_iterator;
|
||||
|
||||
template <class _NodePtr>
|
||||
class _LIBCPP_VISIBLE __forward_list_iterator
|
||||
@@ -446,7 +446,7 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__alloc() = _VSTD::move(__x.__alloc());}
|
||||
{__alloc() = _STD::move(__x.__alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
||||
@@ -464,7 +464,7 @@ private:
|
||||
true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
};
|
||||
@@ -475,7 +475,7 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
|
||||
: __before_begin_(_VSTD::move(__x.__before_begin_))
|
||||
: __before_begin_(_STD::move(__x.__before_begin_))
|
||||
{
|
||||
__x.__before_begin()->__next_ = nullptr;
|
||||
}
|
||||
@@ -509,7 +509,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
__swap_alloc(__alloc(), __x.__alloc());
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__before_begin()->__next_, __x.__before_begin()->__next_);
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ __forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
|
||||
for (__node_pointer __p = __before_begin()->__next_; __p != nullptr;)
|
||||
{
|
||||
__node_pointer __next = __p->__next_;
|
||||
__node_traits::destroy(__a, _VSTD::addressof(__p->__value_));
|
||||
__node_traits::destroy(__a, _STD::addressof(__p->__value_));
|
||||
__node_traits::deallocate(__a, __p, 1);
|
||||
__p = __next;
|
||||
}
|
||||
@@ -577,13 +577,11 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
forward_list(forward_list&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<base>::value)
|
||||
: base(_VSTD::move(__x)) {}
|
||||
: base(_STD::move(__x)) {}
|
||||
forward_list(forward_list&& __x, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
forward_list(initializer_list<value_type> __il);
|
||||
forward_list(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
// ~forward_list() = default;
|
||||
|
||||
@@ -594,9 +592,7 @@ public:
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
forward_list& operator=(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _InputIterator>
|
||||
typename enable_if
|
||||
@@ -606,9 +602,7 @@ public:
|
||||
>::type
|
||||
assign(_InputIterator __f, _InputIterator __l);
|
||||
void assign(size_type __n, const value_type& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
void assign(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
@@ -683,10 +677,8 @@ public:
|
||||
iterator
|
||||
>::type
|
||||
insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
|
||||
{return insert_after(__p, __il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
iterator erase_after(const_iterator __p);
|
||||
iterator erase_after(const_iterator __f, const_iterator __l);
|
||||
@@ -726,7 +718,7 @@ public:
|
||||
template <class _Compare>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void merge(forward_list&& __x, _Compare __comp)
|
||||
{merge(__x, _VSTD::move(__comp));}
|
||||
{merge(__x, _STD::move(__comp));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void merge(forward_list& __x) {merge(__x, __less<value_type>());}
|
||||
@@ -774,7 +766,7 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
|
||||
__p = __p->__next_)
|
||||
{
|
||||
__h.reset(__node_traits::allocate(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_));
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_));
|
||||
__h->__next_ = nullptr;
|
||||
__p->__next_ = __h.release();
|
||||
}
|
||||
@@ -840,7 +832,7 @@ forward_list<_Tp, _Alloc>::forward_list(const forward_list& __x,
|
||||
template <class _Tp, class _Alloc>
|
||||
forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
|
||||
const allocator_type& __a)
|
||||
: base(_VSTD::move(__x), __a)
|
||||
: base(_STD::move(__x), __a)
|
||||
{
|
||||
if (base::__alloc() != __x.__alloc())
|
||||
{
|
||||
@@ -851,8 +843,6 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il)
|
||||
{
|
||||
@@ -867,8 +857,6 @@ forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il,
|
||||
insert_after(cbefore_begin(), __il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
forward_list<_Tp, _Alloc>&
|
||||
forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
|
||||
@@ -922,8 +910,6 @@ forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
forward_list<_Tp, _Alloc>&
|
||||
@@ -933,8 +919,6 @@ forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
typename enable_if
|
||||
@@ -945,7 +929,7 @@ typename enable_if
|
||||
forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
|
||||
{
|
||||
iterator __i = before_begin();
|
||||
iterator __j = _VSTD::next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
iterator __e = end();
|
||||
for (; __j != __e && __f != __l; ++__i, ++__j, ++__f)
|
||||
*__j = *__f;
|
||||
@@ -960,7 +944,7 @@ void
|
||||
forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
|
||||
{
|
||||
iterator __i = before_begin();
|
||||
iterator __j = _VSTD::next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
iterator __e = end();
|
||||
for (; __j != __e && __n > 0; --__n, ++__i, ++__j)
|
||||
*__j = __v;
|
||||
@@ -970,8 +954,6 @@ forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
|
||||
erase_after(__i, __e);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
@@ -980,8 +962,6 @@ forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
|
||||
assign(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
@@ -993,8 +973,8 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
__h->__next_ = base::__before_begin()->__next_;
|
||||
base::__before_begin()->__next_ = __h.release();
|
||||
}
|
||||
@@ -1008,7 +988,7 @@ forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), _STD::move(__v));
|
||||
__h->__next_ = base::__before_begin()->__next_;
|
||||
base::__before_begin()->__next_ = __h.release();
|
||||
}
|
||||
@@ -1022,7 +1002,7 @@ forward_list<_Tp, _Alloc>::push_front(const value_type& __v)
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
|
||||
__h->__next_ = base::__before_begin()->__next_;
|
||||
base::__before_begin()->__next_ = __h.release();
|
||||
}
|
||||
@@ -1034,7 +1014,7 @@ forward_list<_Tp, _Alloc>::pop_front()
|
||||
__node_allocator& __a = base::__alloc();
|
||||
__node_pointer __p = base::__before_begin()->__next_;
|
||||
base::__before_begin()->__next_ = __p->__next_;
|
||||
__node_traits::destroy(__a, _VSTD::addressof(__p->__value_));
|
||||
__node_traits::destroy(__a, _STD::addressof(__p->__value_));
|
||||
__node_traits::deallocate(__a, __p, 1);
|
||||
}
|
||||
|
||||
@@ -1050,8 +1030,8 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args)
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
__h->__next_ = __r->__next_;
|
||||
__r->__next_ = __h.release();
|
||||
return iterator(__r->__next_);
|
||||
@@ -1067,7 +1047,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), _STD::move(__v));
|
||||
__h->__next_ = __r->__next_;
|
||||
__r->__next_ = __h.release();
|
||||
return iterator(__r->__next_);
|
||||
@@ -1083,7 +1063,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, const value_type& __
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
|
||||
__h->__next_ = __r->__next_;
|
||||
__r->__next_ = __h.release();
|
||||
return iterator(__r->__next_);
|
||||
@@ -1100,7 +1080,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
|
||||
__node_pointer __first = __h.release();
|
||||
__node_pointer __last = __first;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -1110,7 +1090,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
|
||||
for (--__n; __n != 0; --__n, __last = __last->__next_)
|
||||
{
|
||||
__h.reset(__node_traits::allocate(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
|
||||
__last->__next_ = __h.release();
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -1120,7 +1100,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
|
||||
while (__first != nullptr)
|
||||
{
|
||||
__node_pointer __next = __first->__next_;
|
||||
__node_traits::destroy(__a, _VSTD::addressof(__first->__value_));
|
||||
__node_traits::destroy(__a, _STD::addressof(__first->__value_));
|
||||
__node_traits::deallocate(__a, __first, 1);
|
||||
__first = __next;
|
||||
}
|
||||
@@ -1150,7 +1130,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
|
||||
__node_allocator& __a = base::__alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _D;
|
||||
unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), *__f);
|
||||
__node_pointer __first = __h.release();
|
||||
__node_pointer __last = __first;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -1160,7 +1140,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
|
||||
for (++__f; __f != __l; ++__f, __last = __last->__next_)
|
||||
{
|
||||
__h.reset(__node_traits::allocate(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), *__f);
|
||||
__last->__next_ = __h.release();
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -1170,7 +1150,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
|
||||
while (__first != nullptr)
|
||||
{
|
||||
__node_pointer __next = __first->__next_;
|
||||
__node_traits::destroy(__a, _VSTD::addressof(__first->__value_));
|
||||
__node_traits::destroy(__a, _STD::addressof(__first->__value_));
|
||||
__node_traits::deallocate(__a, __first, 1);
|
||||
__first = __next;
|
||||
}
|
||||
@@ -1192,7 +1172,7 @@ forward_list<_Tp, _Alloc>::erase_after(const_iterator __f)
|
||||
__node_pointer __n = __p->__next_;
|
||||
__p->__next_ = __n->__next_;
|
||||
__node_allocator& __a = base::__alloc();
|
||||
__node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
|
||||
__node_traits::destroy(__a, _STD::addressof(__n->__value_));
|
||||
__node_traits::deallocate(__a, __n, 1);
|
||||
return iterator(__p->__next_);
|
||||
}
|
||||
@@ -1213,7 +1193,7 @@ forward_list<_Tp, _Alloc>::erase_after(const_iterator __f, const_iterator __l)
|
||||
do
|
||||
{
|
||||
__p = __n->__next_;
|
||||
__node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
|
||||
__node_traits::destroy(__a, _STD::addressof(__n->__value_));
|
||||
__node_traits::deallocate(__a, __n, 1);
|
||||
__n = __p;
|
||||
} while (__n != __e);
|
||||
@@ -1246,7 +1226,7 @@ forward_list<_Tp, _Alloc>::resize(size_type __n)
|
||||
__ptr = __ptr->__next_)
|
||||
{
|
||||
__h.reset(__node_traits::allocate(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_));
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_));
|
||||
__h->__next_ = nullptr;
|
||||
__ptr->__next_ = __h.release();
|
||||
}
|
||||
@@ -1278,7 +1258,7 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v)
|
||||
__ptr = __ptr->__next_)
|
||||
{
|
||||
__h.reset(__node_traits::allocate(__a, 1));
|
||||
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
|
||||
__node_traits::construct(__a, _STD::addressof(__h->__value_), __v);
|
||||
__h->__next_ = nullptr;
|
||||
__ptr->__next_ = __h.release();
|
||||
}
|
||||
@@ -1313,7 +1293,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
forward_list& __x,
|
||||
const_iterator __i)
|
||||
{
|
||||
const_iterator __lm1 = _VSTD::next(__i);
|
||||
const_iterator __lm1 = _STD::next(__i);
|
||||
if (__p != __i && __p != __lm1)
|
||||
{
|
||||
const_cast<__node_pointer>(__i.__ptr_)->__next_ =
|
||||
@@ -1390,7 +1370,7 @@ forward_list<_Tp, _Alloc>::remove(const value_type& __v)
|
||||
{
|
||||
if (__i.__ptr_->__next_->__value_ == __v)
|
||||
{
|
||||
iterator __j = _VSTD::next(__i, 2);
|
||||
iterator __j = _STD::next(__i, 2);
|
||||
for (; __j != __e && *__j == __v; ++__j)
|
||||
;
|
||||
erase_after(__i, __j);
|
||||
@@ -1413,7 +1393,7 @@ forward_list<_Tp, _Alloc>::remove_if(_Predicate __pred)
|
||||
{
|
||||
if (__pred(__i.__ptr_->__next_->__value_))
|
||||
{
|
||||
iterator __j = _VSTD::next(__i, 2);
|
||||
iterator __j = _STD::next(__i, 2);
|
||||
for (; __j != __e && __pred(*__j); ++__j)
|
||||
;
|
||||
erase_after(__i, __j);
|
||||
@@ -1433,7 +1413,7 @@ forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
|
||||
{
|
||||
for (iterator __i = begin(), __e = end(); __i != __e;)
|
||||
{
|
||||
iterator __j = _VSTD::next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
|
||||
;
|
||||
if (__i.__ptr_->__next_ != __j.__ptr_)
|
||||
@@ -1508,7 +1488,7 @@ void
|
||||
forward_list<_Tp, _Alloc>::sort(_Compare __comp)
|
||||
{
|
||||
base::__before_begin()->__next_ = __sort(base::__before_begin()->__next_,
|
||||
_VSTD::distance(begin(), end()), __comp);
|
||||
_STD::distance(begin(), end()), __comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
@@ -1534,7 +1514,7 @@ forward_list<_Tp, _Alloc>::__sort(__node_pointer __f1, difference_type __sz,
|
||||
}
|
||||
difference_type __sz1 = __sz / 2;
|
||||
difference_type __sz2 = __sz - __sz1;
|
||||
__node_pointer __t = _VSTD::next(iterator(__f1), __sz1 - 1).__ptr_;
|
||||
__node_pointer __t = _STD::next(iterator(__f1), __sz1 - 1).__ptr_;
|
||||
__node_pointer __f2 = __t->__next_;
|
||||
__t->__next_ = nullptr;
|
||||
return __merge(__sort(__f1, __sz1, __comp),
|
||||
@@ -1590,7 +1570,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator< (const forward_list<_Tp, _Alloc>& __x,
|
||||
const forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(),
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(),
|
||||
__y.begin(), __y.end());
|
||||
}
|
||||
|
||||
|
@@ -362,9 +362,9 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
||||
basic_streambuf<char_type, traits_type>::swap(__rhs);
|
||||
if (__extbuf_ != __extbuf_min_ && __rhs.__extbuf_ != __rhs.__extbuf_min_)
|
||||
{
|
||||
_VSTD::swap(__extbuf_, __rhs.__extbuf_);
|
||||
_VSTD::swap(__extbufnext_, __rhs.__extbufnext_);
|
||||
_VSTD::swap(__extbufend_, __rhs.__extbufend_);
|
||||
_STD::swap(__extbuf_, __rhs.__extbuf_);
|
||||
_STD::swap(__extbufnext_, __rhs.__extbufnext_);
|
||||
_STD::swap(__extbufend_, __rhs.__extbufend_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -387,17 +387,17 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
||||
__rhs.__extbufnext_ = __rhs.__extbuf_ + __ln;
|
||||
__rhs.__extbufend_ = __rhs.__extbuf_ + __le;
|
||||
}
|
||||
_VSTD::swap(__ebs_, __rhs.__ebs_);
|
||||
_VSTD::swap(__intbuf_, __rhs.__intbuf_);
|
||||
_VSTD::swap(__ibs_, __rhs.__ibs_);
|
||||
_VSTD::swap(__file_, __rhs.__file_);
|
||||
_VSTD::swap(__cv_, __rhs.__cv_);
|
||||
_VSTD::swap(__st_, __rhs.__st_);
|
||||
_VSTD::swap(__om_, __rhs.__om_);
|
||||
_VSTD::swap(__cm_, __rhs.__cm_);
|
||||
_VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
|
||||
_VSTD::swap(__owns_ib_, __rhs.__owns_ib_);
|
||||
_VSTD::swap(__always_noconv_, __rhs.__always_noconv_);
|
||||
_STD::swap(__ebs_, __rhs.__ebs_);
|
||||
_STD::swap(__intbuf_, __rhs.__intbuf_);
|
||||
_STD::swap(__ibs_, __rhs.__ibs_);
|
||||
_STD::swap(__file_, __rhs.__file_);
|
||||
_STD::swap(__cv_, __rhs.__cv_);
|
||||
_STD::swap(__st_, __rhs.__st_);
|
||||
_STD::swap(__om_, __rhs.__om_);
|
||||
_STD::swap(__cm_, __rhs.__cm_);
|
||||
_STD::swap(__owns_eb_, __rhs.__owns_eb_);
|
||||
_STD::swap(__owns_ib_, __rhs.__owns_ib_);
|
||||
_STD::swap(__always_noconv_, __rhs.__always_noconv_);
|
||||
if (this->eback() == (char_type*)__rhs.__extbuf_min_)
|
||||
{
|
||||
ptrdiff_t __n = this->gptr() - this->eback();
|
||||
@@ -587,7 +587,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
|
||||
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
||||
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
||||
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
||||
size_t __nmemb = _VSTD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
||||
size_t __nmemb = _STD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
||||
static_cast<size_t>(__extbufend_ - __extbufnext_));
|
||||
codecvt_base::result __r;
|
||||
state_type __svs = __st_;
|
||||
@@ -1019,8 +1019,8 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
|
||||
: basic_istream<char_type, traits_type>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_istream<char_type, traits_type>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
this->set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -1030,8 +1030,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ifstream<_CharT, _Traits>&
|
||||
basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
|
||||
{
|
||||
basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_istream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1164,8 +1164,8 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
|
||||
: basic_ostream<char_type, traits_type>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_ostream<char_type, traits_type>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
this->set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -1175,8 +1175,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ofstream<_CharT, _Traits>&
|
||||
basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
|
||||
{
|
||||
basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_ostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1309,8 +1309,8 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
|
||||
: basic_iostream<char_type, traits_type>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_iostream<char_type, traits_type>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
this->set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -1320,8 +1320,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_fstream<_CharT, _Traits>&
|
||||
basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
|
||||
{
|
||||
basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_iostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -884,7 +884,7 @@ public:
|
||||
typename __invoke_return<type, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args)
|
||||
{
|
||||
return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
|
||||
return __invoke(__f_, _STD::forward<_ArgTypes>(__args)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -992,9 +992,9 @@ class __func<_F, _Alloc, _R(_ArgTypes...)>
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_ArgTypes...)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_ArgTypes...)>*) const;
|
||||
virtual void destroy() _NOEXCEPT;
|
||||
@@ -1046,7 +1046,7 @@ template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
_R
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
|
||||
{
|
||||
return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
|
||||
return __invoke(__f_.first(), _STD::forward<_ArgTypes>(__arg)...);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
@@ -1162,7 +1162,7 @@ public:
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F&& __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, _VSTD::forward<_F>(__f)).swap(*this);}
|
||||
{function(allocator_arg, __a, _STD::forward<_F>(__f)).swap(*this);}
|
||||
|
||||
// function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1263,7 +1263,7 @@ function<_R(_ArgTypes...)>::function(_F __f,
|
||||
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value)
|
||||
{
|
||||
__f_ = (__base*)&__buf_;
|
||||
::new (__f_) _FF(_VSTD::move(__f));
|
||||
::new (__f_) _FF(_STD::move(__f));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1271,7 +1271,7 @@ function<_R(_ArgTypes...)>::function(_F __f,
|
||||
_A __a;
|
||||
typedef __allocator_destructor<_A> _D;
|
||||
unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
|
||||
::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_F>(__a));
|
||||
::new (__hold.get()) _FF(_STD::move(__f), allocator<_F>(__a));
|
||||
__f_ = __hold.release();
|
||||
}
|
||||
}
|
||||
@@ -1290,7 +1290,7 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f
|
||||
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value)
|
||||
{
|
||||
__f_ = (__base*)&__buf_;
|
||||
::new (__f_) _FF(_VSTD::move(__f));
|
||||
::new (__f_) _FF(_STD::move(__f));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1304,7 +1304,7 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f
|
||||
_A __a(__a0);
|
||||
typedef __allocator_destructor<_A> _D;
|
||||
unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
|
||||
::new (__hold.get()) _FF(_VSTD::move(__f), _Alloc(__a));
|
||||
::new (__hold.get()) _FF(_STD::move(__f), _Alloc(__a));
|
||||
__f_ = __hold.release();
|
||||
}
|
||||
}
|
||||
@@ -1361,7 +1361,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_ArgTypes...)>::operator=(_F&& __f)
|
||||
{
|
||||
function(_VSTD::forward<_F>(__f)).swap(*this);
|
||||
function(_STD::forward<_F>(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1408,7 +1408,7 @@ function<_R(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
@@ -1419,7 +1419,7 @@ function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
|
||||
if (__f_ == 0)
|
||||
throw bad_function_call();
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
|
||||
return (*__f_)(_STD::forward<_ArgTypes>(__arg)...);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
@@ -1524,7 +1524,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_of<_Ti&, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
|
||||
{
|
||||
return __ti(_VSTD::forward<_Uj>(get<_Indx>(__uj))...);
|
||||
return __ti(_STD::forward<_Uj>(get<_Indx>(__uj))...);
|
||||
}
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
@@ -1559,7 +1559,7 @@ typename enable_if
|
||||
__mu(_Ti&, _Uj& __uj)
|
||||
{
|
||||
const size_t _Indx = is_placeholder<_Ti>::value - 1;
|
||||
return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
|
||||
return _STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
|
||||
}
|
||||
|
||||
template <class _Ti, class _Uj>
|
||||
@@ -1666,41 +1666,16 @@ class __bind
|
||||
|
||||
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
|
||||
public:
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind(const __bind& __b)
|
||||
: __f_(__b.__f_),
|
||||
__bound_args_(__b.__bound_args_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind& operator=(const __bind& __b)
|
||||
{
|
||||
__f_ = __b.__f_;
|
||||
__bound_args_ = __b.__bound_args_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind(__bind&& __b)
|
||||
: __f_(_VSTD::move(__b.__f_)),
|
||||
__bound_args_(_VSTD::move(__b.__bound_args_)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind& operator=(__bind&& __b)
|
||||
{
|
||||
__f_ = _VSTD::move(__b.__f_);
|
||||
__bound_args_ = _VSTD::move(__b.__bound_args_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
: __f_(_STD::move(__b.__f_)),
|
||||
__bound_args_(_STD::move(__b.__bound_args_)) {}
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __bind(_G&& __f, _BA&& ...__bound_args)
|
||||
: __f_(_VSTD::forward<_G>(__f)),
|
||||
__bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
: __f_(_STD::forward<_G>(__f)),
|
||||
__bound_args_(_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1708,7 +1683,7 @@ public:
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
|
||||
tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
@@ -1717,7 +1692,7 @@ public:
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
|
||||
tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1732,44 +1707,22 @@ class __bind_r
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r(const __bind_r& __b)
|
||||
: base(_VSTD::forward<const base&>(__b)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r& operator=(const __bind_r& __b)
|
||||
{
|
||||
base::operator=(_VSTD::forward<const base&>(__b));
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r(__bind_r&& __b)
|
||||
: base(_VSTD::forward<base>(__b)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r& operator=(__bind_r&& __b)
|
||||
{
|
||||
base::operator=(_VSTD::forward<base>(__b));
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
: base(_STD::forward<base>(__b)) {}
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
|
||||
: base(_VSTD::forward<_G>(__f),
|
||||
_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
: base(_STD::forward<_G>(__f),
|
||||
_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||
return base::operator()(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
@@ -1777,7 +1730,7 @@ public:
|
||||
result_type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||
return base::operator()(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1790,7 +1743,7 @@ __bind<_F, _BoundArgs...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind<_F, _BoundArgs...> type;
|
||||
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
template<class _R, class _F, class ..._BoundArgs>
|
||||
@@ -1799,7 +1752,7 @@ __bind_r<_R, _F, _BoundArgs...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind_r<_R, _F, _BoundArgs...> type;
|
||||
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
164
include/future
164
include/future
@@ -452,8 +452,6 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const error_code& code() const throw() {return __ec_;}
|
||||
|
||||
virtual ~future_error() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class __assoc_sub_state
|
||||
@@ -585,11 +583,9 @@ __assoc_state<_R>::set_value(_Arg& __arg)
|
||||
#endif
|
||||
{
|
||||
unique_lock<mutex> __lk(this->__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (this->__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
::new(&__value_) _R(_VSTD::forward<_Arg>(__arg));
|
||||
::new(&__value_) _R(_STD::forward<_Arg>(__arg));
|
||||
this->__state_ |= base::__constructed | base::ready;
|
||||
__lk.unlock();
|
||||
__cv_.notify_all();
|
||||
@@ -605,11 +601,9 @@ __assoc_state<_R>::set_value_at_thread_exit(_Arg& __arg)
|
||||
#endif
|
||||
{
|
||||
unique_lock<mutex> __lk(this->__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (this->__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
::new(&__value_) _R(_VSTD::forward<_Arg>(__arg));
|
||||
::new(&__value_) _R(_STD::forward<_Arg>(__arg));
|
||||
this->__state_ |= base::__constructed;
|
||||
__thread_local_data()->__make_ready_at_thread_exit(this);
|
||||
__lk.unlock();
|
||||
@@ -623,7 +617,7 @@ __assoc_state<_R>::move()
|
||||
this->__sub_wait(__lk);
|
||||
if (this->__exception_ != nullptr)
|
||||
rethrow_exception(this->__exception_);
|
||||
return _VSTD::move(*reinterpret_cast<_R*>(&__value_));
|
||||
return _STD::move(*reinterpret_cast<_R*>(&__value_));
|
||||
}
|
||||
|
||||
template <class _R>
|
||||
@@ -667,10 +661,8 @@ void
|
||||
__assoc_state<_R&>::set_value(_R& __arg)
|
||||
{
|
||||
unique_lock<mutex> __lk(this->__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (this->__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
__value_ = &__arg;
|
||||
this->__state_ |= base::__constructed | base::ready;
|
||||
__lk.unlock();
|
||||
@@ -682,10 +674,8 @@ void
|
||||
__assoc_state<_R&>::set_value_at_thread_exit(_R& __arg)
|
||||
{
|
||||
unique_lock<mutex> __lk(this->__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (this->__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
__value_ = &__arg;
|
||||
this->__state_ |= base::__constructed;
|
||||
__thread_local_data()->__make_ready_at_thread_exit(this);
|
||||
@@ -796,7 +786,7 @@ public:
|
||||
template <class _R, class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__deferred_assoc_state<_R, _F>::__deferred_assoc_state(_F&& __f)
|
||||
: __func_(_VSTD::forward<_F>(__f))
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
this->__set_deferred();
|
||||
}
|
||||
@@ -842,7 +832,7 @@ public:
|
||||
template <class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__deferred_assoc_state<void, _F>::__deferred_assoc_state(_F&& __f)
|
||||
: __func_(_VSTD::forward<_F>(__f))
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
this->__set_deferred();
|
||||
}
|
||||
@@ -890,7 +880,7 @@ public:
|
||||
template <class _R, class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__async_assoc_state<_R, _F>::__async_assoc_state(_F&& __f)
|
||||
: __func_(_VSTD::forward<_F>(__f))
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -944,7 +934,7 @@ public:
|
||||
template <class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__async_assoc_state<void, _F>::__async_assoc_state(_F&& __f)
|
||||
: __func_(_VSTD::forward<_F>(__f))
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -977,8 +967,9 @@ __async_assoc_state<void, _F>::__on_zero_shared() _NOEXCEPT
|
||||
base::__on_zero_shared();
|
||||
}
|
||||
|
||||
template <class _R> class promise;
|
||||
template <class _R> class shared_future;
|
||||
template <class> class promise;
|
||||
template <class> class shared_future;
|
||||
template <class> class atomic_future;
|
||||
|
||||
// future
|
||||
|
||||
@@ -1009,6 +1000,7 @@ class _LIBCPP_VISIBLE future
|
||||
|
||||
template <class> friend class promise;
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
@@ -1050,7 +1042,7 @@ public:
|
||||
_R get();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// functions to check state
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1074,10 +1066,8 @@ template <class _R>
|
||||
future<_R>::future(__assoc_state<_R>* __state)
|
||||
: __state_(__state)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_->__has_future_attached())
|
||||
throw future_error(make_error_code(future_errc::future_already_retrieved));
|
||||
#endif
|
||||
__state_->__add_shared();
|
||||
__state_->__set_future_attached();
|
||||
}
|
||||
@@ -1113,6 +1103,7 @@ class _LIBCPP_VISIBLE future<_R&>
|
||||
|
||||
template <class> friend class promise;
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
@@ -1154,7 +1145,7 @@ public:
|
||||
_R& get();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// functions to check state
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1178,10 +1169,8 @@ template <class _R>
|
||||
future<_R&>::future(__assoc_state<_R&>* __state)
|
||||
: __state_(__state)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_->__has_future_attached())
|
||||
throw future_error(make_error_code(future_errc::future_already_retrieved));
|
||||
#endif
|
||||
__state_->__add_shared();
|
||||
__state_->__set_future_attached();
|
||||
}
|
||||
@@ -1212,6 +1201,7 @@ class _LIBCPP_VISIBLE future<void>
|
||||
|
||||
template <class> friend class promise;
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
@@ -1253,7 +1243,7 @@ public:
|
||||
void get();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// functions to check state
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1283,7 +1273,7 @@ swap(future<_R>& __x, future<_R>& __y)
|
||||
|
||||
// promise<R>
|
||||
|
||||
template <class _Callable> class packaged_task;
|
||||
template <class> class packaged_task;
|
||||
|
||||
template <class _R>
|
||||
class _LIBCPP_VISIBLE promise
|
||||
@@ -1325,7 +1315,7 @@ private:
|
||||
public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(promise& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// retrieving the result
|
||||
future<_R> get_future();
|
||||
@@ -1380,10 +1370,8 @@ template <class _R>
|
||||
future<_R>
|
||||
promise<_R>::get_future()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
return future<_R>(__state_);
|
||||
}
|
||||
|
||||
@@ -1391,10 +1379,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R>::set_value(const _R& __r)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value(__r);
|
||||
}
|
||||
|
||||
@@ -1404,11 +1390,9 @@ template <class _R>
|
||||
void
|
||||
promise<_R>::set_value(_R&& __r)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value(_VSTD::move(__r));
|
||||
__state_->set_value(_STD::move(__r));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1417,10 +1401,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R>::set_exception(exception_ptr __p)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_exception(__p);
|
||||
}
|
||||
|
||||
@@ -1428,10 +1410,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R>::set_value_at_thread_exit(const _R& __r)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value_at_thread_exit(__r);
|
||||
}
|
||||
|
||||
@@ -1441,11 +1421,9 @@ template <class _R>
|
||||
void
|
||||
promise<_R>::set_value_at_thread_exit(_R&& __r)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value_at_thread_exit(_VSTD::move(__r));
|
||||
__state_->set_value_at_thread_exit(_STD::move(__r));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1454,10 +1432,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R>::set_exception_at_thread_exit(exception_ptr __p)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_exception_at_thread_exit(__p);
|
||||
}
|
||||
|
||||
@@ -1504,7 +1480,7 @@ private:
|
||||
public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(promise& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// retrieving the result
|
||||
future<_R&> get_future();
|
||||
@@ -1553,10 +1529,8 @@ template <class _R>
|
||||
future<_R&>
|
||||
promise<_R&>::get_future()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
return future<_R&>(__state_);
|
||||
}
|
||||
|
||||
@@ -1564,10 +1538,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R&>::set_value(_R& __r)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value(__r);
|
||||
}
|
||||
|
||||
@@ -1575,10 +1547,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R&>::set_exception(exception_ptr __p)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_exception(__p);
|
||||
}
|
||||
|
||||
@@ -1586,10 +1556,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R&>::set_value_at_thread_exit(_R& __r)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value_at_thread_exit(__r);
|
||||
}
|
||||
|
||||
@@ -1597,10 +1565,8 @@ template <class _R>
|
||||
void
|
||||
promise<_R&>::set_exception_at_thread_exit(exception_ptr __p)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_exception_at_thread_exit(__p);
|
||||
}
|
||||
|
||||
@@ -1647,7 +1613,7 @@ private:
|
||||
public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(promise& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// retrieving the result
|
||||
future<void> get_future();
|
||||
@@ -1717,13 +1683,13 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __packaged_task_func(const _F& __f) : __f_(__f) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __packaged_task_func(_F&& __f) : __f_(_VSTD::move(__f)) {}
|
||||
explicit __packaged_task_func(_F&& __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__packaged_task_func(const _F& __f, const _Alloc& __a)
|
||||
: __f_(__f, __a) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__packaged_task_func(_F&& __f, const _Alloc& __a)
|
||||
: __f_(_VSTD::move(__f), __a) {}
|
||||
: __f_(_STD::move(__f), __a) {}
|
||||
virtual void __move_to(__packaged_task_base<_R(_ArgTypes...)>*);
|
||||
virtual void destroy();
|
||||
virtual void destroy_deallocate();
|
||||
@@ -1735,7 +1701,7 @@ void
|
||||
__packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::__move_to(
|
||||
__packaged_task_base<_R(_ArgTypes...)>* __p)
|
||||
{
|
||||
::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
|
||||
::new (__p) __packaged_task_func(_STD::move(__f_.first()), _STD::move(__f_.second()));
|
||||
}
|
||||
|
||||
template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
@@ -1759,10 +1725,10 @@ template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
_R
|
||||
__packaged_task_func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
|
||||
{
|
||||
return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
|
||||
return __invoke(__f_.first(), _STD::forward<_ArgTypes>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _Callable> class __packaged_task_function;
|
||||
template <class> class __packaged_task_function;
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
class __packaged_task_function<_R(_ArgTypes...)>
|
||||
@@ -1822,7 +1788,7 @@ __packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(_F&& __f)
|
||||
if (sizeof(_FF) <= sizeof(__buf_))
|
||||
{
|
||||
__f_ = (__base*)&__buf_;
|
||||
::new (__f_) _FF(_VSTD::forward<_F>(__f));
|
||||
::new (__f_) _FF(_STD::forward<_F>(__f));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1830,7 +1796,7 @@ __packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(_F&& __f)
|
||||
_A __a;
|
||||
typedef __allocator_destructor<_A> _D;
|
||||
unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
|
||||
::new (__hold.get()) _FF(_VSTD::forward<_F>(__f), allocator<_FR>(__a));
|
||||
::new (__hold.get()) _FF(_STD::forward<_F>(__f), allocator<_FR>(__a));
|
||||
__f_ = __hold.release();
|
||||
}
|
||||
}
|
||||
@@ -1847,7 +1813,7 @@ __packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(
|
||||
if (sizeof(_FF) <= sizeof(__buf_))
|
||||
{
|
||||
__f_ = (__base*)&__buf_;
|
||||
::new (__f_) _FF(_VSTD::forward<_F>(__f));
|
||||
::new (__f_) _FF(_STD::forward<_F>(__f));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1861,7 +1827,7 @@ __packaged_task_function<_R(_ArgTypes...)>::__packaged_task_function(
|
||||
_A __a(__a0);
|
||||
typedef __allocator_destructor<_A> _D;
|
||||
unique_ptr<__base, _D> __hold(__a.allocate(1), _D(__a, 1));
|
||||
::new (__hold.get()) _FF(_VSTD::forward<_F>(__f), _Alloc(__a));
|
||||
::new (__hold.get()) _FF(_STD::forward<_F>(__f), _Alloc(__a));
|
||||
__f_ = __hold.release();
|
||||
}
|
||||
}
|
||||
@@ -1932,7 +1898,7 @@ __packaged_task_function<_R(_ArgTypes...)>::swap(__packaged_task_function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
@@ -1940,7 +1906,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
_R
|
||||
__packaged_task_function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
|
||||
{
|
||||
return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
|
||||
return (*__f_)(_STD::forward<_ArgTypes>(__arg)...);
|
||||
}
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
@@ -1959,11 +1925,11 @@ public:
|
||||
packaged_task() : __p_(nullptr) {}
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit packaged_task(_F&& __f) : __f_(_VSTD::forward<_F>(__f)) {}
|
||||
explicit packaged_task(_F&& __f) : __f_(_STD::forward<_F>(__f)) {}
|
||||
template <class _F, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit packaged_task(allocator_arg_t, const _Allocator& __a, _F&& __f)
|
||||
: __f_(allocator_arg, __a, _VSTD::forward<_F>(__f)),
|
||||
: __f_(allocator_arg, __a, _STD::forward<_F>(__f)),
|
||||
__p_(allocator_arg, __a) {}
|
||||
// ~packaged_task() = default;
|
||||
|
||||
@@ -1974,12 +1940,12 @@ public:
|
||||
// move support
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task(packaged_task&& __other)
|
||||
: __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
|
||||
: __f_(_STD::move(__other.__f_)), __p_(_STD::move(__other.__p_)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task& operator=(packaged_task&& __other)
|
||||
{
|
||||
__f_ = _VSTD::move(__other.__f_);
|
||||
__p_ = _VSTD::move(__other.__p_);
|
||||
__f_ = _STD::move(__other.__f_);
|
||||
__p_ = _STD::move(__other.__p_);
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2015,7 +1981,7 @@ packaged_task<_R(_ArgTypes...)>::operator()(_ArgTypes... __args)
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
|
||||
__p_.set_value(__f_(_STD::forward<_ArgTypes>(__args)...));
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
@@ -2037,7 +2003,7 @@ packaged_task<_R(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args)
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
|
||||
__p_.set_value_at_thread_exit(__f_(_STD::forward<_ArgTypes>(__args)...));
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
@@ -2074,11 +2040,11 @@ public:
|
||||
packaged_task() : __p_(nullptr) {}
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit packaged_task(_F&& __f) : __f_(_VSTD::forward<_F>(__f)) {}
|
||||
explicit packaged_task(_F&& __f) : __f_(_STD::forward<_F>(__f)) {}
|
||||
template <class _F, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit packaged_task(allocator_arg_t, const _Allocator& __a, _F&& __f)
|
||||
: __f_(allocator_arg, __a, _VSTD::forward<_F>(__f)),
|
||||
: __f_(allocator_arg, __a, _STD::forward<_F>(__f)),
|
||||
__p_(allocator_arg, __a) {}
|
||||
// ~packaged_task() = default;
|
||||
|
||||
@@ -2089,12 +2055,12 @@ public:
|
||||
// move support
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task(packaged_task&& __other)
|
||||
: __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
|
||||
: __f_(_STD::move(__other.__f_)), __p_(_STD::move(__other.__p_)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task& operator=(packaged_task&& __other)
|
||||
{
|
||||
__f_ = _VSTD::move(__other.__f_);
|
||||
__p_ = _VSTD::move(__other.__p_);
|
||||
__f_ = _STD::move(__other.__f_);
|
||||
__p_ = _STD::move(__other.__p_);
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2130,7 +2096,7 @@ packaged_task<void(_ArgTypes...)>::operator()(_ArgTypes... __args)
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__f_(_VSTD::forward<_ArgTypes>(__args)...);
|
||||
__f_(_STD::forward<_ArgTypes>(__args)...);
|
||||
__p_.set_value();
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -2153,7 +2119,7 @@ packaged_task<void(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__f_(_VSTD::forward<_ArgTypes>(__args)...);
|
||||
__f_(_STD::forward<_ArgTypes>(__args)...);
|
||||
__p_.set_value_at_thread_exit();
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -2196,7 +2162,7 @@ __make_deferred_assoc_state(_F __f)
|
||||
#endif
|
||||
{
|
||||
unique_ptr<__deferred_assoc_state<_R, _F>, __release_shared_count>
|
||||
__h(new __deferred_assoc_state<_R, _F>(_VSTD::forward<_F>(__f)));
|
||||
__h(new __deferred_assoc_state<_R, _F>(_STD::forward<_F>(__f)));
|
||||
return future<_R>(__h.get());
|
||||
}
|
||||
|
||||
@@ -2209,8 +2175,8 @@ __make_async_assoc_state(_F __f)
|
||||
#endif
|
||||
{
|
||||
unique_ptr<__async_assoc_state<_R, _F>, __release_shared_count>
|
||||
__h(new __async_assoc_state<_R, _F>(_VSTD::forward<_F>(__f)));
|
||||
_VSTD::thread(&__async_assoc_state<_R, _F>::__execute, __h.get()).detach();
|
||||
__h(new __async_assoc_state<_R, _F>(_STD::forward<_F>(__f)));
|
||||
_STD::thread(&__async_assoc_state<_R, _F>::__execute, __h.get()).detach();
|
||||
return future<_R>(__h.get());
|
||||
}
|
||||
|
||||
@@ -2224,10 +2190,10 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __async_func(_F&& __f, _Args&&... __args)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__args)...) {}
|
||||
: __f_(_STD::move(__f), _STD::move(__args)...) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__async_func(__async_func&& __f) : __f_(_VSTD::move(__f.__f_)) {}
|
||||
__async_func(__async_func&& __f) : __f_(_STD::move(__f.__f_)) {}
|
||||
|
||||
_R operator()()
|
||||
{
|
||||
@@ -2239,7 +2205,7 @@ private:
|
||||
_R
|
||||
__execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
return __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
|
||||
return __invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2251,11 +2217,11 @@ async(launch __policy, _F&& __f, _Args&&... __args)
|
||||
typedef typename _BF::_R _R;
|
||||
future<_R> __r;
|
||||
if (__policy & launch::async)
|
||||
__r = _VSTD::__make_async_assoc_state<_R>(_BF(__decay_copy(_VSTD::forward<_F>(__f)),
|
||||
__decay_copy(_VSTD::forward<_Args>(__args))...));
|
||||
__r = _STD::__make_async_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
else if (__policy & launch::deferred)
|
||||
__r = _VSTD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_VSTD::forward<_F>(__f)),
|
||||
__decay_copy(_VSTD::forward<_Args>(__args))...));
|
||||
__r = _STD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
return __r;
|
||||
}
|
||||
|
||||
@@ -2264,8 +2230,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
|
||||
async(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
return _VSTD::async(launch::any, _VSTD::forward<_F>(__f),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
return _STD::async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -2307,7 +2273,7 @@ public:
|
||||
const _R& get() const {return __state_->copy();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(shared_future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// functions to check state
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2381,7 +2347,7 @@ public:
|
||||
_R& get() const {return __state_->copy();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(shared_future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// functions to check state
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2455,7 +2421,7 @@ public:
|
||||
void get() const {__state_->copy();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
||||
void swap(shared_future& __rhs) {_STD::swap(__state_, __rhs.__state_);}
|
||||
|
||||
// functions to check state
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2488,7 +2454,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_future<_R>
|
||||
future<_R>::share()
|
||||
{
|
||||
return shared_future<_R>(_VSTD::move(*this));
|
||||
return shared_future<_R>(_STD::move(*this));
|
||||
}
|
||||
|
||||
template <class _R>
|
||||
@@ -2496,7 +2462,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_future<_R&>
|
||||
future<_R&>::share()
|
||||
{
|
||||
return shared_future<_R&>(_VSTD::move(*this));
|
||||
return shared_future<_R&>(_STD::move(*this));
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -2505,7 +2471,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_future<void>
|
||||
future<void>::share()
|
||||
{
|
||||
return shared_future<void>(_VSTD::move(*this));
|
||||
return shared_future<void>(_STD::move(*this));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@@ -51,8 +51,6 @@ template<class E> const E* end(initializer_list<E> il) noexcept;
|
||||
namespace std // purposefully not versioned
|
||||
{
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _E>
|
||||
class _LIBCPP_VISIBLE initializer_list
|
||||
{
|
||||
@@ -96,8 +94,6 @@ end(initializer_list<_E> __il) _NOEXCEPT
|
||||
return __il.end();
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
} // std
|
||||
|
||||
#endif // _LIBCPP_INITIALIZER_LIST
|
||||
|
@@ -266,8 +266,8 @@ public:
|
||||
enum seekdir {beg, cur, end};
|
||||
typedef seekdir seek_dir;
|
||||
|
||||
typedef _VSTD::streamoff streamoff;
|
||||
typedef _VSTD::streampos streampos;
|
||||
typedef _STD::streamoff streamoff;
|
||||
typedef _STD::streampos streampos;
|
||||
|
||||
class Init;
|
||||
|
||||
@@ -776,8 +776,8 @@ void
|
||||
basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs)
|
||||
{
|
||||
ios_base::swap(__rhs);
|
||||
_VSTD::swap(__tie_, __rhs.__tie_);
|
||||
_VSTD::swap(__fill_, __rhs.__fill_);
|
||||
_STD::swap(__tie_, __rhs.__tie_);
|
||||
_STD::swap(__fill_, __rhs.__fill_);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
|
376
include/istream
376
include/istream
@@ -177,13 +177,11 @@ public:
|
||||
virtual ~basic_istream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream(basic_istream&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.7.1.1.2 Assign/swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream& operator=(basic_istream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_istream& __rhs);
|
||||
@@ -323,7 +321,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
|
||||
{
|
||||
_VSTD::swap(__gc_, __rhs.__gc_);
|
||||
_STD::swap(__gc_, __rhs.__gc_);
|
||||
basic_ios<char_type, traits_type>::swap(__rhs);
|
||||
}
|
||||
|
||||
@@ -742,29 +740,26 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
|
||||
if (__sen)
|
||||
{
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
streamsize __n = __is.width();
|
||||
if (__n <= 0)
|
||||
if (__n == 0)
|
||||
__n = numeric_limits<streamsize>::max() / sizeof(_CharT) - 1;
|
||||
streamsize __c = 0;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (__c < __n-1)
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __c < __n-1; ++__i, ++__s, ++__c)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
_CharT __ch = *__i;
|
||||
if (__ct.is(__ct.space, __ch))
|
||||
break;
|
||||
*__s++ = __ch;
|
||||
++__c;
|
||||
__is.rdbuf()->sbumpc();
|
||||
*__s = __ch;
|
||||
}
|
||||
*__s = _CharT();
|
||||
__is.width(0);
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
@@ -806,11 +801,25 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
|
||||
if (__sen)
|
||||
{
|
||||
#if 1
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
else
|
||||
__c = _Traits::to_char_type(__i);
|
||||
#else
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
if (__i != __eof)
|
||||
{
|
||||
__c = *__i;
|
||||
if (++__i == __eof)
|
||||
__is.setstate(ios_base::eofbit);
|
||||
}
|
||||
else
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
#endif
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -850,42 +859,42 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
|
||||
sentry __s(*this, true);
|
||||
if (__s)
|
||||
{
|
||||
streamsize __c = 0;
|
||||
if (__sb)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
typedef ostreambuf_iterator<char_type, traits_type> _O;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
_O __o(__sb);
|
||||
for (; __i != __eof; ++__i, ++__o, ++__c)
|
||||
{
|
||||
*__o = *__i;
|
||||
if (__o.failed())
|
||||
break;
|
||||
}
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (true)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
if (traits_type::eq_int_type(
|
||||
__sb->sputc(traits_type::to_char_type(__i)),
|
||||
traits_type::eof()))
|
||||
break;
|
||||
++__gc_;
|
||||
this->rdbuf()->sbumpc();
|
||||
}
|
||||
if (__gc_ == 0)
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (__gc_ == 0)
|
||||
if (__c == 0)
|
||||
this->__set_failbit_and_consider_rethrow();
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -910,11 +919,22 @@ basic_istream<_CharT, _Traits>::get()
|
||||
sentry __s(*this, true);
|
||||
if (__s)
|
||||
{
|
||||
__r = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__r, traits_type::eof()))
|
||||
this->setstate(ios_base::failbit | ios_base::eofbit);
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i != __eof)
|
||||
{
|
||||
__r = traits_type::to_int_type(*__i);
|
||||
++__c;
|
||||
if (++__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
}
|
||||
else
|
||||
__gc_ = 1;
|
||||
__err |= ios_base::failbit | ios_base::eofbit;
|
||||
this->setstate(__err);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -949,31 +969,30 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
streamsize __c = 0;
|
||||
if (__n > 0)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (__gc_ < __n-1)
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __n > 1; ++__i, ++__s, ++__c)
|
||||
{
|
||||
int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
*__s++ = __ch;
|
||||
++__gc_;
|
||||
this->rdbuf()->sbumpc();
|
||||
*__s = __ch;
|
||||
}
|
||||
*__s = char_type();
|
||||
if (__gc_ == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1006,36 +1025,38 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
streamsize __c = 0;
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
while (true)
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
typedef ostreambuf_iterator<char_type, traits_type> _O;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
_O __o(&__sb);
|
||||
for (; __i != __eof; ++__i, ++__o, ++__c)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof()))
|
||||
*__o = __ch;
|
||||
if (__o.failed())
|
||||
break;
|
||||
++__gc_;
|
||||
this->rdbuf()->sbumpc();
|
||||
}
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
if (__gc_ == 0)
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1067,36 +1088,33 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (true)
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
for (; __i != __eof; ++__s, --__n)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
if (__n < 2)
|
||||
{
|
||||
this->rdbuf()->sbumpc();
|
||||
++__gc_;
|
||||
this->setstate(ios_base::failbit);
|
||||
break;
|
||||
}
|
||||
if (__gc_ >= __n-1)
|
||||
{
|
||||
__err |= ios_base::failbit;
|
||||
break;
|
||||
*__s = __ch;
|
||||
}
|
||||
*__s++ = __ch;
|
||||
this->rdbuf()->sbumpc();
|
||||
++__gc_;
|
||||
}
|
||||
if (__n > 0)
|
||||
if (__n)
|
||||
*__s = char_type();
|
||||
if (__gc_ == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1128,40 +1146,35 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__n == numeric_limits<streamsize>::max())
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
if (__n != numeric_limits<streamsize>::max())
|
||||
{
|
||||
while (true)
|
||||
for (; __n > 0 && __i != __eof; --__n)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
++__gc_;
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (__gc_ < __n)
|
||||
while (__i != __eof)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
++__gc_;
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
}
|
||||
}
|
||||
this->setstate(__err);
|
||||
if (__i == __eof)
|
||||
this->setstate(ios_base::eofbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1208,17 +1221,20 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
for (; __gc_ < __n; ++__gc_)
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __n > 0; ++__i, ++__s, ++__c, --__n)
|
||||
*__s = *__i;
|
||||
if (__i == __eof)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
this->setstate(ios_base::failbit | ios_base::eofbit);
|
||||
break;
|
||||
}
|
||||
*__s++ = traits_type::to_char_type(__i);
|
||||
ios_base::iostate __err = ios_base::eofbit;
|
||||
if (__n > 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
}
|
||||
__gc_ = __c;
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
@@ -1236,19 +1252,45 @@ template<class _CharT, class _Traits>
|
||||
streamsize
|
||||
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
|
||||
{
|
||||
streamsize __c = this->rdbuf()->in_avail();
|
||||
__gc_ = 0;
|
||||
streamsize __c = 0;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
__c = this->rdbuf()->in_avail();
|
||||
switch (__c)
|
||||
{
|
||||
case -1:
|
||||
this->setstate(ios_base::eofbit);
|
||||
__i = __eof;
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
read(__s, _VSTD::min(__c, __n));
|
||||
break;
|
||||
__c = _STD::min(__c, __n);
|
||||
for (streamsize __k = 0; __k < __c; ++__k, ++__s, ++__i)
|
||||
*__s = *__i;
|
||||
}
|
||||
return __gc_;
|
||||
if (__i == __eof)
|
||||
this->setstate(ios_base::eofbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
this->__set_badbit_and_consider_rethrow();
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
return __c;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
@@ -1411,19 +1453,15 @@ ws(basic_istream<_CharT, _Traits>& __is)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
|
||||
if (__sen)
|
||||
{
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
while (true)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__is.setstate(ios_base::eofbit);
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof; ++__i)
|
||||
if (!__ct.is(__ct.space, *__i))
|
||||
break;
|
||||
}
|
||||
if (!__ct.is(__ct.space, _Traits::to_char_type(__i)))
|
||||
break;
|
||||
__is.rdbuf()->sbumpc();
|
||||
}
|
||||
if (__i == __eof)
|
||||
__is.setstate(ios_base::failbit | ios_base::eofbit);
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1466,13 +1504,11 @@ public:
|
||||
virtual ~basic_iostream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_iostream(basic_iostream&& __rhs);
|
||||
#endif
|
||||
|
||||
// assign/swap
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_iostream& operator=(basic_iostream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_iostream& __rhs);
|
||||
@@ -1491,7 +1527,7 @@ basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, trait
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
|
||||
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
|
||||
: basic_istream<_CharT, _Traits>(_STD::move(__rhs))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1532,30 +1568,27 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
||||
if (__sen)
|
||||
{
|
||||
__str.clear();
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
streamsize __n = __is.width();
|
||||
if (__n <= 0)
|
||||
if (__n == 0)
|
||||
__n = __str.max_size();
|
||||
if (__n <= 0)
|
||||
if (__n < 0)
|
||||
__n = numeric_limits<streamsize>::max();
|
||||
streamsize __c = 0;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (__c < __n)
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __c < __n; ++__i, ++__c)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
_CharT __ch = *__i;
|
||||
if (__ct.is(__ct.space, __ch))
|
||||
break;
|
||||
__str.push_back(__ch);
|
||||
++__c;
|
||||
__is.rdbuf()->sbumpc();
|
||||
}
|
||||
__is.width(0);
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
@@ -1585,28 +1618,31 @@ getline(basic_istream<_CharT, _Traits>& __is,
|
||||
if (__sen)
|
||||
{
|
||||
__str.clear();
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
streamsize __extr = 0;
|
||||
while (true)
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
streamsize __n = __str.max_size();
|
||||
if (__n < 0)
|
||||
__n = numeric_limits<streamsize>::max();
|
||||
for (; __i != __eof;)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
++__extr;
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
_CharT __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (_Traits::eq(__ch, __dlm))
|
||||
break;
|
||||
__str.push_back(__ch);
|
||||
if (__str.size() == __str.max_size())
|
||||
if (__c == __n)
|
||||
{
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(ios_base::failbit);
|
||||
break;
|
||||
}
|
||||
__str.push_back(__ch);
|
||||
}
|
||||
if (__extr == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
}
|
||||
@@ -1664,26 +1700,24 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
|
||||
{
|
||||
basic_string<_CharT, _Traits> __str;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
streamsize __c = 0;
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
_CharT __zero = __ct.widen('0');
|
||||
_CharT __one = __ct.widen('1');
|
||||
while (__c < _Size)
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __c < _Size; ++__i, ++__c)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
if (!_Traits::eq(__ch, __zero) && !_Traits::eq(__ch, __one))
|
||||
_CharT __ch = *__i;
|
||||
if (__ch != __zero && __ch != __one)
|
||||
break;
|
||||
__str.push_back(__ch);
|
||||
++__c;
|
||||
__is.rdbuf()->sbumpc();
|
||||
}
|
||||
__is.width(0);
|
||||
__x = bitset<_Size>(__str);
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
|
138
include/iterator
138
include/iterator
@@ -488,7 +488,7 @@ next(_ForwardIter __x,
|
||||
typename iterator_traits<_ForwardIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type* = 0)
|
||||
{
|
||||
_VSTD::advance(__x, __n);
|
||||
_STD::advance(__x, __n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ prev(_BidiretionalIter __x,
|
||||
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)
|
||||
{
|
||||
_VSTD::advance(__x, -__n);
|
||||
_STD::advance(__x, -__n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ public:
|
||||
{container->push_back(__value); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{container->push_back(_VSTD::move(__value)); return *this;}
|
||||
{container->push_back(_STD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;}
|
||||
@@ -661,7 +661,7 @@ public:
|
||||
{container->push_front(__value); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{container->push_front(_VSTD::move(__value)); return *this;}
|
||||
{container->push_front(_STD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;}
|
||||
@@ -696,7 +696,7 @@ public:
|
||||
{iter = container->insert(iter, __value); ++iter; return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{iter = container->insert(iter, _VSTD::move(__value)); ++iter; return *this;}
|
||||
{iter = container->insert(iter, _STD::move(__value)); ++iter; return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;}
|
||||
@@ -1035,7 +1035,7 @@ operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter>
|
||||
__wrap_iter<_Iter>
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type, const __wrap_iter<_Iter>&) _NOEXCEPT;
|
||||
|
||||
template <class _I, class _O> _O copy(_I, _I, _O);
|
||||
template <class _B1, class _B2> _B2 copy_backward(_B1, _B1, _B2);
|
||||
@@ -1063,108 +1063,33 @@ public:
|
||||
private:
|
||||
iterator_type __i;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
__get_db()->__insert_i(this);
|
||||
#endif
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT {}
|
||||
template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,
|
||||
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
|
||||
: __i(__u.base())
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
__get_db()->__iterator_copy(this, &__u);
|
||||
#endif
|
||||
}
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter(const __wrap_iter& __x)
|
||||
: __i(__x.base())
|
||||
{
|
||||
__get_db()->__iterator_copy(this, &__x);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter& operator=(const __wrap_iter& __x)
|
||||
{
|
||||
if (this != &__x)
|
||||
{
|
||||
__get_db()->__iterator_copy(this, &__x);
|
||||
__i = __x.__i;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~__wrap_iter()
|
||||
{
|
||||
__get_db()->__erase_i(this);
|
||||
}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to dereference a non-dereferenceable iterator");
|
||||
#endif
|
||||
return *__i;
|
||||
}
|
||||
: __i(__u.base()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT {return *__i;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT {return &(operator*());}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to increment non-incrementable iterator");
|
||||
#endif
|
||||
++__i;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT {++__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT
|
||||
{__wrap_iter __tmp(*this); ++(*this); return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
||||
"Attempted to decrement non-decrementable iterator");
|
||||
#endif
|
||||
--__i;
|
||||
return *this;
|
||||
}
|
||||
{__wrap_iter __tmp(*this); ++__i; return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT {--__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT
|
||||
{__wrap_iter __tmp(*this); --(*this); return __tmp;}
|
||||
{__wrap_iter __tmp(*this); --__i; return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
|
||||
{__wrap_iter __w(*this); __w += __n; return __w;}
|
||||
{return __wrap_iter(__i + __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
|
||||
"Attempted to add/subtract iterator outside of valid range");
|
||||
#endif
|
||||
__i += __n;
|
||||
return *this;
|
||||
}
|
||||
{__i += __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT
|
||||
{return *this + (-__n);}
|
||||
{return __wrap_iter(__i - __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
|
||||
{*this += -__n; return *this;}
|
||||
{__i -= __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
|
||||
"Attempted to subscript iterator outside of valid range");
|
||||
#endif
|
||||
return __i[__n];
|
||||
}
|
||||
{return __i[__n];}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT {return __i;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
|
||||
{
|
||||
__get_db()->__insert_ic(this, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _Up> friend class __wrap_iter;
|
||||
template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
|
||||
@@ -1208,7 +1133,7 @@ private:
|
||||
template <class _Iter1>
|
||||
friend
|
||||
__wrap_iter<_Iter1>
|
||||
operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT;
|
||||
operator+(typename __wrap_iter<_Iter1>::difference_type, const __wrap_iter<_Iter1>&) _NOEXCEPT;
|
||||
|
||||
template <class _I, class _O> friend _O copy(_I, _I, _O);
|
||||
template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2);
|
||||
@@ -1230,10 +1155,6 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
||||
"Attempted to compare incomparable iterators");
|
||||
#endif
|
||||
return __x.base() == __y.base();
|
||||
}
|
||||
|
||||
@@ -1242,10 +1163,6 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
||||
"Attempted to compare incomparable iterators");
|
||||
#endif
|
||||
return __x.base() < __y.base();
|
||||
}
|
||||
|
||||
@@ -1254,7 +1171,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return !(__x == __y);
|
||||
return __x.base() != __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
@@ -1262,7 +1179,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __y < __x;
|
||||
return __x.base() > __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
@@ -1270,7 +1187,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return !(__x < __y);
|
||||
return __x.base() >= __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
@@ -1278,7 +1195,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return !(__y < __x);
|
||||
return __x.base() <= __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
@@ -1286,10 +1203,6 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
||||
"Attempted to subtract incompatible iterators");
|
||||
#endif
|
||||
return __x.base() - __y.base();
|
||||
}
|
||||
|
||||
@@ -1297,10 +1210,9 @@ template <class _Iter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter<_Iter>
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type __n,
|
||||
__wrap_iter<_Iter> __x) _NOEXCEPT
|
||||
const __wrap_iter<_Iter>& __x) _NOEXCEPT
|
||||
{
|
||||
__x += __n;
|
||||
return __x;
|
||||
return __wrap_iter<_Iter>(__x.base() + __n);
|
||||
}
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
|
783
include/list
783
include/list
File diff suppressed because it is too large
Load Diff
414
include/locale
414
include/locale
@@ -186,221 +186,155 @@ template <class charT> class messages_byname;
|
||||
#endif
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
#if _WIN32
|
||||
#include <support/win32/locale_win32.h>
|
||||
#else // _WIN32
|
||||
#include <nl_types.h>
|
||||
#endif // !_WIN32
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if __APPLE__ || __FreeBSD__
|
||||
# define _LIBCPP_GET_C_LOCALE 0
|
||||
#else
|
||||
# define _LIBCPP_GET_C_LOCALE __cloc()
|
||||
// Get the C locale object
|
||||
locale_t __cloc();
|
||||
#define __cloc_defined
|
||||
#endif
|
||||
|
||||
typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
|
||||
typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_unique_ptr;
|
||||
typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
|
||||
|
||||
// OSX has nice foo_l() functions that let you turn off use of the global
|
||||
// locale. Linux, not so much. The following functions avoid the locale when
|
||||
// that's possible and otherwise do the wrong thing. FIXME.
|
||||
#ifdef __linux__
|
||||
#if __APPLE__
|
||||
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__mb_cur_max_l(locale_t __l)
|
||||
int
|
||||
__nolocale_sprintf(char* __restrict __str,
|
||||
const char* __restrict __format, _Tp __v)
|
||||
{
|
||||
return MB_CUR_MAX_L(__l);
|
||||
return sprintf_l(__str, 0, __format, __v);
|
||||
}
|
||||
#else // _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
decltype(MB_CUR_MAX) __mb_cur_max_l(locale_t __l)
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, _Tp __v)
|
||||
{
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return MB_CUR_MAX;
|
||||
return snprintf_l(__str, __size, 0, __format, __v);
|
||||
}
|
||||
#endif // _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
wint_t __btowc_l(int __c, locale_t __l)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, int __prec, _Tp __v)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return btowc_l(__c, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return btowc(__c);
|
||||
#endif
|
||||
return snprintf_l(__str, __size, 0, __format, __prec, __v);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
int __wctob_l(wint_t __c, locale_t __l)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_asprintf(char** __ret, const char* __restrict __format, _Tp __v)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return wctob_l(__c, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return wctob(__c);
|
||||
#endif
|
||||
return asprintf_l(__ret, 0, __format, __v);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
size_t __wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
|
||||
size_t __len, mbstate_t *__ps, locale_t __l)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_asprintf(char** __ret, const char* __restrict __format, int __prec,
|
||||
_Tp __v)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return wcsnrtombs_l(__dest, __src, __nwc, __len, __ps, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
|
||||
#endif
|
||||
return asprintf_l(__ret, 0, __format, __prec, __v);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
size_t __wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_sscanf(const char* __restrict __str,
|
||||
const char* __restrict __format, _Tp* __v)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return wcrtomb_l(__s, __wc, __ps, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return wcrtomb(__s, __wc, __ps);
|
||||
#endif
|
||||
return sscanf_l(__str, 0, __format, __v);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
size_t __mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
|
||||
size_t __len, mbstate_t *__ps, locale_t __l)
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_isxdigit(int __c)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return mbsnrtowcs_l(__dest, __src, __nms, __len, __ps, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
|
||||
#endif
|
||||
return isxdigit_l(__c, 0);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
size_t __mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
|
||||
mbstate_t *__ps, locale_t __l)
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_isdigit(int __c)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return mbrtowc_l(__pwc, __s, __n, __ps, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return mbrtowc(__pwc, __s, __n, __ps);
|
||||
#endif
|
||||
return isdigit_l(__c, 0);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
int __mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
|
||||
#else // __APPLE__
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
int
|
||||
__nolocale_sprintf(char* __restrict __str,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return mbtowc_l(__pwc, __pmb, __max, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return mbtowc(__pwc, __pmb, __max);
|
||||
#endif
|
||||
va_list __ap;
|
||||
va_start(__ap, __format);
|
||||
int __result = vsprintf(__str, __format, __ap);
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
size_t __mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return mbrlen_l(__s, __n, __ps, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return mbrlen(__s, __n, __ps);
|
||||
#endif
|
||||
va_list __ap;
|
||||
va_start(__ap, __format);
|
||||
int __result = vsnprintf(__str, __size, __format, __ap);
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
lconv *__localeconv_l(locale_t __l)
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
int
|
||||
__nolocale_asprintf(char** __ret,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return localeconv_l(__l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return localeconv();
|
||||
#endif
|
||||
va_list __ap;
|
||||
va_start(__ap, __format);
|
||||
int __result = vasprintf(__ret, __format, __ap);
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
size_t __mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
|
||||
mbstate_t *__ps, locale_t __l)
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
int
|
||||
__nolocale_sscanf(const char* __restrict __str,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
return mbsrtowcs_l(__dest, __src, __len, __ps, __l);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
return mbsrtowcs(__dest, __src, __len, __ps);
|
||||
#endif
|
||||
va_list __ap;
|
||||
va_start(__ap, __format);
|
||||
int __result = vsscanf(__str, __format, __ap);
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_isxdigit(int __c)
|
||||
{
|
||||
return isxdigit(__c);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
|
||||
va_list __va;
|
||||
va_start(__va, __format);
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __res = vsprintf_l(__s, __l, __format, __va);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
int __res = vsprintf(__s, __format, __va);
|
||||
#endif
|
||||
va_end(__va);
|
||||
return __res;
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_isdigit(int __c)
|
||||
{
|
||||
return isdigit(__c);
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
|
||||
va_list __va;
|
||||
va_start(__va, __format);
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __res = vsnprintf_l(__s, __n, __l, __format, __va);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
int __res = vsnprintf(__s, __n, __format, __va);
|
||||
#endif
|
||||
va_end(__va);
|
||||
return __res;
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
|
||||
va_list __va;
|
||||
va_start(__va, __format);
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __res = vasprintf_l(__s, __l, __format, __va);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
int __res = vasprintf(__s, __format, __va);
|
||||
#endif
|
||||
va_end(__va);
|
||||
return __res;
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
|
||||
va_list __va;
|
||||
va_start(__va, __format);
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __res = vsscanf_l(__s, __l, __format, __va);
|
||||
#else
|
||||
__locale_raii __current(uselocale(__l), uselocale);
|
||||
int __res = vsscanf(__s, __format, __va);
|
||||
#endif
|
||||
va_end(__va);
|
||||
return __res;
|
||||
}
|
||||
|
||||
#endif // __linux__
|
||||
#endif // __APPLE__
|
||||
|
||||
// __scan_keyword
|
||||
// Scans [__b, __e) until a match is found in the basic_strings range
|
||||
@@ -429,7 +363,7 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,
|
||||
bool __case_sensitive = true)
|
||||
{
|
||||
typedef typename iterator_traits<_InputIterator>::value_type _CharT;
|
||||
size_t __nkw = _VSTD::distance(__kb, __ke);
|
||||
size_t __nkw = _STD::distance(__kb, __ke);
|
||||
const unsigned char __doesnt_match = '\0';
|
||||
const unsigned char __might_match = '\1';
|
||||
const unsigned char __does_match = '\2';
|
||||
@@ -814,7 +748,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
|
||||
int __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
||||
long long __ll = strtoll_l(__a, &__p2, __base, 0);
|
||||
int __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
@@ -854,7 +788,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
|
||||
int __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
||||
unsigned long long __ll = strtoull_l(__a, &__p2, __base, 0);
|
||||
int __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
@@ -882,7 +816,7 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
|
||||
if (__a != __a_end)
|
||||
{
|
||||
char *__p2;
|
||||
long double __ld = strtold_l(__a, &__p2, _LIBCPP_GET_C_LOCALE);
|
||||
long double __ld = strtold_l(__a, &__p2, 0);
|
||||
if (__p2 != __a_end)
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
@@ -1287,11 +1221,7 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
||||
break;
|
||||
// Stage 3
|
||||
__a[sizeof(__a)-1] = 0;
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
if (sscanf_l(__a, _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1)
|
||||
#else
|
||||
if (__sscanf_l(__a, __cloc(), "%p", &__v) != 1)
|
||||
#endif
|
||||
if (__nolocale_sscanf(__a, "%p", &__v) != 1)
|
||||
__err = ios_base::failbit;
|
||||
// EOF checked
|
||||
if (__b == __e)
|
||||
@@ -1396,13 +1326,13 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
|
||||
*__oe++ = __ct.widen(*__nf++);
|
||||
*__oe++ = __ct.widen(*__nf++);
|
||||
for (__ns = __nf; __ns < __ne; ++__ns)
|
||||
if (!isxdigit_l(*__ns, _LIBCPP_GET_C_LOCALE))
|
||||
if (!__nolocale_isxdigit(*__ns))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (__ns = __nf; __ns < __ne; ++__ns)
|
||||
if (!isdigit_l(*__ns, _LIBCPP_GET_C_LOCALE))
|
||||
if (!__nolocale_isdigit(*__ns))
|
||||
break;
|
||||
}
|
||||
if (__grouping.empty())
|
||||
@@ -1600,11 +1530,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
+ ((numeric_limits<long>::digits % 3) != 0)
|
||||
+ 1;
|
||||
char __nar[__nbuf];
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __nc = sprintf_l(__nar, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
int __nc = __sprintf_l(__nar, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
int __nc = __nolocale_sprintf(__nar, __fmt, __v);
|
||||
char* __ne = __nar + __nc;
|
||||
char* __np = this->__identify_padding(__nar, __ne, __iob);
|
||||
// Stage 2 - Widen __nar while adding thousands separators
|
||||
@@ -1630,11 +1556,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
+ ((numeric_limits<long long>::digits % 3) != 0)
|
||||
+ 1;
|
||||
char __nar[__nbuf];
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __nc = sprintf_l(__nar, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
int __nc = __sprintf_l(__nar, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
int __nc = __nolocale_sprintf(__nar, __fmt, __v);
|
||||
char* __ne = __nar + __nc;
|
||||
char* __np = this->__identify_padding(__nar, __ne, __iob);
|
||||
// Stage 2 - Widen __nar while adding thousands separators
|
||||
@@ -1660,11 +1582,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
+ ((numeric_limits<unsigned long>::digits % 3) != 0)
|
||||
+ 1;
|
||||
char __nar[__nbuf];
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __nc = sprintf_l(__nar, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
int __nc = __sprintf_l(__nar, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
int __nc = __nolocale_sprintf(__nar, __fmt, __v);
|
||||
char* __ne = __nar + __nc;
|
||||
char* __np = this->__identify_padding(__nar, __ne, __iob);
|
||||
// Stage 2 - Widen __nar while adding thousands separators
|
||||
@@ -1690,11 +1608,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
+ ((numeric_limits<unsigned long long>::digits % 3) != 0)
|
||||
+ 1;
|
||||
char __nar[__nbuf];
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __nc = sprintf_l(__nar, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
int __nc = __sprintf_l(__nar, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
int __nc = __nolocale_sprintf(__nar, __fmt, __v);
|
||||
char* __ne = __nar + __nc;
|
||||
char* __np = this->__identify_padding(__nar, __ne, __iob);
|
||||
// Stage 2 - Widen __nar while adding thousands separators
|
||||
@@ -1721,35 +1635,18 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
char* __nb = __nar;
|
||||
int __nc;
|
||||
if (__specify_precision)
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
|
||||
__nc = __nolocale_snprintf(__nb, __nbuf, __fmt,
|
||||
(int)__iob.precision(), __v);
|
||||
#else
|
||||
__nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt,
|
||||
(int)__iob.precision(), __v);
|
||||
#endif
|
||||
else
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
__nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
__nc = __nolocale_snprintf(__nb, __nbuf, __fmt, __v);
|
||||
unique_ptr<char, void(*)(void*)> __nbh(0, free);
|
||||
if (__nc > static_cast<int>(__nbuf-1))
|
||||
{
|
||||
if (__specify_precision)
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
|
||||
#else
|
||||
__nc = __asprintf_l(&__nb, __cloc(), __fmt,
|
||||
(int)__iob.precision(), __v);
|
||||
#endif
|
||||
__nc = __nolocale_asprintf(&__nb, __fmt, (int)__iob.precision(),
|
||||
__v);
|
||||
else
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
__nc = __asprintf_l(&__nb, __cloc(), __fmt, (int)__iob.precision(), __v);
|
||||
#endif
|
||||
__nc = __nolocale_asprintf(&__nb, __fmt, __v);
|
||||
if (__nb == 0)
|
||||
__throw_bad_alloc();
|
||||
__nbh.reset(__nb);
|
||||
@@ -1790,35 +1687,18 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
char* __nb = __nar;
|
||||
int __nc;
|
||||
if (__specify_precision)
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
|
||||
__nc = __nolocale_snprintf(__nb, __nbuf, __fmt,
|
||||
(int)__iob.precision(), __v);
|
||||
#else
|
||||
__nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt,
|
||||
(int)__iob.precision(), __v);
|
||||
#endif
|
||||
else
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
__nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
__nc = __nolocale_snprintf(__nb, __nbuf, __fmt, __v);
|
||||
unique_ptr<char, void(*)(void*)> __nbh(0, free);
|
||||
if (__nc > static_cast<int>(__nbuf-1))
|
||||
{
|
||||
if (__specify_precision)
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
|
||||
#else
|
||||
__nc = __asprintf_l(&__nb, __cloc(), __fmt,
|
||||
(int)__iob.precision(), __v);
|
||||
#endif
|
||||
__nc = __nolocale_asprintf(&__nb, __fmt, (int)__iob.precision(),
|
||||
__v);
|
||||
else
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
__nc = __asprintf_l(&__nb, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
__nc = __nolocale_asprintf(&__nb, __fmt, __v);
|
||||
if (__nb == 0)
|
||||
__throw_bad_alloc();
|
||||
__nbh.reset(__nb);
|
||||
@@ -1854,11 +1734,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
char __fmt[6] = "%p";
|
||||
const unsigned __nbuf = 20;
|
||||
char __nar[__nbuf];
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
int __nc = sprintf_l(__nar, _LIBCPP_GET_C_LOCALE, __fmt, __v);
|
||||
#else
|
||||
int __nc = __sprintf_l(__nar, __cloc(), __fmt, __v);
|
||||
#endif
|
||||
int __nc = __nolocale_sprintf(__nar, __fmt, __v);
|
||||
char* __ne = __nar + __nc;
|
||||
char* __np = this->__identify_padding(__nar, __ne, __iob);
|
||||
// Stage 2 - Widen __nar
|
||||
@@ -2635,7 +2511,7 @@ class __time_put
|
||||
{
|
||||
locale_t __loc_;
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {}
|
||||
_LIBCPP_ALWAYS_INLINE __time_put() : __loc_(0) {}
|
||||
__time_put(const char* __nm);
|
||||
__time_put(const string& __nm);
|
||||
~__time_put();
|
||||
@@ -2738,7 +2614,7 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
char_type* __nb = __nar;
|
||||
char_type* __ne = __nb + 100;
|
||||
__do_put(__nb, __ne, __tm, __fmt, __mod);
|
||||
return _VSTD::copy(__nb, __ne, __s);
|
||||
return _STD::copy(__nb, __ne, __s);
|
||||
}
|
||||
|
||||
extern template class time_put<char>;
|
||||
@@ -3406,7 +3282,7 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
|
||||
break;
|
||||
case money_base::symbol:
|
||||
if (!__sym.empty() && (__flags & ios_base::showbase))
|
||||
__me = _VSTD::copy(__sym.begin(), __sym.end(), __me);
|
||||
__me = _STD::copy(__sym.begin(), __sym.end(), __me);
|
||||
break;
|
||||
case money_base::value:
|
||||
{
|
||||
@@ -3465,7 +3341,7 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
|
||||
}
|
||||
// print rest of sign, if any
|
||||
if (__sn.size() > 1)
|
||||
__me = _VSTD::copy(__sn.begin()+1, __sn.end(), __me);
|
||||
__me = _STD::copy(__sn.begin()+1, __sn.end(), __me);
|
||||
// set alignment
|
||||
if ((__flags & ios_base::adjustfield) == ios_base::left)
|
||||
__mi = __me;
|
||||
@@ -3538,11 +3414,7 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
|
||||
// secure memory for digit storage
|
||||
if (__n > __bs-1)
|
||||
{
|
||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||
__n = asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units);
|
||||
#else
|
||||
__n = __asprintf_l(&__bb, __cloc(), "%.0Lf", __units);
|
||||
#endif
|
||||
__n = __nolocale_asprintf(&__bb, "%.0Lf", __units);
|
||||
if (__bb == 0)
|
||||
__throw_bad_alloc();
|
||||
__hn.reset(__bb);
|
||||
@@ -3693,14 +3565,10 @@ template <class _CharT>
|
||||
typename messages<_CharT>::catalog
|
||||
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
|
||||
{
|
||||
#if _WIN32
|
||||
return -1;
|
||||
#else // _WIN32
|
||||
catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
|
||||
catalog __cat = reinterpret_cast<catalog>(catopen(__nm.c_str(), NL_CAT_LOCALE));
|
||||
if (__cat != -1)
|
||||
__cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1));
|
||||
return __cat;
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
template <class _CharT>
|
||||
@@ -3708,34 +3576,28 @@ typename messages<_CharT>::string_type
|
||||
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
|
||||
const string_type& __dflt) const
|
||||
{
|
||||
#if _WIN32
|
||||
return __dflt;
|
||||
#else // _WIN32
|
||||
string __ndflt;
|
||||
__narrow_to_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__ndflt),
|
||||
__dflt.c_str(),
|
||||
__dflt.c_str() + __dflt.size());
|
||||
if (__c != -1)
|
||||
__c <<= 1;
|
||||
nl_catd __cat = (nl_catd)__c;
|
||||
nl_catd __cat = reinterpret_cast<nl_catd>(__c);
|
||||
char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
|
||||
string_type __w;
|
||||
__widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
|
||||
__n, __n + strlen(__n));
|
||||
return __w;
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
template <class _CharT>
|
||||
void
|
||||
messages<_CharT>::do_close(catalog __c) const
|
||||
{
|
||||
#if !_WIN32
|
||||
if (__c != -1)
|
||||
__c <<= 1;
|
||||
nl_catd __cat = (nl_catd)__c;
|
||||
nl_catd __cat = reinterpret_cast<nl_catd>(__c);
|
||||
catclose(__cat);
|
||||
#endif // !_WIN32
|
||||
}
|
||||
|
||||
extern template class messages<char>;
|
||||
@@ -3854,8 +3716,8 @@ template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
|
||||
inline _LIBCPP_ALWAYS_INLINE
|
||||
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
wstring_convert(wstring_convert&& __wc)
|
||||
: __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
|
||||
__wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
|
||||
: __byte_err_string_(_STD::move(__wc.__byte_err_string_)),
|
||||
__wide_err_string_(_STD::move(__wc.__wide_err_string_)),
|
||||
__cvtptr_(__wc.__cvtptr_),
|
||||
__cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtstate_)
|
||||
{
|
||||
@@ -4148,7 +4010,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
|
||||
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
||||
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
||||
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
||||
streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
|
||||
streamsize __nmemb = _STD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
|
||||
static_cast<streamsize>(__extbufend_ - __extbufnext_));
|
||||
codecvt_base::result __r;
|
||||
state_type __svs = __st_;
|
||||
|
213
include/map
213
include/map
@@ -516,19 +516,17 @@ public:
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__second_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
|
||||
if (__first_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
|
||||
if (__p)
|
||||
__alloc_traits::deallocate(__na_, __p, 1);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
class map;
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
class multimap;
|
||||
template <class _TreeIterator> class __map_const_iterator;
|
||||
template <class, class, class, class> class map;
|
||||
template <class, class, class, class> class multimap;
|
||||
template <class> class __map_const_iterator;
|
||||
|
||||
template <class _TreeIterator>
|
||||
class _LIBCPP_VISIBLE __map_iterator
|
||||
@@ -715,8 +713,8 @@ public:
|
||||
typedef typename __alloc_traits::difference_type difference_type;
|
||||
typedef __map_iterator<typename __base::iterator> iterator;
|
||||
typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit map(const key_compare& __comp = key_compare())
|
||||
@@ -755,36 +753,17 @@ public:
|
||||
insert(__m.begin(), __m.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map& operator=(const map& __m)
|
||||
{
|
||||
__tree_ = __m.__tree_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map(map&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_VSTD::move(__m.__tree_))
|
||||
: __tree_(_STD::move(__m.__tree_))
|
||||
{
|
||||
}
|
||||
|
||||
map(map&& __m, const allocator_type& __a);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map& operator=(map&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _VSTD::move(__m.__tree_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
|
||||
: __tree_(__vc(__comp))
|
||||
@@ -799,6 +778,14 @@ public:
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map& operator=(map&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _STD::move(__m.__tree_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map& operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
@@ -806,7 +793,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit map(const allocator_type& __a)
|
||||
@@ -880,16 +867,16 @@ public:
|
||||
emplace() {return __tree_.__emplace_unique();}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool>
|
||||
emplace(_A0&& __a0)
|
||||
{return __tree_.__emplace_unique(_VSTD::forward<_A0>(__a0));}
|
||||
{return __tree_.__emplace_unique(_STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class ..._Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
pair<iterator, bool>
|
||||
emplace(_A0&& __a0, _Args&& ...__args);
|
||||
|
||||
@@ -901,32 +888,32 @@ public:
|
||||
{return __tree_.__emplace_hint_unique(__p.__i_);}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator
|
||||
emplace_hint(const_iterator __p, _A0&& __a0)
|
||||
{return __tree_.__emplace_hint_unique(__p.__i_, _VSTD::forward<_A0>(__a0));}
|
||||
{return __tree_.__emplace_hint_unique(__p.__i_, _STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class ..._Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator
|
||||
emplace_hint(const_iterator __p, _A0&& __a0, _Args&& ...__args);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(_P&& __p)
|
||||
{return __tree_.__insert_unique(_VSTD::forward<_P>(__p));}
|
||||
{return __tree_.__insert_unique(_STD::forward<_P>(__p));}
|
||||
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __pos, _P&& __p)
|
||||
{return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_P>(__p));}
|
||||
{return __tree_.__insert_unique(__pos.__i_, _STD::forward<_P>(__p));}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -947,14 +934,10 @@ public:
|
||||
insert(__e.__i_, *__f);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1010,11 +993,11 @@ private:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__node_holder __construct_node();
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _A0, class ..._Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0, _Args&& ...__args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1112,7 +1095,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__find_equal_key(const_iterator __hint,
|
||||
else if (__tree_.value_comp().key_comp()(__hint->first, __k)) // check after
|
||||
{
|
||||
// *__hint < __k
|
||||
const_iterator __next = _VSTD::next(__hint);
|
||||
const_iterator __next = _STD::next(__hint);
|
||||
if (__next == end() || __tree_.value_comp().key_comp()(__k, __next->first))
|
||||
{
|
||||
// *__hint < __k < *next(__hint)
|
||||
@@ -1184,14 +1167,14 @@ map<_Key, _Tp, _Compare, _Allocator>::__find_equal_key(__node_base_const_pointer
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
|
||||
: __tree_(_VSTD::move(__m.__tree_), __a)
|
||||
: __tree_(_STD::move(__m.__tree_), __a)
|
||||
{
|
||||
if (__a != __m.get_allocator())
|
||||
{
|
||||
const_iterator __e = cend();
|
||||
while (!__m.empty())
|
||||
__tree_.__insert_unique(__e.__i_,
|
||||
_VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
|
||||
_STD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1201,9 +1184,9 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node()
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second));
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
@@ -1216,7 +1199,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
@@ -1232,9 +1215,9 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
@@ -1249,11 +1232,11 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node(const key_type& __k)
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second));
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1285,7 +1268,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
|
||||
__node_pointer __r = static_cast<__node_pointer>(__child);
|
||||
if (__child == nullptr)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::move(__k));
|
||||
__node_holder __h = __construct_node(_STD::move(__k));
|
||||
__tree_.__insert_node_at(__parent, __child, __h.get());
|
||||
__r = __h.release();
|
||||
}
|
||||
@@ -1324,13 +1307,13 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
template <class _A0, class ..._Args,
|
||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
||||
class //= typename enable_if<is_convertible<_A0, _Key>::value>::type
|
||||
>
|
||||
pair<typename map<_Key, _Tp, _Compare, _Allocator>::iterator, bool>
|
||||
map<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
pair<iterator, bool> __r = __tree_.__node_insert_unique(__h.get());
|
||||
if (__r.second)
|
||||
__h.release();
|
||||
@@ -1339,14 +1322,14 @@ map<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
template <class _A0, class ..._Args,
|
||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
||||
class //= typename enable_if<is_convertible<_A0, _Key>::value>::type
|
||||
>
|
||||
typename map<_Key, _Tp, _Compare, _Allocator>::iterator
|
||||
map<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
|
||||
_A0&& __a0, _Args&& ...__args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __tree_.__node_insert_unique(__p.__i_, __h.get());
|
||||
if (__r.__i_.__ptr_ == __h.get())
|
||||
__h.release();
|
||||
@@ -1361,7 +1344,7 @@ bool
|
||||
operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x,
|
||||
const map<_Key, _Tp, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1370,7 +1353,7 @@ bool
|
||||
operator< (const map<_Key, _Tp, _Compare, _Allocator>& __x,
|
||||
const map<_Key, _Tp, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1471,8 +1454,8 @@ public:
|
||||
typedef typename __alloc_traits::difference_type difference_type;
|
||||
typedef __map_iterator<typename __base::iterator> iterator;
|
||||
typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multimap(const key_compare& __comp = key_compare())
|
||||
@@ -1512,36 +1495,17 @@ public:
|
||||
insert(__m.begin(), __m.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap& operator=(const multimap& __m)
|
||||
{
|
||||
__tree_ = __m.__tree_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap(multimap&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_VSTD::move(__m.__tree_))
|
||||
: __tree_(_STD::move(__m.__tree_))
|
||||
{
|
||||
}
|
||||
|
||||
multimap(multimap&& __m, const allocator_type& __a);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap& operator=(multimap&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _VSTD::move(__m.__tree_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
|
||||
: __tree_(__vc(__comp))
|
||||
@@ -1556,14 +1520,21 @@ public:
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap& operator=(multimap&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _STD::move(__m.__tree_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap& operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
__tree_.__assign_multi(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multimap(const allocator_type& __a)
|
||||
@@ -1628,16 +1599,16 @@ public:
|
||||
iterator emplace() {return __tree_.__emplace_multi();}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator
|
||||
emplace(_A0&& __a0)
|
||||
{return __tree_.__emplace_multi(_VSTD::forward<_A0>(__a0));}
|
||||
{return __tree_.__emplace_multi(_STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class ..._Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator
|
||||
emplace(_A0&& __a0, _Args&& ...__args);
|
||||
|
||||
@@ -1648,32 +1619,32 @@ public:
|
||||
{return __tree_.__emplace_hint_multi(__p.__i_);}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator
|
||||
emplace_hint(const_iterator __p, _A0&& __a0)
|
||||
{return __tree_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_A0>(__a0));}
|
||||
{return __tree_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class ..._Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator
|
||||
emplace_hint(const_iterator __p, _A0&& __a0, _Args&& ...__args);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(_P&& __p)
|
||||
{return __tree_.__insert_multi(_VSTD::forward<_P>(__p));}
|
||||
{return __tree_.__insert_multi(_STD::forward<_P>(__p));}
|
||||
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __pos, _P&& __p)
|
||||
{return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_P>(__p));}
|
||||
{return __tree_.__insert_multi(__pos.__i_, _STD::forward<_P>(__p));}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -1692,14 +1663,10 @@ public:
|
||||
__tree_.__insert_multi(__e.__i_, *__f);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1752,11 +1719,11 @@ private:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__node_holder __construct_node();
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _A0, class ..._Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0, _Args&& ...__args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1766,14 +1733,14 @@ private:
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)
|
||||
: __tree_(_VSTD::move(__m.__tree_), __a)
|
||||
: __tree_(_STD::move(__m.__tree_), __a)
|
||||
{
|
||||
if (__a != __m.get_allocator())
|
||||
{
|
||||
const_iterator __e = cend();
|
||||
while (!__m.empty())
|
||||
__tree_.__insert_multi(__e.__i_,
|
||||
_VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
|
||||
_STD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1783,23 +1750,23 @@ multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node()
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second));
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
template <class _A0,
|
||||
class // = typename enable_if<is_constructible<value_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, value_type>::value>::type
|
||||
>
|
||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_), _STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
@@ -1809,16 +1776,16 @@ multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
template <class _A0, class ..._Args,
|
||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
>
|
||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args)
|
||||
{
|
||||
__node_allocator& __na = __tree_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first), _STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second), _STD::forward<_Args>(__args)...);
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
@@ -1830,13 +1797,13 @@ multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&&
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
template <class _A0, class ..._Args,
|
||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
||||
class //= typename enable_if<is_convertible<_A0, _Key>::value>::type
|
||||
>
|
||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
|
||||
multimap<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __tree_.__node_insert_multi(__h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1844,15 +1811,15 @@ multimap<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
template <class _A0, class ..._Args,
|
||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
||||
class //= typename enable_if<is_convertible<_A0, _Key>::value>::type
|
||||
>
|
||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
|
||||
multimap<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
|
||||
_A0&& __a0,
|
||||
_Args&& ...__args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __tree_.__node_insert_multi(__p.__i_, __h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1866,7 +1833,7 @@ bool
|
||||
operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
|
||||
const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1875,7 +1842,7 @@ bool
|
||||
operator< (const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
|
||||
const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||
|
361
include/memory
361
include/memory
@@ -595,7 +595,6 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
|
||||
#include <limits>
|
||||
#include <iterator>
|
||||
#include <__functional_base>
|
||||
#include <iosfwd>
|
||||
#if defined(_LIBCPP_NO_EXCEPTIONS)
|
||||
#include <cassert>
|
||||
#endif
|
||||
@@ -620,46 +619,6 @@ addressof(_Tp& __x) _NOEXCEPT
|
||||
return (_Tp*)&(char&)__x;
|
||||
}
|
||||
|
||||
#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
|
||||
// Objective-C++ Automatic Reference Counting uses qualified pointers
|
||||
// that require special addressof() signatures. When
|
||||
// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
|
||||
// itself is providing these definitions. Otherwise, we provide them.
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__strong _Tp*
|
||||
addressof(__strong _Tp& __x) _NOEXCEPT
|
||||
{
|
||||
return &__x;
|
||||
}
|
||||
|
||||
#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__weak _Tp*
|
||||
addressof(__weak _Tp& __x) _NOEXCEPT
|
||||
{
|
||||
return &__x;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__autoreleasing _Tp*
|
||||
addressof(__autoreleasing _Tp& __x) _NOEXCEPT
|
||||
{
|
||||
return &__x;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__unsafe_unretained _Tp*
|
||||
addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
|
||||
{
|
||||
return &__x;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _Tp> class allocator;
|
||||
|
||||
template <>
|
||||
@@ -939,7 +898,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer pointer_to(typename conditional<is_void<element_type>::value,
|
||||
__nat, element_type>::type& __r) _NOEXCEPT
|
||||
{return _VSTD::addressof(__r);}
|
||||
{return _STD::addressof(__r);}
|
||||
};
|
||||
|
||||
// allocator_traits
|
||||
@@ -1073,7 +1032,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename pointer_traits<_Pointer>::element_type*
|
||||
__to_raw_pointer(_Pointer __p) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::__to_raw_pointer(__p.operator->());
|
||||
return _STD::__to_raw_pointer(__p.operator->());
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
@@ -1294,11 +1253,11 @@ struct __has_allocate_hint
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
||||
template <class _Alloc, class _Tp, class ..._Args>
|
||||
decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(),
|
||||
_VSTD::declval<_Args>()...),
|
||||
decltype(_STD::declval<_Alloc>().construct(_STD::declval<_Tp*>(),
|
||||
_STD::declval<_Args>()...),
|
||||
true_type())
|
||||
__has_construct_test(_Alloc&& __a, _Tp* __p, _Args&& ...__args);
|
||||
|
||||
@@ -1468,7 +1427,7 @@ struct _LIBCPP_VISIBLE allocator_traits
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
|
||||
{__construct(__has_construct<allocator_type, pointer, _Args...>(),
|
||||
__a, __p, _VSTD::forward<_Args>(__args)...);}
|
||||
__a, __p, _STD::forward<_Args>(__args)...);}
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1529,12 +1488,12 @@ private:
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)
|
||||
{__a.construct(__p, _VSTD::forward<_Args>(__args)...);}
|
||||
{__a.construct(__p, _STD::forward<_Args>(__args)...);}
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)
|
||||
{
|
||||
::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
|
||||
::new ((void*)__p) _Tp(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
@@ -1639,9 +1598,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {}
|
||||
template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const _NOEXCEPT
|
||||
{return _VSTD::addressof(__x);}
|
||||
{return _STD::addressof(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
|
||||
{return _VSTD::addressof(__x);}
|
||||
{return _STD::addressof(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
|
||||
{return static_cast<pointer>(::operator new(__n * sizeof(_Tp)));}
|
||||
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
|
||||
@@ -1654,7 +1613,7 @@ public:
|
||||
void
|
||||
construct(_Up* __p, _Args&&... __args)
|
||||
{
|
||||
::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
|
||||
::new((void*)__p) _Up(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1695,7 +1654,7 @@ public:
|
||||
>::type
|
||||
construct(pointer __p, _A0 __a0)
|
||||
{
|
||||
::new((void*)__p) _Tp(_VSTD::move(__a0));
|
||||
::new((void*)__p) _Tp(_STD::move(__a0));
|
||||
}
|
||||
# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
template <class _A0, class _A1>
|
||||
@@ -1884,54 +1843,19 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1, int = 0)
|
||||
: __first_(_VSTD::forward<_T1_param>(__t1)) {}
|
||||
: __first_(_STD::forward<_T1_param>(__t1)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2, int* = 0)
|
||||
: __second_(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
: __second_(_STD::forward<_T2_param>(__t2)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
|
||||
is_nothrow_copy_constructible<_T2>::value)
|
||||
: __first_(__p.first()),
|
||||
__second_(__p.second()) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
|
||||
is_nothrow_copy_assignable<_T2>::value)
|
||||
{
|
||||
__first_ = __p.first();
|
||||
__second_ = __p.second();
|
||||
return *this;
|
||||
}
|
||||
: __first_(_STD::forward<_T1_param>(__t1)), __second_(_STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
|
||||
is_nothrow_move_constructible<_T2>::value)
|
||||
: __first_(_VSTD::forward<_T1>(__p.first())),
|
||||
__second_(_VSTD::forward<_T2>(__p.second())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
|
||||
is_nothrow_move_assignable<_T2>::value)
|
||||
{
|
||||
__first_ = _VSTD::forward<_T1>(__p.first());
|
||||
__second_ = _VSTD::forward<_T2>(__p.second());
|
||||
return *this;
|
||||
}
|
||||
|
||||
: __first_(_STD::forward<_T1>(__p.first())), __second_(_STD::forward<_T2>(__p.second())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
|
||||
|
||||
@@ -1942,7 +1866,7 @@ public:
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
|
||||
__is_nothrow_swappable<_T1>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__first_, __x.__first_);
|
||||
swap(__second_, __x.__second_);
|
||||
}
|
||||
@@ -1966,52 +1890,19 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1, int = 0)
|
||||
: _T1(_VSTD::forward<_T1_param>(__t1)) {}
|
||||
: _T1(_STD::forward<_T1_param>(__t1)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2, int* = 0)
|
||||
: __second_(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
: __second_(_STD::forward<_T2_param>(__t2)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: _T1(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
|
||||
is_nothrow_copy_constructible<_T2>::value)
|
||||
: _T1(__p.first()), __second_(__p.second()) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
|
||||
is_nothrow_copy_assignable<_T2>::value)
|
||||
{
|
||||
_T1::operator=(__p.first());
|
||||
__second_ = __p.second();
|
||||
return *this;
|
||||
}
|
||||
: _T1(_STD::forward<_T1_param>(__t1)), __second_(_STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
|
||||
is_nothrow_move_constructible<_T2>::value)
|
||||
: _T1(_VSTD::move(__p.first())), __second_(_VSTD::forward<_T2>(__p.second())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
|
||||
is_nothrow_move_assignable<_T2>::value)
|
||||
{
|
||||
_T1::operator=(_VSTD::move(__p.first()));
|
||||
__second_ = _VSTD::forward<_T2>(__p.second());
|
||||
return *this;
|
||||
}
|
||||
|
||||
: _T1(_STD::move(__p.first())), __second_(_STD::forward<_T2>(__p.second())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
|
||||
|
||||
@@ -2022,7 +1913,7 @@ public:
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
|
||||
__is_nothrow_swappable<_T1>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__second_, __x.__second_);
|
||||
}
|
||||
};
|
||||
@@ -2045,54 +1936,19 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
|
||||
: __first_(_VSTD::forward<_T1_param>(__t1)) {}
|
||||
: __first_(_STD::forward<_T1_param>(__t1)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
|
||||
: _T2(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
: _T2(_STD::forward<_T2_param>(__t2)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
|
||||
is_nothrow_move_constructible<_T2>::value)
|
||||
: _T2(_VSTD::forward<_T2_param>(__t2)), __first_(_VSTD::forward<_T1_param>(__t1)) {}
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
|
||||
is_nothrow_copy_constructible<_T2>::value)
|
||||
: _T2(__p.second()), __first_(__p.first()) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
|
||||
is_nothrow_copy_assignable<_T2>::value)
|
||||
{
|
||||
_T2::operator=(__p.second());
|
||||
__first_ = __p.first();
|
||||
return *this;
|
||||
}
|
||||
: _T2(_STD::forward<_T2_param>(__t2)), __first_(_STD::forward<_T1_param>(__t1)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
|
||||
is_nothrow_move_constructible<_T2>::value)
|
||||
: _T2(_VSTD::forward<_T2>(__p.second())), __first_(_VSTD::move(__p.first())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
|
||||
is_nothrow_move_assignable<_T2>::value)
|
||||
{
|
||||
_T2::operator=(_VSTD::forward<_T2>(__p.second()));
|
||||
__first_ = _VSTD::move(__p.first());
|
||||
return *this;
|
||||
}
|
||||
|
||||
: _T2(_STD::forward<_T2>(__p.second())), __first_(_STD::move(__p.first())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
|
||||
|
||||
@@ -2103,7 +1959,7 @@ public:
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
|
||||
__is_nothrow_swappable<_T1>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__first_, __x.__first_);
|
||||
}
|
||||
};
|
||||
@@ -2125,52 +1981,19 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
|
||||
: _T1(_VSTD::forward<_T1_param>(__t1)) {}
|
||||
: _T1(_STD::forward<_T1_param>(__t1)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
|
||||
: _T2(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
: _T2(_STD::forward<_T2_param>(__t2)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: _T1(_VSTD::forward<_T1_param>(__t1)), _T2(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
|
||||
is_nothrow_copy_constructible<_T2>::value)
|
||||
: _T1(__p.first()), _T2(__p.second()) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
|
||||
is_nothrow_copy_assignable<_T2>::value)
|
||||
{
|
||||
_T1::operator=(__p.first());
|
||||
_T2::operator=(__p.second());
|
||||
return *this;
|
||||
}
|
||||
: _T1(_STD::forward<_T1_param>(__t1)), _T2(_STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
|
||||
is_nothrow_move_constructible<_T2>::value)
|
||||
: _T1(_VSTD::move(__p.first())), _T2(_VSTD::move(__p.second())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
|
||||
is_nothrow_move_assignable<_T2>::value)
|
||||
{
|
||||
_T1::operator=(_VSTD::move(__p.first()));
|
||||
_T2::operator=(_VSTD::move(__p.second()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
: _T1(_STD::move(__p.first())), _T2(_STD::move(__p.second())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
|
||||
|
||||
@@ -2201,48 +2024,19 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __compressed_pair() {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T1_param __t1, int = 0)
|
||||
: base(_VSTD::forward<_T1_param>(__t1)) {}
|
||||
: base(_STD::forward<_T1_param>(__t1)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T2_param __t2, int* = 0)
|
||||
: base(_VSTD::forward<_T2_param>(__t2)) {}
|
||||
: base(_STD::forward<_T2_param>(__t2)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
|
||||
: base(_VSTD::forward<_T1_param>(__t1), _VSTD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__compressed_pair(const __compressed_pair& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
|
||||
is_nothrow_copy_constructible<_T2>::value)
|
||||
: base(__p) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__compressed_pair& operator=(const __compressed_pair& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
|
||||
is_nothrow_copy_assignable<_T2>::value)
|
||||
{
|
||||
base::operator=(__p);
|
||||
return *this;
|
||||
}
|
||||
: base(_STD::forward<_T1_param>(__t1), _STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__compressed_pair(__compressed_pair&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
|
||||
is_nothrow_move_constructible<_T2>::value)
|
||||
: base(_VSTD::move(__p)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__compressed_pair& operator=(__compressed_pair&& __p)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
|
||||
is_nothrow_move_assignable<_T2>::value)
|
||||
{
|
||||
base::operator=(_VSTD::move(__p));
|
||||
return *this;
|
||||
}
|
||||
: base(_STD::move(__p)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return base::first();}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return base::first();}
|
||||
|
||||
@@ -2333,7 +2127,7 @@ public:
|
||||
"unique_ptr constructed with null function pointer deleter");
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p) _NOEXCEPT
|
||||
: __ptr_(_VSTD::move(__p))
|
||||
: __ptr_(_STD::move(__p))
|
||||
{
|
||||
static_assert(!is_pointer<deleter_type>::value,
|
||||
"unique_ptr constructed with null function pointer deleter");
|
||||
@@ -2349,12 +2143,12 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename remove_reference<deleter_type>::type&& __d)
|
||||
_NOEXCEPT
|
||||
: __ptr_(__p, _VSTD::move(__d))
|
||||
: __ptr_(__p, _STD::move(__d))
|
||||
{
|
||||
static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
|
||||
: __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
|
||||
: __ptr_(__u.release(), _STD::forward<deleter_type>(__u.get_deleter())) {}
|
||||
template <class _Up, class _Ep>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_ptr(unique_ptr<_Up, _Ep>&& __u,
|
||||
@@ -2369,7 +2163,7 @@ public:
|
||||
),
|
||||
__nat
|
||||
>::type = __nat()) _NOEXCEPT
|
||||
: __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
|
||||
: __ptr_(__u.release(), _STD::forward<_Ep>(__u.get_deleter())) {}
|
||||
|
||||
template <class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p,
|
||||
@@ -2385,7 +2179,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
|
||||
{
|
||||
reset(__u.release());
|
||||
__ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
|
||||
__ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -2399,7 +2193,7 @@ public:
|
||||
operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
|
||||
{
|
||||
reset(__u.release());
|
||||
__ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
|
||||
__ptr_.second() = _STD::forward<_Ep>(__u.get_deleter());
|
||||
return *this;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -2410,18 +2204,18 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
|
||||
: __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
|
||||
: __ptr_(__u->release(), _STD::forward<deleter_type>(__u->get_deleter())) {}
|
||||
|
||||
template <class _Up, class _Ep>
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr<_Up, _Ep> __u)
|
||||
{
|
||||
reset(__u.release());
|
||||
__ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
|
||||
__ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
|
||||
: __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {}
|
||||
: __ptr_(_STD::move(__p), _STD::move(__d)) {}
|
||||
|
||||
template <class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2546,25 +2340,25 @@ public:
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(_P __p, typename remove_reference<deleter_type>::type&& __d)
|
||||
_NOEXCEPT
|
||||
: __ptr_(__p, _VSTD::move(__d))
|
||||
: __ptr_(__p, _STD::move(__d))
|
||||
{
|
||||
static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename remove_reference<deleter_type>::type&& __d)
|
||||
_NOEXCEPT
|
||||
: __ptr_(pointer(), _VSTD::move(__d))
|
||||
: __ptr_(pointer(), _STD::move(__d))
|
||||
{
|
||||
static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
|
||||
: __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
|
||||
: __ptr_(__u.release(), _STD::forward<deleter_type>(__u.get_deleter())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
|
||||
{
|
||||
reset(__u.release());
|
||||
__ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
|
||||
__ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
|
||||
return *this;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -2577,10 +2371,10 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
|
||||
: __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {}
|
||||
: __ptr_(__p, _STD::forward<deleter_type>(__d)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, deleter_type __d)
|
||||
: __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {}
|
||||
: __ptr_(pointer(), _STD::forward<deleter_type>(__d)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
|
||||
{
|
||||
@@ -2588,12 +2382,12 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
|
||||
: __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
|
||||
: __ptr_(__u->release(), _STD::forward<deleter_type>(__u->get_deleter())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(__rv<unique_ptr> __u)
|
||||
{
|
||||
reset(__u->release());
|
||||
__ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
|
||||
__ptr_.second() = _STD::forward<deleter_type>(__u->get_deleter());
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -2713,7 +2507,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);}
|
||||
|
||||
template <class _Tp> struct hash;
|
||||
template <class> struct hash;
|
||||
|
||||
template<class _Tp>
|
||||
struct _LIBCPP_VISIBLE hash<_Tp*>
|
||||
@@ -2903,7 +2697,9 @@ public:
|
||||
long use_count() const _NOEXCEPT {return __shared_count::use_count();}
|
||||
__shared_weak_count* lock() _NOEXCEPT;
|
||||
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
|
||||
#endif
|
||||
private:
|
||||
virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
|
||||
};
|
||||
@@ -2916,7 +2712,7 @@ class __shared_ptr_pointer
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
|
||||
: __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
|
||||
: __data_(__compressed_pair<_Tp, _Dp>(__p, _STD::move(__d)), _STD::move(__a)) {}
|
||||
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
|
||||
@@ -2965,12 +2761,12 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a)
|
||||
: __data_(_VSTD::move(__a)) {}
|
||||
: __data_(_STD::move(__a)) {}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
|
||||
: __data_(_VSTD::move(__a), _Tp(_VSTD::forward<_Args>(__args)...)) {}
|
||||
: __data_(_STD::move(__a), _Tp(_STD::forward<_Args>(__args)...)) {}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
@@ -3435,7 +3231,7 @@ shared_ptr<_Tp>::make_shared(_Args&& ...__args)
|
||||
typedef __allocator_destructor<_A2> _D2;
|
||||
_A2 __a2;
|
||||
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
|
||||
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
|
||||
::new(__hold2.get()) _CntrlBlk(__a2, _STD::forward<_Args>(__args)...);
|
||||
shared_ptr<_Tp> __r;
|
||||
__r.__ptr_ = __hold2.get()->get();
|
||||
__r.__cntrl_ = __hold2.release();
|
||||
@@ -3453,7 +3249,7 @@ shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _Args&& ...__args)
|
||||
typedef __allocator_destructor<_A2> _D2;
|
||||
_A2 __a2(__a);
|
||||
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
|
||||
::new(__hold2.get()) _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
|
||||
::new(__hold2.get()) _CntrlBlk(__a, _STD::forward<_Args>(__args)...);
|
||||
shared_ptr<_Tp> __r;
|
||||
__r.__ptr_ = __hold2.get()->get();
|
||||
__r.__cntrl_ = __hold2.release();
|
||||
@@ -3641,7 +3437,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>&
|
||||
shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
|
||||
{
|
||||
shared_ptr(_VSTD::move(__r)).swap(*this);
|
||||
shared_ptr(_STD::move(__r)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -3651,7 +3447,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>&
|
||||
shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
|
||||
{
|
||||
shared_ptr(_VSTD::move(__r)).swap(*this);
|
||||
shared_ptr(_STD::move(__r)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -3661,7 +3457,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>&
|
||||
shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
|
||||
{
|
||||
shared_ptr(_VSTD::move(__r)).swap(*this);
|
||||
shared_ptr(_STD::move(__r)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -3671,7 +3467,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>&
|
||||
shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
|
||||
{
|
||||
shared_ptr(_VSTD::move(__r)).swap(*this);
|
||||
shared_ptr(_STD::move(__r)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -3693,7 +3489,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>&
|
||||
shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
|
||||
{
|
||||
shared_ptr(_VSTD::move(__r)).swap(*this);
|
||||
shared_ptr(_STD::move(__r)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -3704,8 +3500,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
|
||||
{
|
||||
_VSTD::swap(__ptr_, __r.__ptr_);
|
||||
_VSTD::swap(__cntrl_, __r.__cntrl_);
|
||||
_STD::swap(__ptr_, __r.__ptr_);
|
||||
_STD::swap(__cntrl_, __r.__cntrl_);
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
@@ -3750,7 +3546,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>
|
||||
make_shared(_Args&& ...__args)
|
||||
{
|
||||
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
|
||||
return shared_ptr<_Tp>::make_shared(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template<class _Tp, class _Alloc, class ..._Args>
|
||||
@@ -3758,7 +3554,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>
|
||||
allocate_shared(const _Alloc& __a, _Args&& ...__args)
|
||||
{
|
||||
return shared_ptr<_Tp>::allocate_shared(__a, _VSTD::forward<_Args>(__args)...);
|
||||
return shared_ptr<_Tp>::allocate_shared(__a, _STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -4030,8 +3826,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT
|
||||
{
|
||||
_VSTD::swap(__ptr_, __r.__ptr_);
|
||||
_VSTD::swap(__cntrl_, __r.__cntrl_);
|
||||
_STD::swap(__ptr_, __r.__ptr_);
|
||||
_STD::swap(__cntrl_, __r.__cntrl_);
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
@@ -4147,11 +3943,6 @@ struct _LIBCPP_VISIBLE hash<shared_ptr<_Tp> >
|
||||
}
|
||||
};
|
||||
|
||||
template<class _CharT, class _Traits, class _Y>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Y> const& __p);
|
||||
|
||||
//enum class
|
||||
struct _LIBCPP_VISIBLE pointer_safety
|
||||
{
|
||||
@@ -4174,7 +3965,7 @@ void declare_reachable(void* __p);
|
||||
void declare_no_pointers(char* __p, size_t __n);
|
||||
void undeclare_no_pointers(char* __p, size_t __n);
|
||||
pointer_safety get_pointer_safety() _NOEXCEPT;
|
||||
void* __undeclare_reachable(void* __p);
|
||||
void* __undeclare_reachable(void*);
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -4184,7 +3975,7 @@ undeclare_reachable(_Tp* __p)
|
||||
return static_cast<_Tp*>(__undeclare_reachable(__p));
|
||||
}
|
||||
|
||||
void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
|
||||
void* align(size_t, size_t, void*&, size_t&);
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
@@ -467,7 +467,7 @@ class __call_once_param
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
|
||||
explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(const _F& __f) : __f_(__f) {}
|
||||
@@ -485,7 +485,7 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
|
||||
__invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -498,7 +498,7 @@ class __call_once_param
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
|
||||
explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(const _F& __f) : __f_(__f) {}
|
||||
@@ -533,8 +533,8 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
|
||||
if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
|
||||
{
|
||||
typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G;
|
||||
__call_once_param<_G> __p(_G(__decay_copy(_VSTD::forward<_Callable>(__func)),
|
||||
__decay_copy(_VSTD::forward<_Args>(__args))...));
|
||||
__call_once_param<_G> __p(_G(__decay_copy(_STD::forward<_Callable>(__func)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
__call_once(__flag.__state_, &__p, &__call_once_proxy<_G>);
|
||||
}
|
||||
}
|
||||
|
16
include/new
16
include/new
@@ -89,23 +89,23 @@ _LIBCPP_VISIBLE new_handler get_new_handler() _NOEXCEPT;
|
||||
|
||||
} // std
|
||||
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz)
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t)
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
throw(std::bad_alloc)
|
||||
#endif
|
||||
;
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete(void*) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete(void*, const std::nothrow_t&) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz)
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t)
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
throw(std::bad_alloc)
|
||||
#endif
|
||||
;
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete[](void*) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete[](void*, const std::nothrow_t&) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
|
@@ -154,13 +154,11 @@ public:
|
||||
virtual ~basic_ostream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream(basic_ostream&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.7.2.3 Assign/swap
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream& operator=(basic_ostream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ostream& __rhs);
|
||||
|
@@ -211,7 +211,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
|
||||
: c(_VSTD::move(__q.c)) {}
|
||||
: c(_STD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -221,14 +221,14 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue& operator=(queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
|
||||
{c = _VSTD::move(__q.c); return *this;}
|
||||
{c = _STD::move(__q.c); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit queue(const container_type& __c) : c(__c) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
|
||||
explicit queue(container_type&& __c) : c(_STD::move(__c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -254,13 +254,13 @@ public:
|
||||
queue(container_type&& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__c), __a) {}
|
||||
: c(_STD::move(__c), __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__q.c), __a) {}
|
||||
: c(_STD::move(__q.c), __a) {}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -282,12 +282,12 @@ public:
|
||||
void push(const value_type& __v) {c.push_back(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
|
||||
void push(value_type&& __v) {c.push_back(_STD::move(__v));}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_VSTD::forward<_Args>(__args)...);}
|
||||
{c.emplace_back(_STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
void swap(queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(c, __q.c);
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
priority_queue(priority_queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
|
||||
is_nothrow_move_constructible<value_compare>::value)
|
||||
: c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
|
||||
: c(_STD::move(__q.c)), comp(_STD::move(__q.comp)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -420,7 +420,7 @@ public:
|
||||
priority_queue& operator=(priority_queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
|
||||
is_nothrow_move_assignable<value_compare>::value)
|
||||
{c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
|
||||
{c = _STD::move(__q.c); comp = _STD::move(__q.comp); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -498,7 +498,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp
|
||||
: c(__c),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -507,10 +507,10 @@ template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
container_type&& __c)
|
||||
: c(_VSTD::move(__c)),
|
||||
: c(_STD::move(__c)),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -523,7 +523,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
: c(__f, __l),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
@@ -536,7 +536,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
comp(__comp)
|
||||
{
|
||||
c.insert(c.end(), __f, __l);
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -547,11 +547,11 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp,
|
||||
container_type&& __c)
|
||||
: c(_VSTD::move(__c)),
|
||||
: c(_STD::move(__c)),
|
||||
comp(__comp)
|
||||
{
|
||||
c.insert(c.end(), __f, __l);
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -589,7 +589,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
: c(__c, __a),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
@@ -602,7 +602,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue&
|
||||
: c(__q.c, __a),
|
||||
comp(__q.comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -615,10 +615,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type*)
|
||||
: c(_VSTD::move(__c), __a),
|
||||
: c(_STD::move(__c), __a),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
@@ -628,10 +628,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type*)
|
||||
: c(_VSTD::move(__q.c), __a),
|
||||
comp(_VSTD::move(__q.comp))
|
||||
: c(_STD::move(__q.c), __a),
|
||||
comp(_STD::move(__q.comp))
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -642,7 +642,7 @@ void
|
||||
priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
|
||||
{
|
||||
c.push_back(__v);
|
||||
_VSTD::push_heap(c.begin(), c.end(), comp);
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -652,8 +652,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
|
||||
{
|
||||
c.push_back(_VSTD::move(__v));
|
||||
_VSTD::push_heap(c.begin(), c.end(), comp);
|
||||
c.push_back(_STD::move(__v));
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -664,8 +664,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
|
||||
{
|
||||
c.emplace_back(_VSTD::forward<_Args>(__args)...);
|
||||
_VSTD::push_heap(c.begin(), c.end(), comp);
|
||||
c.emplace_back(_STD::forward<_Args>(__args)...);
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -676,7 +676,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::pop()
|
||||
{
|
||||
_VSTD::pop_heap(c.begin(), c.end(), comp);
|
||||
_STD::pop_heap(c.begin(), c.end(), comp);
|
||||
c.pop_back();
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
|
||||
__is_nothrow_swappable<value_compare>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(c, __q.c);
|
||||
swap(comp, __q.comp);
|
||||
}
|
||||
|
159
include/random
159
include/random
@@ -2313,37 +2313,37 @@ operator==(const mersenne_twister_engine<_UI, _W, _N, _M, _R, _A, _U, _D, _S,
|
||||
_B, _T, _C, _L, _F>& __y)
|
||||
{
|
||||
if (__x.__i_ == __y.__i_)
|
||||
return _VSTD::equal(__x.__x_, __x.__x_ + _N, __y.__x_);
|
||||
return _STD::equal(__x.__x_, __x.__x_ + _N, __y.__x_);
|
||||
if (__x.__i_ == 0 || __y.__i_ == 0)
|
||||
{
|
||||
size_t __j = _VSTD::min(_N - __x.__i_, _N - __y.__i_);
|
||||
if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
|
||||
size_t __j = _STD::min(_N - __x.__i_, _N - __y.__i_);
|
||||
if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
|
||||
__y.__x_ + __y.__i_))
|
||||
return false;
|
||||
if (__x.__i_ == 0)
|
||||
return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _N, __y.__x_);
|
||||
return _VSTD::equal(__x.__x_, __x.__x_ + (_N - __j), __y.__x_ + __j);
|
||||
return _STD::equal(__x.__x_ + __j, __x.__x_ + _N, __y.__x_);
|
||||
return _STD::equal(__x.__x_, __x.__x_ + (_N - __j), __y.__x_ + __j);
|
||||
}
|
||||
if (__x.__i_ < __y.__i_)
|
||||
{
|
||||
size_t __j = _N - __y.__i_;
|
||||
if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
|
||||
if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
|
||||
__y.__x_ + __y.__i_))
|
||||
return false;
|
||||
if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _N,
|
||||
if (!_STD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _N,
|
||||
__y.__x_))
|
||||
return false;
|
||||
return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
|
||||
return _STD::equal(__x.__x_, __x.__x_ + __x.__i_,
|
||||
__y.__x_ + (_N - (__x.__i_ + __j)));
|
||||
}
|
||||
size_t __j = _N - __x.__i_;
|
||||
if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
|
||||
if (!_STD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
|
||||
__x.__x_ + __x.__i_))
|
||||
return false;
|
||||
if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _N,
|
||||
if (!_STD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _N,
|
||||
__x.__x_))
|
||||
return false;
|
||||
return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
|
||||
return _STD::equal(__y.__x_, __y.__x_ + __y.__i_,
|
||||
__x.__x_ + (_N - (__y.__i_ + __j)));
|
||||
}
|
||||
|
||||
@@ -2562,11 +2562,8 @@ subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd,
|
||||
linear_congruential_engine<result_type, 40014u, 0u, 2147483563u>
|
||||
__e(__sd == 0u ? default_seed : __sd);
|
||||
for (size_t __i = 0; __i < __r; ++__i)
|
||||
{
|
||||
result_type __e0 = __e();
|
||||
__x_[__i] = static_cast<result_type>(
|
||||
(__e0 + ((uint64_t)__e() << 32)) & _Max);
|
||||
}
|
||||
(__e() + ((uint64_t)__e() << 32)) & _Max);
|
||||
__c_ = __x_[__r-1] == 0;
|
||||
__i_ = 0;
|
||||
}
|
||||
@@ -2624,37 +2621,37 @@ operator==(
|
||||
if (__x.__c_ != __y.__c_)
|
||||
return false;
|
||||
if (__x.__i_ == __y.__i_)
|
||||
return _VSTD::equal(__x.__x_, __x.__x_ + _R, __y.__x_);
|
||||
return _STD::equal(__x.__x_, __x.__x_ + _R, __y.__x_);
|
||||
if (__x.__i_ == 0 || __y.__i_ == 0)
|
||||
{
|
||||
size_t __j = _VSTD::min(_R - __x.__i_, _R - __y.__i_);
|
||||
if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
|
||||
size_t __j = _STD::min(_R - __x.__i_, _R - __y.__i_);
|
||||
if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
|
||||
__y.__x_ + __y.__i_))
|
||||
return false;
|
||||
if (__x.__i_ == 0)
|
||||
return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _R, __y.__x_);
|
||||
return _VSTD::equal(__x.__x_, __x.__x_ + (_R - __j), __y.__x_ + __j);
|
||||
return _STD::equal(__x.__x_ + __j, __x.__x_ + _R, __y.__x_);
|
||||
return _STD::equal(__x.__x_, __x.__x_ + (_R - __j), __y.__x_ + __j);
|
||||
}
|
||||
if (__x.__i_ < __y.__i_)
|
||||
{
|
||||
size_t __j = _R - __y.__i_;
|
||||
if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
|
||||
if (!_STD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
|
||||
__y.__x_ + __y.__i_))
|
||||
return false;
|
||||
if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _R,
|
||||
if (!_STD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _R,
|
||||
__y.__x_))
|
||||
return false;
|
||||
return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
|
||||
return _STD::equal(__x.__x_, __x.__x_ + __x.__i_,
|
||||
__y.__x_ + (_R - (__x.__i_ + __j)));
|
||||
}
|
||||
size_t __j = _R - __x.__i_;
|
||||
if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
|
||||
if (!_STD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
|
||||
__x.__x_ + __x.__i_))
|
||||
return false;
|
||||
if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _R,
|
||||
if (!_STD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _R,
|
||||
__x.__x_))
|
||||
return false;
|
||||
return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
|
||||
return _STD::equal(__y.__x_, __y.__x_ + __y.__i_,
|
||||
__x.__x_ + (_R - (__y.__i_ + __j)));
|
||||
}
|
||||
|
||||
@@ -2747,7 +2744,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit discard_block_engine(_Engine&& __e)
|
||||
: __e_(_VSTD::move(__e)), __n_(0) {}
|
||||
: __e_(_STD::move(__e)), __n_(0) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
|
||||
@@ -2947,7 +2944,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit independent_bits_engine(_Engine&& __e)
|
||||
: __e_(_VSTD::move(__e)) {}
|
||||
: __e_(_STD::move(__e)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
|
||||
@@ -3170,7 +3167,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit shuffle_order_engine(_Engine&& __e)
|
||||
: __e_(_VSTD::move(__e)) {__init();}
|
||||
: __e_(_STD::move(__e)) {__init();}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
|
||||
@@ -3295,7 +3292,7 @@ operator==(
|
||||
const shuffle_order_engine<_Eng, _K>& __x,
|
||||
const shuffle_order_engine<_Eng, _K>& __y)
|
||||
{
|
||||
return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _K, __y._V_) &&
|
||||
return __x._Y_ == __y._Y_ && _STD::equal(__x._V_, __x._V_ + _K, __y._V_) &&
|
||||
__x.__e_ == __y.__e_;
|
||||
}
|
||||
|
||||
@@ -3402,11 +3399,9 @@ public:
|
||||
// constructors
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
seed_seq() {}
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
seed_seq(initializer_list<_Tp> __il) {init(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -3423,7 +3418,7 @@ public:
|
||||
template<class _OutputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void param(_OutputIterator __dest) const
|
||||
{_VSTD::copy(__v_.begin(), __v_.end(), __dest);}
|
||||
{_STD::copy(__v_.begin(), __v_.end(), __dest);}
|
||||
|
||||
private:
|
||||
// no copy functions
|
||||
@@ -3448,7 +3443,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last)
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_VSTD::fill(__first, __last, 0x8b8b8b8b);
|
||||
_STD::fill(__first, __last, 0x8b8b8b8b);
|
||||
const size_t __n = static_cast<size_t>(__last - __first);
|
||||
const size_t __s = __v_.size();
|
||||
const size_t __t = (__n >= 623) ? 11
|
||||
@@ -3458,7 +3453,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last)
|
||||
: (__n - 1) / 2;
|
||||
const size_t __p = (__n - __t) / 2;
|
||||
const size_t __q = __p + __t;
|
||||
const size_t __m = _VSTD::max(__s + 1, __n);
|
||||
const size_t __m = _STD::max(__s + 1, __n);
|
||||
// __k = 0;
|
||||
{
|
||||
result_type __r = 1664525 * _T(__first[0] ^ __first[__p]
|
||||
@@ -3644,7 +3639,7 @@ typename uniform_real_distribution<_RealType>::result_type
|
||||
uniform_real_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
{
|
||||
return (__p.b() - __p.a())
|
||||
* _VSTD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
|
||||
* _STD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
|
||||
+ __p.a();
|
||||
}
|
||||
|
||||
@@ -3876,9 +3871,9 @@ binomial_distribution<_IntType>::param_type::param_type(result_type __t, double
|
||||
if (0 < __p_ && __p_ < 1)
|
||||
{
|
||||
__r0_ = static_cast<result_type>((__t_ + 1) * __p_);
|
||||
__pr_ = _VSTD::exp(_VSTD::lgamma(__t_ + 1.) - _VSTD::lgamma(__r0_ + 1.) -
|
||||
_VSTD::lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
|
||||
(__t_ - __r0_) * _VSTD::log(1 - __p_));
|
||||
__pr_ = _STD::exp(_STD::lgamma(__t_ + 1.) - _STD::lgamma(__r0_ + 1.) -
|
||||
_STD::lgamma(__t_ - __r0_ + 1.) + __r0_ * _STD::log(__p_) +
|
||||
(__t_ - __r0_) * _STD::log(1 - __p_));
|
||||
__odds_ratio_ = __p_ / (1 - __p_);
|
||||
}
|
||||
}
|
||||
@@ -4030,10 +4025,10 @@ template<class _URNG>
|
||||
_RealType
|
||||
exponential_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
{
|
||||
return -_VSTD::log
|
||||
return -_STD::log
|
||||
(
|
||||
result_type(1) -
|
||||
_VSTD::generate_canonical<result_type,
|
||||
_STD::generate_canonical<result_type,
|
||||
numeric_limits<result_type>::digits>(__g)
|
||||
)
|
||||
/ __p.lambda();
|
||||
@@ -4185,7 +4180,7 @@ normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
__v = _Uni(__g);
|
||||
__s = __u * __u + __v * __v;
|
||||
} while (__s > 1 || __s == 0);
|
||||
result_type _F = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
|
||||
result_type _F = _STD::sqrt(-2 * _STD::log(__s) / __s);
|
||||
_V_ = __v * _F;
|
||||
_V_hot_ = true;
|
||||
_U = __u * _F;
|
||||
@@ -4302,7 +4297,7 @@ public:
|
||||
template<class _URNG>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type operator()(_URNG& __g, const param_type& __p)
|
||||
{return _VSTD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
|
||||
{return _STD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -4451,7 +4446,7 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
|
||||
{
|
||||
__s_ = 0;
|
||||
__d_ = 0;
|
||||
__l_ = _VSTD::exp(-__mean_);
|
||||
__l_ = _STD::exp(-__mean_);
|
||||
__omega_ = 0;
|
||||
__c3_ = 0;
|
||||
__c2_ = 0;
|
||||
@@ -4461,7 +4456,7 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
|
||||
}
|
||||
else
|
||||
{
|
||||
__s_ = _VSTD::sqrt(__mean_);
|
||||
__s_ = _STD::sqrt(__mean_);
|
||||
__d_ = 6 * __mean_ * __mean_;
|
||||
__l_ = static_cast<result_type>(__mean_ - 1.1484);
|
||||
__omega_ = .3989423 / __s_;
|
||||
@@ -4528,20 +4523,20 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
|
||||
const result_type __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040,
|
||||
40320, 362880};
|
||||
__px = -__pr.__mean_;
|
||||
__py = _VSTD::pow(__pr.__mean_, (double)__x) / __fac[__x];
|
||||
__py = _STD::pow(__pr.__mean_, (double)__x) / __fac[__x];
|
||||
}
|
||||
else
|
||||
{
|
||||
double __del = .8333333E-1 / __x;
|
||||
__del -= 4.8 * __del * __del * __del;
|
||||
double __v = __difmuk / __x;
|
||||
if (_VSTD::abs(__v) > 0.25)
|
||||
__px = __x * _VSTD::log(1 + __v) - __difmuk - __del;
|
||||
if (_STD::abs(__v) > 0.25)
|
||||
__px = __x * _STD::log(1 + __v) - __difmuk - __del;
|
||||
else
|
||||
__px = __x * __v * __v * (((((((.1250060 * __v + -.1384794) *
|
||||
__v + .1421878) * __v + -.1661269) * __v + .2000118) *
|
||||
__v + -.2500068) * __v + .3333333) * __v + -.5) - __del;
|
||||
__py = .3989423 / _VSTD::sqrt(__x);
|
||||
__py = .3989423 / _STD::sqrt(__x);
|
||||
}
|
||||
double __r = (0.5 - __difmuk) / __pr.__s_;
|
||||
double __r2 = __r * __r;
|
||||
@@ -4550,13 +4545,13 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
|
||||
__r2 + __pr.__c1_) * __r2 + __pr.__c0_);
|
||||
if (__using_exp_dist)
|
||||
{
|
||||
if (__pr.__c_ * _VSTD::abs(__u) <= __py * _VSTD::exp(__px + __e) -
|
||||
__fy * _VSTD::exp(__fx + __e))
|
||||
if (__pr.__c_ * _STD::abs(__u) <= __py * _STD::exp(__px + __e) -
|
||||
__fy * _STD::exp(__fx + __e))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (__fy - __u * __fy <= __py * _VSTD::exp(__px - __fx))
|
||||
if (__fy - __u * __fy <= __py * _STD::exp(__px - __fx))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4647,7 +4642,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type operator()(_URNG& __g, const param_type& __p)
|
||||
{return __p.b() *
|
||||
_VSTD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());}
|
||||
_STD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -4791,7 +4786,7 @@ _RealType
|
||||
extreme_value_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
{
|
||||
return __p.a() - __p.b() *
|
||||
_VSTD::log(-_VSTD::log(1-uniform_real_distribution<result_type>()(__g)));
|
||||
_STD::log(-_STD::log(1-uniform_real_distribution<result_type>()(__g)));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _RT>
|
||||
@@ -4928,7 +4923,7 @@ gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
const result_type __w = __u * (1 - __u);
|
||||
if (__w != 0)
|
||||
{
|
||||
const result_type __y = _VSTD::sqrt(__c / __w) *
|
||||
const result_type __y = _STD::sqrt(__c / __w) *
|
||||
(__u - result_type(0.5));
|
||||
__x = __b + __y;
|
||||
if (__x >= 0)
|
||||
@@ -4936,7 +4931,7 @@ gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
const result_type __z = 64 * __w * __w * __w * __v * __v;
|
||||
if (__z <= 1 - 2 * __y * __y / __x)
|
||||
break;
|
||||
if (_VSTD::log(__z) <= 2 * (__b * _VSTD::log(__x / __b) - __y))
|
||||
if (_STD::log(__z) <= 2 * (__b * _STD::log(__x / __b) - __y))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4950,14 +4945,14 @@ gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
const result_type __es = __egen(__g);
|
||||
if (__u <= 1 - __a)
|
||||
{
|
||||
__x = _VSTD::pow(__u, 1 / __a);
|
||||
__x = _STD::pow(__u, 1 / __a);
|
||||
if (__x <= __es)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
const result_type __e = -_VSTD::log((1-__u)/__a);
|
||||
__x = _VSTD::pow(1 - __a + __a * __e, 1 / __a);
|
||||
const result_type __e = -_STD::log((1-__u)/__a);
|
||||
__x = _STD::pow(1 - __a + __a * __e, 1 / __a);
|
||||
if (__x <= __e + __es)
|
||||
break;
|
||||
}
|
||||
@@ -5429,7 +5424,7 @@ cauchy_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
{
|
||||
uniform_real_distribution<result_type> __gen;
|
||||
// purposefully let tan arg get as close to pi/2 as it wants, tan will return a finite
|
||||
return __p.a() + __p.b() * _VSTD::tan(3.1415926535897932384626433832795 * __gen(__g));
|
||||
return __p.a() + __p.b() * _STD::tan(3.1415926535897932384626433832795 * __gen(__g));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _RT>
|
||||
@@ -5667,7 +5662,7 @@ _RealType
|
||||
student_t_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
||||
{
|
||||
gamma_distribution<result_type> __gd(__p.n() * .5, 2);
|
||||
return __nd_(__g) * _VSTD::sqrt(__p.n()/__gd(__g));
|
||||
return __nd_(__g) * _STD::sqrt(__p.n()/__gd(__g));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _RT>
|
||||
@@ -5720,11 +5715,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
param_type(_InputIterator __f, _InputIterator __l)
|
||||
: __p_(__f, __l) {__init();}
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
param_type(initializer_list<double> __wl)
|
||||
: __p_(__wl.begin(), __wl.end()) {__init();}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
param_type(size_t __nw, double __xmin, double __xmax,
|
||||
_UnaryOperation __fw);
|
||||
@@ -5767,11 +5760,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
discrete_distribution(_InputIterator __f, _InputIterator __l)
|
||||
: __p_(__f, __l) {}
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
discrete_distribution(initializer_list<double> __wl)
|
||||
: __p_(__wl) {}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
discrete_distribution(size_t __nw, double __xmin, double __xmax,
|
||||
@@ -5852,12 +5843,12 @@ discrete_distribution<_IntType>::param_type::__init()
|
||||
{
|
||||
if (__p_.size() > 1)
|
||||
{
|
||||
double __s = _VSTD::accumulate(__p_.begin(), __p_.end(), 0.0);
|
||||
for (_VSTD::vector<double>::iterator __i = __p_.begin(), __e = __p_.end();
|
||||
double __s = _STD::accumulate(__p_.begin(), __p_.end(), 0.0);
|
||||
for (_STD::vector<double>::iterator __i = __p_.begin(), __e = __p_.end();
|
||||
__i < __e; ++__i)
|
||||
*__i /= __s;
|
||||
vector<double> __t(__p_.size() - 1);
|
||||
_VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
|
||||
_STD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
|
||||
swap(__p_, __t);
|
||||
}
|
||||
else
|
||||
@@ -5873,8 +5864,8 @@ vector<double>
|
||||
discrete_distribution<_IntType>::param_type::probabilities() const
|
||||
{
|
||||
size_t __n = __p_.size();
|
||||
_VSTD::vector<double> __p(__n+1);
|
||||
_VSTD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin());
|
||||
_STD::vector<double> __p(__n+1);
|
||||
_STD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin());
|
||||
if (__n > 0)
|
||||
__p[__n] = 1 - __p_[__n-1];
|
||||
else
|
||||
@@ -5889,7 +5880,7 @@ discrete_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
|
||||
{
|
||||
uniform_real_distribution<double> __gen;
|
||||
return static_cast<_IntType>(
|
||||
_VSTD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
|
||||
_STD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
|
||||
__p.__p_.begin());
|
||||
}
|
||||
|
||||
@@ -5951,10 +5942,8 @@ public:
|
||||
template<class _InputIteratorB, class _InputIteratorW>
|
||||
param_type(_InputIteratorB __fB, _InputIteratorB __lB,
|
||||
_InputIteratorW __fW);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
param_type(size_t __nw, result_type __xmin, result_type __xmax,
|
||||
_UnaryOperation __fw);
|
||||
@@ -6004,13 +5993,11 @@ public:
|
||||
_InputIteratorW __fW)
|
||||
: __p_(__fB, __lB, __fW) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
piecewise_constant_distribution(initializer_list<result_type> __bl,
|
||||
_UnaryOperation __fw)
|
||||
: __p_(__bl, __fw) {}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _UnaryOperation>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -6092,14 +6079,14 @@ void
|
||||
piecewise_constant_distribution<_RealType>::param_type::__init()
|
||||
{
|
||||
// __densities_ contains non-normalized areas
|
||||
result_type __total_area = _VSTD::accumulate(__densities_.begin(),
|
||||
result_type __total_area = _STD::accumulate(__densities_.begin(),
|
||||
__densities_.end(),
|
||||
result_type());
|
||||
for (size_t __i = 0; __i < __densities_.size(); ++__i)
|
||||
__densities_[__i] /= __total_area;
|
||||
// __densities_ contains normalized areas
|
||||
__areas_.assign(__densities_.size(), result_type());
|
||||
_VSTD::partial_sum(__densities_.begin(), __densities_.end() - 1,
|
||||
_STD::partial_sum(__densities_.begin(), __densities_.end() - 1,
|
||||
__areas_.begin() + 1);
|
||||
// __areas_ contains partial sums of normalized areas: [0, __densities_ - 1]
|
||||
__densities_.back() = 1 - __areas_.back(); // correct round off error
|
||||
@@ -6140,8 +6127,6 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _RealType>
|
||||
template<class _UnaryOperation>
|
||||
piecewise_constant_distribution<_RealType>::param_type::param_type(
|
||||
@@ -6165,8 +6150,6 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _RealType>
|
||||
template<class _UnaryOperation>
|
||||
piecewise_constant_distribution<_RealType>::param_type::param_type(
|
||||
@@ -6192,7 +6175,7 @@ piecewise_constant_distribution<_RealType>::operator()(_URNG& __g, const param_t
|
||||
{
|
||||
typedef uniform_real_distribution<result_type> _Gen;
|
||||
result_type __u = _Gen()(__g);
|
||||
ptrdiff_t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
|
||||
ptrdiff_t __k = _STD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
|
||||
__u) - __p.__areas_.begin() - 1;
|
||||
return (__u - __p.__areas_[__k]) / __p.__densities_[__k] + __p.__b_[__k];
|
||||
}
|
||||
@@ -6275,10 +6258,8 @@ public:
|
||||
template<class _InputIteratorB, class _InputIteratorW>
|
||||
param_type(_InputIteratorB __fB, _InputIteratorB __lB,
|
||||
_InputIteratorW __fW);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
param_type(size_t __nw, result_type __xmin, result_type __xmax,
|
||||
_UnaryOperation __fw);
|
||||
@@ -6328,13 +6309,11 @@ public:
|
||||
_InputIteratorW __fW)
|
||||
: __p_(__fB, __lB, __fW) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template<class _UnaryOperation>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
piecewise_linear_distribution(initializer_list<result_type> __bl,
|
||||
_UnaryOperation __fw)
|
||||
: __p_(__bl, __fw) {}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _UnaryOperation>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -6468,8 +6447,6 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _RealType>
|
||||
template<class _UnaryOperation>
|
||||
piecewise_linear_distribution<_RealType>::param_type::param_type(
|
||||
@@ -6493,8 +6470,6 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _RealType>
|
||||
template<class _UnaryOperation>
|
||||
piecewise_linear_distribution<_RealType>::param_type::param_type(
|
||||
@@ -6521,7 +6496,7 @@ piecewise_linear_distribution<_RealType>::operator()(_URNG& __g, const param_typ
|
||||
{
|
||||
typedef uniform_real_distribution<result_type> _Gen;
|
||||
result_type __u = _Gen()(__g);
|
||||
ptrdiff_t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
|
||||
ptrdiff_t __k = _STD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
|
||||
__u) - __p.__areas_.begin() - 1;
|
||||
__u -= __p.__areas_[__k];
|
||||
const result_type __dk = __p.__densities_[__k];
|
||||
@@ -6533,7 +6508,7 @@ piecewise_linear_distribution<_RealType>::operator()(_URNG& __g, const param_typ
|
||||
const result_type __bk1 = __p.__b_[__k+1];
|
||||
const result_type __deltab = __bk1 - __bk;
|
||||
return (__bk * __dk1 - __bk1 * __dk +
|
||||
_VSTD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
|
||||
_STD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
|
||||
__deltad;
|
||||
}
|
||||
|
||||
|
222
include/regex
222
include/regex
@@ -1280,7 +1280,7 @@ class __node
|
||||
__node(const __node&);
|
||||
__node& operator=(const __node&);
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node() {}
|
||||
@@ -1300,7 +1300,7 @@ class __end_state
|
||||
: public __node<_CharT>
|
||||
{
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__end_state() {}
|
||||
@@ -1365,7 +1365,7 @@ class __empty_state
|
||||
typedef __owns_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __empty_state(__node<_CharT>* __s)
|
||||
@@ -1391,7 +1391,7 @@ class __empty_non_own_state
|
||||
typedef __has_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __empty_non_own_state(__node<_CharT>* __s)
|
||||
@@ -1417,7 +1417,7 @@ class __repeat_one_loop
|
||||
typedef __has_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __repeat_one_loop(__node<_CharT>* __s)
|
||||
@@ -1479,7 +1479,7 @@ class __loop
|
||||
bool __greedy_;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __loop(unsigned __loop_id,
|
||||
@@ -1578,7 +1578,7 @@ class __alternate
|
||||
typedef __owns_two_states<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __alternate(__owns_one_state<_CharT>* __s1,
|
||||
@@ -1617,7 +1617,7 @@ class __begin_marked_subexpression
|
||||
|
||||
unsigned __mexp_;
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __begin_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
|
||||
@@ -1645,7 +1645,7 @@ class __end_marked_subexpression
|
||||
|
||||
unsigned __mexp_;
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __end_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
|
||||
@@ -1674,7 +1674,7 @@ class __back_ref
|
||||
|
||||
unsigned __mexp_;
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __back_ref(unsigned __mexp, __node<_CharT>* __s)
|
||||
@@ -1692,7 +1692,7 @@ __back_ref<_CharT>::__exec(__state& __s) const
|
||||
{
|
||||
ptrdiff_t __len = __sm.second - __sm.first;
|
||||
if (__s.__last_ - __s.__current_ >= __len &&
|
||||
_VSTD::equal(__sm.first, __sm.second, __s.__current_))
|
||||
_STD::equal(__sm.first, __sm.second, __s.__current_))
|
||||
{
|
||||
__s.__do_ = __state::__accept_but_not_consume;
|
||||
__s.__current_ += __len;
|
||||
@@ -1722,7 +1722,7 @@ class __back_ref_icase
|
||||
_Traits __traits_;
|
||||
unsigned __mexp_;
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __back_ref_icase(const _Traits& __traits, unsigned __mexp,
|
||||
@@ -1777,7 +1777,7 @@ class __back_ref_collate
|
||||
_Traits __traits_;
|
||||
unsigned __mexp_;
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __back_ref_collate(const _Traits& __traits, unsigned __mexp,
|
||||
@@ -1832,7 +1832,7 @@ class __word_boundary
|
||||
_Traits __traits_;
|
||||
bool __invert_;
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __word_boundary(const _Traits& __traits, bool __invert,
|
||||
@@ -1900,7 +1900,7 @@ class __l_anchor
|
||||
typedef __owns_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__l_anchor(__node<_CharT>* __s)
|
||||
@@ -1934,7 +1934,7 @@ class __r_anchor
|
||||
typedef __owns_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__r_anchor(__node<_CharT>* __s)
|
||||
@@ -1968,7 +1968,7 @@ class __match_any
|
||||
typedef __owns_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_any(__node<_CharT>* __s)
|
||||
@@ -2003,7 +2003,7 @@ class __match_any_but_newline
|
||||
typedef __owns_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_any_but_newline(__node<_CharT>* __s)
|
||||
@@ -2025,7 +2025,7 @@ class __match_char
|
||||
__match_char(const __match_char&);
|
||||
__match_char& operator=(const __match_char&);
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_char(_CharT __c, __node<_CharT>* __s)
|
||||
@@ -2065,7 +2065,7 @@ class __match_char_icase
|
||||
__match_char_icase(const __match_char_icase&);
|
||||
__match_char_icase& operator=(const __match_char_icase&);
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
|
||||
@@ -2106,7 +2106,7 @@ class __match_char_collate
|
||||
__match_char_collate(const __match_char_collate&);
|
||||
__match_char_collate& operator=(const __match_char_collate&);
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
|
||||
@@ -2158,7 +2158,7 @@ class __bracket_expression
|
||||
__bracket_expression(const __bracket_expression&);
|
||||
__bracket_expression& operator=(const __bracket_expression&);
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bracket_expression(const _Traits& __traits, __node<_CharT>* __s,
|
||||
@@ -2226,7 +2226,7 @@ public:
|
||||
__b[0] = __traits_.translate_nocase(__b[0]);
|
||||
__e[0] = __traits_.translate_nocase(__e[0]);
|
||||
}
|
||||
__ranges_.push_back(make_pair(_VSTD::move(__b), _VSTD::move(__e)));
|
||||
__ranges_.push_back(make_pair(_STD::move(__b), _STD::move(__e)));
|
||||
}
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2263,7 +2263,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
|
||||
++__consumed;
|
||||
if (__might_have_digraph_)
|
||||
{
|
||||
const _CharT* __next = _VSTD::next(__s.__current_);
|
||||
const _CharT* __next = _STD::next(__s.__current_);
|
||||
if (__next != __s.__last_)
|
||||
{
|
||||
pair<_CharT, _CharT> __ch2(*__s.__current_, *__next);
|
||||
@@ -2410,7 +2410,7 @@ __exit:
|
||||
}
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits> class __lookahead;
|
||||
template <class, class> class __lookahead;
|
||||
|
||||
template <class _CharT, class _Traits = regex_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_regex
|
||||
@@ -2430,8 +2430,8 @@ private:
|
||||
shared_ptr<__empty_state<_CharT> > __start_;
|
||||
__owns_one_state<_CharT>* __end_;
|
||||
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _VSTD::__node<_CharT> __node;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
typedef _STD::__node<_CharT> __node;
|
||||
|
||||
public:
|
||||
// constants:
|
||||
@@ -2478,14 +2478,12 @@ public:
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0)
|
||||
{__parse(__first, __last);}
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(initializer_list<value_type> __il,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0)
|
||||
{__parse(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
// ~basic_regex() = default;
|
||||
|
||||
@@ -2494,11 +2492,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& operator=(const value_type* __p)
|
||||
{return assign(__p);}
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& operator=(initializer_list<value_type> __il)
|
||||
{return assign(__il);}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template <class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
|
||||
@@ -2561,15 +2557,11 @@ public:
|
||||
__parse(__first, __last);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& assign(initializer_list<value_type> __il,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
{return assign(__il.begin(), __il.end(), __f);}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
// const operations:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unsigned mark_count() const {return __marked_count_;}
|
||||
@@ -2842,7 +2834,7 @@ template <class _CharT, class _Traits>
|
||||
void
|
||||
basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__traits_, __r.__traits_);
|
||||
swap(__flags_, __r.__flags_);
|
||||
swap(__marked_count_, __r.__marked_count_);
|
||||
@@ -2874,7 +2866,7 @@ class __lookahead
|
||||
__lookahead(const __lookahead&);
|
||||
__lookahead& operator=(const __lookahead&);
|
||||
public:
|
||||
typedef _VSTD::__state<_CharT> __state;
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s)
|
||||
@@ -2961,7 +2953,7 @@ basic_regex<_CharT, _Traits>::__parse_basic_reg_exp(_ForwardIterator __first,
|
||||
__first = __parse_RE_expression(__first, __last);
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp == __last && *__first == '$')
|
||||
{
|
||||
__push_r_anchor();
|
||||
@@ -3190,7 +3182,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_open_paren(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == '(')
|
||||
@@ -3208,7 +3200,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_close_paren(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == ')')
|
||||
@@ -3226,7 +3218,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_open_brace(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == '{')
|
||||
@@ -3244,7 +3236,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_close_brace(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == '}')
|
||||
@@ -3262,7 +3254,7 @@ basic_regex<_CharT, _Traits>::__parse_BACKREF(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && '1' <= *__temp && *__temp <= '9')
|
||||
@@ -3283,7 +3275,7 @@ basic_regex<_CharT, _Traits>::__parse_ORD_CHAR(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp == __last && *__first == '$')
|
||||
return __first;
|
||||
// Not called inside a bracket
|
||||
@@ -3341,7 +3333,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\')
|
||||
@@ -3372,7 +3364,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR_ERE(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\')
|
||||
@@ -3682,7 +3674,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last && *__first != ']')
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
basic_string<_CharT> __start_range;
|
||||
if (__temp != __last && *__first == '[')
|
||||
{
|
||||
@@ -3711,7 +3703,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
|
||||
}
|
||||
if (__first != __last && *__first != ']')
|
||||
{
|
||||
__temp = _VSTD::next(__first);
|
||||
__temp = _STD::next(__first);
|
||||
if (__temp != __last && *__first == '-' && *__temp != ']')
|
||||
{
|
||||
// parse a range
|
||||
@@ -3737,7 +3729,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
|
||||
++__first;
|
||||
}
|
||||
}
|
||||
__ml->__add_range(_VSTD::move(__start_range), _VSTD::move(__end_range));
|
||||
__ml->__add_range(_STD::move(__start_range), _STD::move(__end_range));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3898,7 +3890,7 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
|
||||
// Found [=
|
||||
// This means =] must exist
|
||||
value_type _Equal_close[2] = {'=', ']'};
|
||||
_ForwardIterator __temp = _VSTD::search(__first, __last, _Equal_close,
|
||||
_ForwardIterator __temp = _STD::search(__first, __last, _Equal_close,
|
||||
_Equal_close+2);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last)
|
||||
@@ -3933,7 +3925,7 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
}
|
||||
__first = _VSTD::next(__temp, 2);
|
||||
__first = _STD::next(__temp, 2);
|
||||
return __first;
|
||||
}
|
||||
|
||||
@@ -3947,7 +3939,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
|
||||
// Found [:
|
||||
// This means :] must exist
|
||||
value_type _Colon_close[2] = {':', ']'};
|
||||
_ForwardIterator __temp = _VSTD::search(__first, __last, _Colon_close,
|
||||
_ForwardIterator __temp = _STD::search(__first, __last, _Colon_close,
|
||||
_Colon_close+2);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last)
|
||||
@@ -3962,7 +3954,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
|
||||
throw regex_error(regex_constants::error_brack);
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__ml->__add_class(__class_type);
|
||||
__first = _VSTD::next(__temp, 2);
|
||||
__first = _STD::next(__temp, 2);
|
||||
return __first;
|
||||
}
|
||||
|
||||
@@ -3976,7 +3968,7 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
|
||||
// Found [.
|
||||
// This means .] must exist
|
||||
value_type _Dot_close[2] = {'.', ']'};
|
||||
_ForwardIterator __temp = _VSTD::search(__first, __last, _Dot_close,
|
||||
_ForwardIterator __temp = _STD::search(__first, __last, _Dot_close,
|
||||
_Dot_close+2);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last)
|
||||
@@ -3995,7 +3987,7 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
|
||||
throw regex_error(regex_constants::error_collate);
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__first = _VSTD::next(__temp, 2);
|
||||
__first = _STD::next(__temp, 2);
|
||||
return __first;
|
||||
}
|
||||
|
||||
@@ -4099,7 +4091,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
|
||||
break;
|
||||
case '\\':
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__temp == 'b')
|
||||
@@ -4117,7 +4109,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
|
||||
break;
|
||||
case '(':
|
||||
{
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last && *__temp == '?')
|
||||
{
|
||||
if (++__temp != __last)
|
||||
@@ -4129,7 +4121,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
|
||||
basic_regex __exp;
|
||||
__exp.__flags_ = __flags_;
|
||||
__temp = __exp.__parse(++__temp, __last);
|
||||
__push_lookahead(_VSTD::move(__exp), false);
|
||||
__push_lookahead(_STD::move(__exp), false);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last || *__temp != ')')
|
||||
throw regex_error(regex_constants::error_paren);
|
||||
@@ -4142,7 +4134,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
|
||||
basic_regex __exp;
|
||||
__exp.__flags_ = __flags_;
|
||||
__temp = __exp.__parse(++__temp, __last);
|
||||
__push_lookahead(_VSTD::move(__exp), true);
|
||||
__push_lookahead(_STD::move(__exp), true);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last || *__temp != ')')
|
||||
throw regex_error(regex_constants::error_paren);
|
||||
@@ -4187,7 +4179,7 @@ basic_regex<_CharT, _Traits>::__parse_atom(_ForwardIterator __first,
|
||||
if (__first == __last)
|
||||
throw regex_error(regex_constants::error_paren);
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
_ForwardIterator __temp = _VSTD::next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last && *__first == '?' && *__temp == ':')
|
||||
{
|
||||
++__open_count_;
|
||||
@@ -4231,7 +4223,7 @@ basic_regex<_CharT, _Traits>::__parse_atom_escape(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last && *__first == '\\')
|
||||
{
|
||||
_ForwardIterator __t1 = _VSTD::next(__first);
|
||||
_ForwardIterator __t1 = _STD::next(__first);
|
||||
_ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
|
||||
if (__t2 != __t1)
|
||||
__first = __t2;
|
||||
@@ -4377,7 +4369,7 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first,
|
||||
++__first;
|
||||
break;
|
||||
case 'c':
|
||||
if ((__t = _VSTD::next(__first)) != __last)
|
||||
if ((__t = _STD::next(__first)) != __last)
|
||||
{
|
||||
if ('A' <= *__t <= 'Z' || 'a' <= *__t <= 'z')
|
||||
{
|
||||
@@ -4502,7 +4494,7 @@ basic_regex<_CharT, _Traits>::__parse_grep(_ForwardIterator __first,
|
||||
_ForwardIterator __last)
|
||||
{
|
||||
__owns_one_state<_CharT>* __sa = __end_;
|
||||
_ForwardIterator __t1 = _VSTD::find(__first, __last, _CharT('\n'));
|
||||
_ForwardIterator __t1 = _STD::find(__first, __last, _CharT('\n'));
|
||||
if (__t1 != __first)
|
||||
__parse_basic_reg_exp(__first, __t1);
|
||||
else
|
||||
@@ -4512,7 +4504,7 @@ basic_regex<_CharT, _Traits>::__parse_grep(_ForwardIterator __first,
|
||||
++__first;
|
||||
while (__first != __last)
|
||||
{
|
||||
__t1 = _VSTD::find(__first, __last, _CharT('\n'));
|
||||
__t1 = _STD::find(__first, __last, _CharT('\n'));
|
||||
__owns_one_state<_CharT>* __sb = __end_;
|
||||
if (__t1 != __first)
|
||||
__parse_basic_reg_exp(__first, __t1);
|
||||
@@ -4533,7 +4525,7 @@ basic_regex<_CharT, _Traits>::__parse_egrep(_ForwardIterator __first,
|
||||
_ForwardIterator __last)
|
||||
{
|
||||
__owns_one_state<_CharT>* __sa = __end_;
|
||||
_ForwardIterator __t1 = _VSTD::find(__first, __last, _CharT('\n'));
|
||||
_ForwardIterator __t1 = _STD::find(__first, __last, _CharT('\n'));
|
||||
if (__t1 != __first)
|
||||
__parse_extended_reg_exp(__first, __t1);
|
||||
else
|
||||
@@ -4543,7 +4535,7 @@ basic_regex<_CharT, _Traits>::__parse_egrep(_ForwardIterator __first,
|
||||
++__first;
|
||||
while (__first != __last)
|
||||
{
|
||||
__t1 = _VSTD::find(__first, __last, _CharT('\n'));
|
||||
__t1 = _STD::find(__first, __last, _CharT('\n'));
|
||||
__owns_one_state<_CharT>* __sb = __end_;
|
||||
if (__t1 != __first)
|
||||
__parse_extended_reg_exp(__first, __t1);
|
||||
@@ -4740,7 +4732,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
difference_type length() const
|
||||
{return matched ? _VSTD::distance(this->first, this->second) : 0;}
|
||||
{return matched ? _STD::distance(this->first, this->second) : 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type str() const
|
||||
{return matched ? string_type(this->first, this->second) : string_type();}
|
||||
@@ -5196,7 +5188,7 @@ public:
|
||||
{return (*this)[__sub].length();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
difference_type position(size_type __sub = 0) const
|
||||
{return _VSTD::distance(__position_start_, (*this)[__sub].first);}
|
||||
{return _STD::distance(__position_start_, (*this)[__sub].first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type str(size_type __sub = 0) const
|
||||
{return (*this)[__sub].str();}
|
||||
@@ -5210,11 +5202,11 @@ public:
|
||||
const_reference suffix() const {return __suffix_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return empty() ? __matches_.end() : __matches_.begin();}
|
||||
const_iterator begin() const {return empty() ? __matches_.end() : __matches_.begin() + 1;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __matches_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return empty() ? __matches_.end() : __matches_.begin();}
|
||||
const_iterator cbegin() const {return empty() ? __matches_.end() : __matches_.begin() + 1;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __matches_.end();}
|
||||
|
||||
@@ -5268,18 +5260,18 @@ public:
|
||||
__matches_.resize(__m.size());
|
||||
for (size_type __i = 0; __i < __matches_.size(); ++__i)
|
||||
{
|
||||
__matches_[__i].first = _VSTD::next(__f, _VSTD::distance(__mf, __m[__i].first));
|
||||
__matches_[__i].second = _VSTD::next(__f, _VSTD::distance(__mf, __m[__i].second));
|
||||
__matches_[__i].first = _STD::next(__f, _STD::distance(__mf, __m[__i].first));
|
||||
__matches_[__i].second = _STD::next(__f, _STD::distance(__mf, __m[__i].second));
|
||||
__matches_[__i].matched = __m[__i].matched;
|
||||
}
|
||||
__unmatched_.first = __l;
|
||||
__unmatched_.second = __l;
|
||||
__unmatched_.matched = false;
|
||||
__prefix_.first = _VSTD::next(__f, _VSTD::distance(__mf, __m.prefix().first));
|
||||
__prefix_.second = _VSTD::next(__f, _VSTD::distance(__mf, __m.prefix().second));
|
||||
__prefix_.first = _STD::next(__f, _STD::distance(__mf, __m.prefix().first));
|
||||
__prefix_.second = _STD::next(__f, _STD::distance(__mf, __m.prefix().second));
|
||||
__prefix_.matched = __m.prefix().matched;
|
||||
__suffix_.first = _VSTD::next(__f, _VSTD::distance(__mf, __m.suffix().first));
|
||||
__suffix_.second = _VSTD::next(__f, _VSTD::distance(__mf, __m.suffix().second));
|
||||
__suffix_.first = _STD::next(__f, _STD::distance(__mf, __m.suffix().first));
|
||||
__suffix_.second = _STD::next(__f, _STD::distance(__mf, __m.suffix().second));
|
||||
__suffix_.matched = __m.suffix().matched;
|
||||
if (!__no_update_pos)
|
||||
__position_start_ = __prefix_.first;
|
||||
@@ -5350,7 +5342,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
|
||||
for (; __fmt_first != __fmt_last; ++__fmt_first)
|
||||
{
|
||||
if (*__fmt_first == '&')
|
||||
__out = _VSTD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__out = _STD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__out);
|
||||
else if (*__fmt_first == '\\' && __fmt_first + 1 != __fmt_last)
|
||||
{
|
||||
@@ -5358,7 +5350,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
|
||||
if ('0' <= *__fmt_first && *__fmt_first <= '9')
|
||||
{
|
||||
size_t __i = *__fmt_first - '0';
|
||||
__out = _VSTD::copy(__matches_[__i].first,
|
||||
__out = _STD::copy(__matches_[__i].first,
|
||||
__matches_[__i].second, __out);
|
||||
}
|
||||
else
|
||||
@@ -5388,16 +5380,16 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
|
||||
break;
|
||||
case '&':
|
||||
++__fmt_first;
|
||||
__out = _VSTD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__out = _STD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__out);
|
||||
break;
|
||||
case '`':
|
||||
++__fmt_first;
|
||||
__out = _VSTD::copy(__prefix_.first, __prefix_.second, __out);
|
||||
__out = _STD::copy(__prefix_.first, __prefix_.second, __out);
|
||||
break;
|
||||
case '\'':
|
||||
++__fmt_first;
|
||||
__out = _VSTD::copy(__suffix_.first, __suffix_.second, __out);
|
||||
__out = _STD::copy(__suffix_.first, __suffix_.second, __out);
|
||||
break;
|
||||
default:
|
||||
if ('0' <= __fmt_first[1] && __fmt_first[1] <= '9')
|
||||
@@ -5410,7 +5402,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
|
||||
++__fmt_first;
|
||||
__i = 10 * __i + *__fmt_first - '0';
|
||||
}
|
||||
__out = _VSTD::copy(__matches_[__i].first,
|
||||
__out = _STD::copy(__matches_[__i].first,
|
||||
__matches_[__i].second, __out);
|
||||
}
|
||||
else
|
||||
@@ -5435,7 +5427,7 @@ template <class _BidirectionalIterator, class _Allocator>
|
||||
void
|
||||
match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__matches_, __m.__matches_);
|
||||
swap(__unmatched_, __m.__unmatched_);
|
||||
swap(__prefix_, __m.__prefix_);
|
||||
@@ -5493,7 +5485,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
|
||||
{
|
||||
vector<__state> __states;
|
||||
ptrdiff_t __j = 0;
|
||||
ptrdiff_t _N = _VSTD::distance(__first, __last);
|
||||
ptrdiff_t _N = _STD::distance(__first, __last);
|
||||
__node* __st = __start_.get();
|
||||
if (__st)
|
||||
{
|
||||
@@ -5517,7 +5509,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
|
||||
{
|
||||
case __state::__end_state:
|
||||
__m.__matches_[0].first = __first;
|
||||
__m.__matches_[0].second = _VSTD::next(__first, __s.__current_ - __first);
|
||||
__m.__matches_[0].second = _STD::next(__first, __s.__current_ - __first);
|
||||
__m.__matches_[0].matched = true;
|
||||
for (unsigned __i = 0; __i < __s.__sub_matches_.size(); ++__i)
|
||||
__m.__matches_[__i+1] = __s.__sub_matches_[__i];
|
||||
@@ -5531,7 +5523,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
|
||||
__state __snext = __s;
|
||||
__s.__node_->__exec_split(true, __s);
|
||||
__snext.__node_->__exec_split(false, __snext);
|
||||
__states.push_back(_VSTD::move(__snext));
|
||||
__states.push_back(_STD::move(__snext));
|
||||
}
|
||||
break;
|
||||
case __state::__reject:
|
||||
@@ -5559,7 +5551,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
{
|
||||
deque<__state> __states;
|
||||
ptrdiff_t __highest_j = 0;
|
||||
ptrdiff_t _N = _VSTD::distance(__first, __last);
|
||||
ptrdiff_t _N = _STD::distance(__first, __last);
|
||||
__node* __st = __start_.get();
|
||||
if (__st)
|
||||
{
|
||||
@@ -5592,7 +5584,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
case __state::__consume_input:
|
||||
break;
|
||||
case __state::__accept_and_consume:
|
||||
__states.push_front(_VSTD::move(__s));
|
||||
__states.push_front(_STD::move(__s));
|
||||
__states.pop_back();
|
||||
break;
|
||||
case __state::__repeat:
|
||||
@@ -5603,7 +5595,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
__state __snext = __s;
|
||||
__s.__node_->__exec_split(true, __s);
|
||||
__snext.__node_->__exec_split(false, __snext);
|
||||
__states.push_back(_VSTD::move(__snext));
|
||||
__states.push_back(_STD::move(__snext));
|
||||
}
|
||||
break;
|
||||
case __state::__reject:
|
||||
@@ -5619,7 +5611,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
if (__matched)
|
||||
{
|
||||
__m.__matches_[0].first = __first;
|
||||
__m.__matches_[0].second = _VSTD::next(__first, __highest_j);
|
||||
__m.__matches_[0].second = _STD::next(__first, __highest_j);
|
||||
__m.__matches_[0].matched = true;
|
||||
return true;
|
||||
}
|
||||
@@ -5639,7 +5631,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
|
||||
__state __best_state;
|
||||
ptrdiff_t __j = 0;
|
||||
ptrdiff_t __highest_j = 0;
|
||||
ptrdiff_t _N = _VSTD::distance(__first, __last);
|
||||
ptrdiff_t _N = _STD::distance(__first, __last);
|
||||
__node* __st = __start_.get();
|
||||
if (__st)
|
||||
{
|
||||
@@ -5686,7 +5678,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
|
||||
__state __snext = __s;
|
||||
__s.__node_->__exec_split(true, __s);
|
||||
__snext.__node_->__exec_split(false, __snext);
|
||||
__states.push_back(_VSTD::move(__snext));
|
||||
__states.push_back(_STD::move(__snext));
|
||||
}
|
||||
break;
|
||||
case __state::__reject:
|
||||
@@ -5702,7 +5694,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
|
||||
if (__matched)
|
||||
{
|
||||
__m.__matches_[0].first = __first;
|
||||
__m.__matches_[0].second = _VSTD::next(__first, __highest_j);
|
||||
__m.__matches_[0].second = _STD::next(__first, __highest_j);
|
||||
__m.__matches_[0].matched = true;
|
||||
for (unsigned __i = 0; __i < __best_state.__sub_matches_.size(); ++__i)
|
||||
__m.__matches_[__i+1] = __best_state.__sub_matches_[__i];
|
||||
@@ -5832,7 +5824,7 @@ regex_search(const _CharT* __str, const basic_regex<_CharT, _Traits>& __e,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
match_results<const _CharT*> __m;
|
||||
return _VSTD::regex_search(__str, __m, __e, __flags);
|
||||
return _STD::regex_search(__str, __m, __e, __flags);
|
||||
}
|
||||
|
||||
template <class _ST, class _SA, class _CharT, class _Traits>
|
||||
@@ -5869,7 +5861,7 @@ regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
|
||||
const basic_regex<_CharT, _Traits>& __e,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
bool __r = _VSTD::regex_search(__first, __last, __m, __e,
|
||||
bool __r = _STD::regex_search(__first, __last, __m, __e,
|
||||
__flags | regex_constants::match_continuous);
|
||||
if (__r)
|
||||
{
|
||||
@@ -5888,7 +5880,7 @@ regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
match_results<_BidirectionalIterator> __m;
|
||||
return _VSTD::regex_match(__first, __last, __m, __e, __flags);
|
||||
return _STD::regex_match(__first, __last, __m, __e, __flags);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Allocator, class _Traits>
|
||||
@@ -5898,7 +5890,7 @@ regex_match(const _CharT* __str, match_results<const _CharT*, _Allocator>& __m,
|
||||
const basic_regex<_CharT, _Traits>& __e,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
return _VSTD::regex_match(__str, __str + _Traits::length(__str), __m, __e, __flags);
|
||||
return _STD::regex_match(__str, __str + _Traits::length(__str), __m, __e, __flags);
|
||||
}
|
||||
|
||||
template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
|
||||
@@ -5909,7 +5901,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
|
||||
const basic_regex<_CharT, _Traits>& __e,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
return _VSTD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
|
||||
return _STD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -5918,7 +5910,7 @@ bool
|
||||
regex_match(const _CharT* __str, const basic_regex<_CharT, _Traits>& __e,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
return _VSTD::regex_match(__str, __str + _Traits::length(__str), __e, __flags);
|
||||
return _STD::regex_match(__str, __str + _Traits::length(__str), __e, __flags);
|
||||
}
|
||||
|
||||
template <class _ST, class _SA, class _CharT, class _Traits>
|
||||
@@ -5928,7 +5920,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
|
||||
const basic_regex<_CharT, _Traits>& __e,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
return _VSTD::regex_match(__s.begin(), __s.end(), __e, __flags);
|
||||
return _STD::regex_match(__s.begin(), __s.end(), __e, __flags);
|
||||
}
|
||||
|
||||
// regex_iterator
|
||||
@@ -5993,7 +5985,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
||||
__pregex_(&__re),
|
||||
__flags_(__m)
|
||||
{
|
||||
_VSTD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_);
|
||||
_STD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_);
|
||||
}
|
||||
|
||||
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
||||
@@ -6025,7 +6017,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
|
||||
__match_ = value_type();
|
||||
return *this;
|
||||
}
|
||||
else if (_VSTD::regex_search(__start, __end_, __match_, *__pregex_,
|
||||
else if (_STD::regex_search(__start, __end_, __match_, *__pregex_,
|
||||
__flags_ | regex_constants::match_not_null |
|
||||
regex_constants::match_continuous))
|
||||
return *this;
|
||||
@@ -6033,7 +6025,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
|
||||
++__start;
|
||||
}
|
||||
__flags_ |= regex_constants::match_prev_avail;
|
||||
if (!_VSTD::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
|
||||
if (!_STD::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
|
||||
__match_ = value_type();
|
||||
return *this;
|
||||
}
|
||||
@@ -6077,13 +6069,11 @@ public:
|
||||
const regex_type& __re, const vector<int>& __submatches,
|
||||
regex_constants::match_flag_type __m =
|
||||
regex_constants::match_default);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
|
||||
const regex_type& __re,
|
||||
initializer_list<int> __submatches,
|
||||
regex_constants::match_flag_type __m =
|
||||
regex_constants::match_default);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
template <size_t _N>
|
||||
regex_token_iterator(_BidirectionalIterator __a,
|
||||
_BidirectionalIterator __b,
|
||||
@@ -6172,8 +6162,6 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
||||
__init(__a, __b);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
||||
regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
||||
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
|
||||
@@ -6187,8 +6175,6 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
||||
__init(__a, __b);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
||||
template <size_t _N>
|
||||
regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
||||
@@ -6281,7 +6267,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_VSTD::find(__subs_.begin(), __subs_.end(), -1) != __subs_.end()
|
||||
if (_STD::find(__subs_.begin(), __subs_.end(), -1) != __subs_.end()
|
||||
&& __prev->suffix().length() != 0)
|
||||
{
|
||||
__suffix_.matched = true;
|
||||
@@ -6317,7 +6303,7 @@ regex_replace(_OutputIterator __out,
|
||||
if (__i == __eof)
|
||||
{
|
||||
if (!(__flags & regex_constants::format_no_copy))
|
||||
__out = _VSTD::copy(__first, __last, __out);
|
||||
__out = _STD::copy(__first, __last, __out);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6325,14 +6311,14 @@ regex_replace(_OutputIterator __out,
|
||||
for (size_t __len = char_traits<_CharT>::length(__fmt); __i != __eof; ++__i)
|
||||
{
|
||||
if (!(__flags & regex_constants::format_no_copy))
|
||||
__out = _VSTD::copy(__i->prefix().first, __i->prefix().second, __out);
|
||||
__out = _STD::copy(__i->prefix().first, __i->prefix().second, __out);
|
||||
__out = __i->format(__out, __fmt, __fmt + __len, __flags);
|
||||
__lm = __i->suffix();
|
||||
if (__flags & regex_constants::format_first_only)
|
||||
break;
|
||||
}
|
||||
if (!(__flags & regex_constants::format_no_copy))
|
||||
__out = _VSTD::copy(__lm.first, __lm.second, __out);
|
||||
__out = _STD::copy(__lm.first, __lm.second, __out);
|
||||
}
|
||||
return __out;
|
||||
}
|
||||
@@ -6347,7 +6333,7 @@ regex_replace(_OutputIterator __out,
|
||||
const basic_string<_CharT, _ST, _SA>& __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
return _VSTD::regex_replace(__out, __first, __last, __e, __fmt.c_str(), __flags);
|
||||
return _STD::regex_replace(__out, __first, __last, __e, __fmt.c_str(), __flags);
|
||||
}
|
||||
|
||||
template <class _Traits, class _CharT, class _ST, class _SA, class _FST,
|
||||
@@ -6360,7 +6346,7 @@ regex_replace(const basic_string<_CharT, _ST, _SA>& __s,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
basic_string<_CharT, _ST, _SA> __r;
|
||||
_VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
|
||||
_STD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
|
||||
__fmt.c_str(), __flags);
|
||||
return __r;
|
||||
}
|
||||
@@ -6373,7 +6359,7 @@ regex_replace(const basic_string<_CharT, _ST, _SA>& __s,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
basic_string<_CharT, _ST, _SA> __r;
|
||||
_VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
|
||||
_STD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
|
||||
__fmt, __flags);
|
||||
return __r;
|
||||
}
|
||||
@@ -6387,7 +6373,7 @@ regex_replace(const _CharT* __s,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
basic_string<_CharT> __r;
|
||||
_VSTD::regex_replace(back_inserter(__r), __s,
|
||||
_STD::regex_replace(back_inserter(__r), __s,
|
||||
__s + char_traits<_CharT>::length(__s), __e,
|
||||
__fmt.c_str(), __flags);
|
||||
return __r;
|
||||
@@ -6402,7 +6388,7 @@ regex_replace(const _CharT* __s,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
basic_string<_CharT> __r;
|
||||
_VSTD::regex_replace(back_inserter(__r), __s,
|
||||
_STD::regex_replace(back_inserter(__r), __s,
|
||||
__s + char_traits<_CharT>::length(__s), __e,
|
||||
__fmt, __flags);
|
||||
return __r;
|
||||
|
@@ -194,7 +194,7 @@ protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)),
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)),
|
||||
__inner_(__innerAllocs...) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
@@ -214,8 +214,8 @@ protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::move(__other.outer_allocator())),
|
||||
__inner_(_VSTD::move(__other.inner_allocator())) {}
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())),
|
||||
__inner_(_STD::move(__other.inner_allocator())) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
@@ -224,7 +224,7 @@ protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::forward<_OuterA2>(__o)),
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__o)),
|
||||
__inner_(__i)
|
||||
{
|
||||
}
|
||||
@@ -274,7 +274,7 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)) {}
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
@@ -292,7 +292,7 @@ protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2>&& __other) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::move(__other.outer_allocator())) {}
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT
|
||||
@@ -354,7 +354,7 @@ struct __outermost<_Alloc, true>
|
||||
{
|
||||
typedef typename remove_reference
|
||||
<
|
||||
decltype(_VSTD::declval<_Alloc>().outer_allocator())
|
||||
decltype(_STD::declval<_Alloc>().outer_allocator())
|
||||
>::type _OuterAlloc;
|
||||
typedef typename __outermost<_OuterAlloc>::type type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -414,7 +414,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
|
||||
: base(_VSTD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
|
||||
: base(_STD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
|
||||
// scoped_allocator_adaptor(const scoped_allocator_adaptor& __other) = default;
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
|
||||
: base(_VSTD::move(__other)) {}
|
||||
: base(_STD::move(__other)) {}
|
||||
|
||||
// ~scoped_allocator_adaptor() = default;
|
||||
|
||||
@@ -471,7 +471,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void construct(_Tp* __p, _Args&& ...__args)
|
||||
{__construct(__uses_alloc_ctor<_Tp, inner_allocator_type, _Args...>(),
|
||||
__p, _VSTD::forward<_Args>(__args)...);}
|
||||
__p, _STD::forward<_Args>(__args)...);}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void destroy(_Tp* __p)
|
||||
@@ -494,7 +494,7 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i) _NOEXCEPT
|
||||
: base(_VSTD::forward<_OuterA2>(__o), __i) {}
|
||||
: base(_STD::forward<_OuterA2>(__o), __i) {}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -505,7 +505,7 @@ private:
|
||||
(
|
||||
_OM()(outer_allocator()),
|
||||
__p,
|
||||
_VSTD::forward<_Args>(__args)...
|
||||
_STD::forward<_Args>(__args)...
|
||||
);
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ private:
|
||||
__p,
|
||||
allocator_arg,
|
||||
inner_allocator(),
|
||||
_VSTD::forward<_Args>(__args)...
|
||||
_STD::forward<_Args>(__args)...
|
||||
);
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ private:
|
||||
(
|
||||
_OM()(outer_allocator()),
|
||||
__p,
|
||||
_VSTD::forward<_Args>(__args)...,
|
||||
_STD::forward<_Args>(__args)...,
|
||||
inner_allocator()
|
||||
);
|
||||
}
|
||||
|
70
include/set
70
include/set
@@ -370,8 +370,8 @@ public:
|
||||
typedef typename __base::difference_type difference_type;
|
||||
typedef typename __base::const_iterator iterator;
|
||||
typedef typename __base::const_iterator const_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit set(const value_compare& __comp = value_compare())
|
||||
@@ -408,18 +408,11 @@ public:
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set& operator=(const set& __s)
|
||||
{
|
||||
__tree_ = __s.__tree_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(set&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_VSTD::move(__s.__tree_)) {}
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -437,7 +430,6 @@ public:
|
||||
set(set&& __s, const allocator_type& __a);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
@@ -459,14 +451,13 @@ public:
|
||||
__tree_.__assign_unique(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set& operator=(set&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _VSTD::move(__s.__tree_);
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -514,11 +505,11 @@ public:
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_Args&&... __args)
|
||||
{return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
|
||||
{return __tree_.__emplace_unique(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
|
||||
{return __tree_.__emplace_hint_unique(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator,bool> insert(const value_type& __v)
|
||||
@@ -526,7 +517,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator,bool> insert(value_type&& __v)
|
||||
{return __tree_.__insert_unique(_VSTD::move(__v));}
|
||||
{return __tree_.__insert_unique(_STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, const value_type& __v)
|
||||
@@ -534,7 +525,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, value_type&& __v)
|
||||
{return __tree_.__insert_unique(__p, _VSTD::move(__v));}
|
||||
{return __tree_.__insert_unique(__p, _STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -544,11 +535,9 @@ public:
|
||||
__tree_.__insert_unique(__e, *__f);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
|
||||
@@ -604,13 +593,13 @@ public:
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
|
||||
: __tree_(_VSTD::move(__s.__tree_), __a)
|
||||
: __tree_(_STD::move(__s.__tree_), __a)
|
||||
{
|
||||
if (__a != __s.get_allocator())
|
||||
{
|
||||
const_iterator __e = cend();
|
||||
while (!__s.empty())
|
||||
insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
insert(__e, _STD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,7 +611,7 @@ bool
|
||||
operator==(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
@@ -631,7 +620,7 @@ bool
|
||||
operator< (const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
@@ -709,8 +698,8 @@ public:
|
||||
typedef typename __base::difference_type difference_type;
|
||||
typedef typename __base::const_iterator iterator;
|
||||
typedef typename __base::const_iterator const_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -749,18 +738,11 @@ public:
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset& operator=(const multiset& __s)
|
||||
{
|
||||
__tree_ = __s.__tree_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(multiset&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_VSTD::move(__s.__tree_)) {}
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multiset(const allocator_type& __a)
|
||||
@@ -775,7 +757,6 @@ public:
|
||||
multiset(multiset&& __s, const allocator_type& __a);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
@@ -797,14 +778,13 @@ public:
|
||||
__tree_.__assign_multi(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset& operator=(multiset&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _VSTD::move(__s.__tree_);
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -852,11 +832,11 @@ public:
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_Args&&... __args)
|
||||
{return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
|
||||
{return __tree_.__emplace_multi(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
|
||||
{return __tree_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __v)
|
||||
@@ -864,7 +844,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(value_type&& __v)
|
||||
{return __tree_.__insert_multi(_VSTD::move(__v));}
|
||||
{return __tree_.__insert_multi(_STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, const value_type& __v)
|
||||
@@ -872,7 +852,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, value_type&& __v)
|
||||
{return __tree_.__insert_multi(_VSTD::move(__v));}
|
||||
{return __tree_.__insert_multi(_STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -882,11 +862,9 @@ public:
|
||||
__tree_.__insert_multi(__e, *__f);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
|
||||
@@ -942,13 +920,13 @@ public:
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
|
||||
: __tree_(_VSTD::move(__s.__tree_), __a)
|
||||
: __tree_(_STD::move(__s.__tree_), __a)
|
||||
{
|
||||
if (__a != __s.get_allocator())
|
||||
{
|
||||
const_iterator __e = cend();
|
||||
while (!__s.empty())
|
||||
insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
insert(__e, _STD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -960,7 +938,7 @@ bool
|
||||
operator==(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
@@ -969,7 +947,7 @@ bool
|
||||
operator< (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
|
@@ -261,7 +261,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&&
|
||||
ptrdiff_t __nout = __rhs.pptr() - __rhs.pbase();
|
||||
ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
|
||||
ptrdiff_t __hm = __rhs.__hm_ - __rhs.pbase();
|
||||
__str_ = _VSTD::move(__rhs.__str_);
|
||||
__str_ = _STD::move(__rhs.__str_);
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setg(__p, __p + __ninp, __p + __einp);
|
||||
this->setp(__p, __p + __eout);
|
||||
@@ -284,7 +284,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
||||
ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
|
||||
ptrdiff_t __hm = __rhs.__hm_ - __rhs.pbase();
|
||||
__mode_ = __rhs.__mode_;
|
||||
__str_ = _VSTD::move(__rhs.__str_);
|
||||
__str_ = _STD::move(__rhs.__str_);
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setg(__p, __p + __ninp, __p + __einp);
|
||||
this->setp(__p, __p + __eout);
|
||||
@@ -314,7 +314,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
|
||||
ptrdiff_t __lnout = this->pptr() - this->pbase();
|
||||
ptrdiff_t __leout = this->epptr() - this->pbase();
|
||||
ptrdiff_t __lhm = this->__hm_ - this->pbase();
|
||||
_VSTD::swap(__mode_, __rhs.__mode_);
|
||||
_STD::swap(__mode_, __rhs.__mode_);
|
||||
__str_.swap(__rhs.__str_);
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setg(__p, __p + __rninp, __p + __reinp);
|
||||
@@ -451,7 +451,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__hm_ = _VSTD::max(this->pptr() + 1, __hm_);
|
||||
__hm_ = _STD::max(this->pptr() + 1, __hm_);
|
||||
if (__mode_ & ios_base::in)
|
||||
{
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
@@ -582,8 +582,8 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const stri
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
|
||||
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_istream<_CharT, _Traits>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -592,8 +592,8 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_istringstream<_CharT, _Traits, _Allocator>&
|
||||
basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs)
|
||||
{
|
||||
basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_istream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -701,8 +701,8 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const stri
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
|
||||
: basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_ostream<_CharT, _Traits>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -711,8 +711,8 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_ostringstream<_CharT, _Traits, _Allocator>&
|
||||
basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs)
|
||||
{
|
||||
basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_ostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -820,8 +820,8 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
|
||||
: basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_iostream<_CharT, _Traits>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -830,8 +830,8 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_stringstream<_CharT, _Traits, _Allocator>&
|
||||
basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& __rhs)
|
||||
{
|
||||
basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_iostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -125,7 +125,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
|
||||
: c(_VSTD::move(__q.c)) {}
|
||||
: c(_STD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -135,14 +135,14 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack& operator=(stack&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
|
||||
{c = _VSTD::move(__q.c); return *this;}
|
||||
{c = _STD::move(__q.c); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit stack(const container_type& __c) : c(__c) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
|
||||
explicit stack(container_type&& __c) : c(_STD::move(__c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -168,13 +168,13 @@ public:
|
||||
stack(container_type&& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__c), __a) {}
|
||||
: c(_STD::move(__c), __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __s, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__s.c), __a) {}
|
||||
: c(_STD::move(__s.c), __a) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -190,12 +190,12 @@ public:
|
||||
void push(const value_type& __v) {c.push_back(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
|
||||
void push(value_type&& __v) {c.push_back(_STD::move(__v));}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_VSTD::forward<_Args>(__args)...);}
|
||||
{c.emplace_back(_STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
void swap(stack& __s)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(c, __s.c);
|
||||
}
|
||||
|
||||
|
@@ -399,13 +399,13 @@ template <class _CharT, class _Traits>
|
||||
void
|
||||
basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
|
||||
{
|
||||
_VSTD::swap(__loc_, __sb.__loc_);
|
||||
_VSTD::swap(__binp_, __sb.__binp_);
|
||||
_VSTD::swap(__ninp_, __sb.__ninp_);
|
||||
_VSTD::swap(__einp_, __sb.__einp_);
|
||||
_VSTD::swap(__bout_, __sb.__bout_);
|
||||
_VSTD::swap(__nout_, __sb.__nout_);
|
||||
_VSTD::swap(__eout_, __sb.__eout_);
|
||||
_STD::swap(__loc_, __sb.__loc_);
|
||||
_STD::swap(__binp_, __sb.__binp_);
|
||||
_STD::swap(__ninp_, __sb.__ninp_);
|
||||
_STD::swap(__einp_, __sb.__einp_);
|
||||
_STD::swap(__bout_, __sb.__bout_);
|
||||
_STD::swap(__nout_, __sb.__nout_);
|
||||
_STD::swap(__eout_, __sb.__eout_);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
|
348
include/string
348
include/string
@@ -972,24 +972,23 @@ char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a)
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x,
|
||||
const basic_string<_CharT, _Traits, _Allocator>& __y);
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y);
|
||||
operator+(const _CharT*, const basic_string<_CharT,_Traits,_Allocator>&);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y);
|
||||
operator+(_CharT, const basic_string<_CharT,_Traits,_Allocator>&);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y);
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>&, const _CharT*);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>&, _CharT);
|
||||
|
||||
template <bool>
|
||||
class __basic_string_common
|
||||
@@ -1052,8 +1051,8 @@ public:
|
||||
typedef __wrap_iter<pointer> iterator;
|
||||
typedef __wrap_iter<const_pointer> const_iterator;
|
||||
#endif // defined(_LIBCPP_RAW_ITERATORS)
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
private:
|
||||
struct __long
|
||||
@@ -1150,12 +1149,10 @@ public:
|
||||
template<class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(initializer_list<value_type> __il);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
~basic_string();
|
||||
|
||||
@@ -1168,10 +1165,8 @@ public:
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const_pointer __s) {return assign(__s);}
|
||||
basic_string& operator=(value_type __c);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_DEBUG
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1244,9 +1239,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);}
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const_pointer __s) {return append(__s);}
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& append(const basic_string& __str);
|
||||
@@ -1269,10 +1262,8 @@ public:
|
||||
basic_string&
|
||||
>::type
|
||||
append(_ForwardIterator __first, _ForwardIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
void push_back(value_type __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1287,7 +1278,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& assign(basic_string&& str)
|
||||
{*this = _VSTD::move(str); return *this;}
|
||||
{*this = _STD::move(str); return *this;}
|
||||
#endif
|
||||
basic_string& assign(const basic_string& __str, size_type __pos, size_type __n);
|
||||
basic_string& assign(const_pointer __s, size_type __n);
|
||||
@@ -1308,10 +1299,8 @@ public:
|
||||
basic_string&
|
||||
>::type
|
||||
assign(_ForwardIterator __first, _ForwardIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& insert(size_type __pos1, const basic_string& __str);
|
||||
@@ -1337,11 +1326,9 @@ public:
|
||||
iterator
|
||||
>::type
|
||||
insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __pos, initializer_list<value_type> __il)
|
||||
{return insert(__pos, __il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
basic_string& erase(size_type __pos = 0, size_type __n = npos);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1370,11 +1357,9 @@ public:
|
||||
basic_string&
|
||||
>::type
|
||||
replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
|
||||
{return replace(__i1, __i2, __il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
size_type copy(pointer __s, size_type __n, size_type __pos = 0) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1591,27 +1576,6 @@ private:
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__move_assign_alloc(basic_string& __str)
|
||||
_NOEXCEPT_(
|
||||
!__alloc_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{__move_assign_alloc(__str, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_move_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(basic_string& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _VSTD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(basic_string& __c, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
@@ -1623,7 +1587,7 @@ private:
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1825,7 +1789,7 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __r_(_VSTD::move(__str.__r_))
|
||||
: __r_(_STD::move(__str.__r_))
|
||||
{
|
||||
__str.__zero();
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
@@ -1897,7 +1861,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
|
||||
size_type __str_sz = __str.size();
|
||||
if (__pos > __str_sz)
|
||||
this->__throw_out_of_range();
|
||||
__init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));
|
||||
__init(__str.data() + __pos, _STD::min(__n, __str_sz - __pos));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@@ -1937,7 +1901,7 @@ typename enable_if
|
||||
>::type
|
||||
basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
size_type __sz = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
size_type __sz = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
if (__sz > max_size())
|
||||
this->__throw_length_error();
|
||||
pointer __p;
|
||||
@@ -1977,8 +1941,6 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
|
||||
__init(__first, __last);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_type> __il)
|
||||
@@ -1994,8 +1956,6 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_t
|
||||
__init(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>::~basic_string()
|
||||
{
|
||||
@@ -2015,7 +1975,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace
|
||||
this->__throw_length_error();
|
||||
pointer __old_p = __get_pointer();
|
||||
size_type __cap = __old_cap < __ms / 2 - __alignment ?
|
||||
__recommend(_VSTD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
|
||||
__recommend(_STD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
|
||||
__ms - 1;
|
||||
pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);
|
||||
__invalidate_all_iterators();
|
||||
@@ -2045,7 +2005,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_t
|
||||
this->__throw_length_error();
|
||||
pointer __old_p = __get_pointer();
|
||||
size_type __cap = __old_cap < __ms / 2 - __alignment ?
|
||||
__recommend(_VSTD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
|
||||
__recommend(_STD::max(__old_cap + __delta_cap, 2 * __old_cap)) :
|
||||
__ms - 1;
|
||||
pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);
|
||||
__invalidate_all_iterators();
|
||||
@@ -2159,8 +2119,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
|
||||
{
|
||||
clear();
|
||||
shrink_to_fit();
|
||||
__r_.first() = __str.__r_.first();
|
||||
__move_assign_alloc(__str);
|
||||
__r_ = _STD::move(__str.__r_);
|
||||
__str.__zero();
|
||||
}
|
||||
|
||||
@@ -2202,7 +2161,7 @@ typename enable_if
|
||||
>::type
|
||||
basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
size_type __cap = capacity();
|
||||
if (__cap < __n)
|
||||
{
|
||||
@@ -2234,7 +2193,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, siz
|
||||
size_type __sz = __str.size();
|
||||
if (__pos > __sz)
|
||||
this->__throw_out_of_range();
|
||||
return assign(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));
|
||||
return assign(__str.data() + __pos, _STD::min(__n, __sz - __pos));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@@ -2333,7 +2292,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(_ForwardIterator __first, _For
|
||||
{
|
||||
size_type __sz = size();
|
||||
size_type __cap = capacity();
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
if (__n)
|
||||
{
|
||||
if (__cap - __sz < __n)
|
||||
@@ -2362,7 +2321,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, siz
|
||||
size_type __sz = __str.size();
|
||||
if (__pos > __sz)
|
||||
this->__throw_out_of_range();
|
||||
return append(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));
|
||||
return append(__str.data() + __pos, _STD::min(__n, __sz - __pos));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@@ -2457,7 +2416,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIt
|
||||
for (; __first != __last; ++__first)
|
||||
push_back(*__first);
|
||||
pointer __p = __get_pointer();
|
||||
_VSTD::rotate(__p + __ip, __p + __old_sz, __p + size());
|
||||
_STD::rotate(__p + __ip, __p + __old_sz, __p + size());
|
||||
return iterator(__p + __ip);
|
||||
}
|
||||
|
||||
@@ -2473,7 +2432,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _Forward
|
||||
size_type __ip = static_cast<size_type>(__pos - begin());
|
||||
size_type __sz = size();
|
||||
size_type __cap = capacity();
|
||||
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|
||||
size_type __n = static_cast<size_type>(_STD::distance(__first, __last));
|
||||
if (__n)
|
||||
{
|
||||
pointer __p;
|
||||
@@ -2514,7 +2473,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_
|
||||
size_type __str_sz = __str.size();
|
||||
if (__pos2 > __str_sz)
|
||||
this->__throw_out_of_range();
|
||||
return insert(__pos1, __str.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2));
|
||||
return insert(__pos1, __str.data() + __pos2, _STD::min(__n, __str_sz - __pos2));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@@ -2575,7 +2534,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
|
||||
size_type __sz = size();
|
||||
if (__pos > __sz)
|
||||
this->__throw_out_of_range();
|
||||
__n1 = _VSTD::min(__n1, __sz - __pos);
|
||||
__n1 = _STD::min(__n1, __sz - __pos);
|
||||
size_type __cap = capacity();
|
||||
if (__cap - __sz + __n1 >= __n2)
|
||||
{
|
||||
@@ -2626,7 +2585,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
|
||||
size_type __sz = size();
|
||||
if (__pos > __sz)
|
||||
this->__throw_out_of_range();
|
||||
__n1 = _VSTD::min(__n1, __sz - __pos);
|
||||
__n1 = _STD::min(__n1, __sz - __pos);
|
||||
size_type __cap = capacity();
|
||||
pointer __p;
|
||||
if (__cap - __sz + __n1 >= __n2)
|
||||
@@ -2696,7 +2655,7 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type _
|
||||
size_type __str_sz = __str.size();
|
||||
if (__pos2 > __str_sz)
|
||||
this->__throw_out_of_range();
|
||||
return replace(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2));
|
||||
return replace(__pos1, __n1, __str.data() + __pos2, _STD::min(__n2, __str_sz - __pos2));
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@@ -2754,7 +2713,7 @@ basic_string<_CharT, _Traits, _Allocator>::erase(size_type __pos, size_type __n)
|
||||
if (__n)
|
||||
{
|
||||
pointer __p = __get_pointer();
|
||||
__n = _VSTD::min(__n, __sz - __pos);
|
||||
__n = _STD::min(__n, __sz - __pos);
|
||||
size_type __n_move = __sz - __pos - __n;
|
||||
if (__n_move != 0)
|
||||
traits_type::move(__p + __pos, __p + __pos + __n, __n_move);
|
||||
@@ -2880,7 +2839,7 @@ basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)
|
||||
this->__throw_length_error();
|
||||
size_type __cap = capacity();
|
||||
size_type __sz = size();
|
||||
__res_arg = _VSTD::max(__res_arg, __sz);
|
||||
__res_arg = _STD::max(__res_arg, __sz);
|
||||
__res_arg = __recommend(__res_arg);
|
||||
if (__res_arg != __cap)
|
||||
{
|
||||
@@ -3025,7 +2984,7 @@ basic_string<_CharT, _Traits, _Allocator>::copy(pointer __s, size_type __n, size
|
||||
size_type __sz = size();
|
||||
if (__pos > __sz)
|
||||
this->__throw_out_of_range();
|
||||
size_type __rlen = _VSTD::min(__n, __sz - __pos);
|
||||
size_type __rlen = _STD::min(__n, __sz - __pos);
|
||||
traits_type::copy(__s, data() + __pos, __rlen);
|
||||
return __rlen;
|
||||
}
|
||||
@@ -3045,7 +3004,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
_VSTD::swap(__r_.first(), __str.__r_.first());
|
||||
_STD::swap(__r_.first(), __str.__r_.first());
|
||||
__swap_alloc(__alloc(), __str.__alloc());
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
__invalidate_all_iterators();
|
||||
@@ -3079,7 +3038,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(const_pointer __s,
|
||||
if (__n == 0)
|
||||
return __pos;
|
||||
const_pointer __p = data();
|
||||
const_pointer __r = _VSTD::search(__p + __pos, __p + __sz, __s, __s + __n,
|
||||
const_pointer __r = _STD::search(__p + __pos, __p + __sz, __s, __s + __n,
|
||||
__traits_eq<traits_type>());
|
||||
if (__r == __p + __sz)
|
||||
return npos;
|
||||
@@ -3134,13 +3093,13 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const_pointer __s,
|
||||
assert(__s != 0);
|
||||
#endif
|
||||
size_type __sz = size();
|
||||
__pos = _VSTD::min(__pos, __sz);
|
||||
__pos = _STD::min(__pos, __sz);
|
||||
if (__n < __sz - __pos)
|
||||
__pos += __n;
|
||||
else
|
||||
__pos = __sz;
|
||||
const_pointer __p = data();
|
||||
const_pointer __r = _VSTD::find_end(__p, __p + __pos, __s, __s + __n,
|
||||
const_pointer __r = _STD::find_end(__p, __p + __pos, __s, __s + __n,
|
||||
__traits_eq<traits_type>());
|
||||
if (__n > 0 && __r == __p + __pos)
|
||||
return npos;
|
||||
@@ -3205,7 +3164,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const_pointer __s,
|
||||
if (__pos >= __sz || __n == 0)
|
||||
return npos;
|
||||
const_pointer __p = data();
|
||||
const_pointer __r = _VSTD::find_first_of(__p + __pos, __p + __sz, __s,
|
||||
const_pointer __r = _STD::find_first_of(__p + __pos, __p + __sz, __s,
|
||||
__s + __n, __traits_eq<traits_type>());
|
||||
if (__r == __p + __sz)
|
||||
return npos;
|
||||
@@ -3432,17 +3391,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
int
|
||||
basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT
|
||||
{
|
||||
size_t __lhs_sz = size();
|
||||
size_t __rhs_sz = __str.size();
|
||||
int __result = traits_type::compare(data(), __str.data(),
|
||||
_VSTD::min(__lhs_sz, __rhs_sz));
|
||||
if (__result != 0)
|
||||
return __result;
|
||||
if (__lhs_sz < __rhs_sz)
|
||||
return -1;
|
||||
if (__lhs_sz > __rhs_sz)
|
||||
return 1;
|
||||
return 0;
|
||||
return compare(0, npos, __str.data(), __str.size());
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3466,7 +3415,7 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
|
||||
size_type __sz = __str.size();
|
||||
if (__pos2 > __sz)
|
||||
this->__throw_out_of_range();
|
||||
return compare(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2,
|
||||
return compare(__pos1, __n1, __str.data() + __pos2, _STD::min(__n2,
|
||||
__sz - __pos2));
|
||||
}
|
||||
|
||||
@@ -3505,8 +3454,8 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
|
||||
size_type __sz = size();
|
||||
if (__pos1 > __sz || __n2 == npos)
|
||||
this->__throw_out_of_range();
|
||||
size_type __rlen = _VSTD::min(__n1, __sz - __pos1);
|
||||
int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));
|
||||
size_type __rlen = _STD::min(__n1, __sz - __pos1);
|
||||
int __r = traits_type::compare(data() + __pos1, __s, _STD::min(__rlen, __n2));
|
||||
if (__r == 0)
|
||||
{
|
||||
if (__rlen < __n2)
|
||||
@@ -3557,6 +3506,24 @@ operator==(const _CharT* __lhs,
|
||||
return __rhs.compare(__lhs) == 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator==(const char* __lhs,
|
||||
const basic_string<char, char_traits<char>, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return strcmp(__lhs, __rhs.data()) == 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator==(const wchar_t* __lhs,
|
||||
const basic_string<wchar_t, char_traits<wchar_t>, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return wcscmp(__lhs, __rhs.data()) == 0;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
@@ -3566,6 +3533,24 @@ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
|
||||
return __lhs.compare(__rhs) == 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator==(const basic_string<char, char_traits<char>, _Allocator>& __lhs,
|
||||
const char* __rhs) _NOEXCEPT
|
||||
{
|
||||
return strcmp(__lhs.data(), __rhs) == 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator==(const basic_string<wchar_t, char_traits<wchar_t>, _Allocator>& __lhs,
|
||||
const wchar_t* __rhs) _NOEXCEPT
|
||||
{
|
||||
return wcscmp(__lhs.data(), __rhs) == 0;
|
||||
}
|
||||
|
||||
// operator!=
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3603,7 +3588,25 @@ bool
|
||||
operator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
|
||||
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return __lhs.compare(__rhs) < 0;
|
||||
return __lhs.cmpare(__rhs) < 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const basic_string<char, char_traits<char>, _Allocator>& __lhs,
|
||||
const basic_string<char, char_traits<char>, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return strcmp(__lhs.data(), __rhs.data()) < 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const basic_string<wchar_t, char_traits<wchar_t>, _Allocator>& __lhs,
|
||||
const basic_string<wchar_t, char_traits<wchar_t>, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return wcscmp(__lhs.data(), __rhs.data()) < 0;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3612,7 +3615,25 @@ bool
|
||||
operator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
|
||||
const _CharT* __rhs) _NOEXCEPT
|
||||
{
|
||||
return __lhs.compare(__rhs) < 0;
|
||||
return __lhs.compare(__rhs);
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const basic_string<char, char_traits<char>, _Allocator>& __lhs,
|
||||
const char* __rhs) _NOEXCEPT
|
||||
{
|
||||
return strcmp(__lhs.data(), __rhs) < 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const basic_string<wchar_t, char_traits<wchar_t>, _Allocator>& __lhs,
|
||||
const wchar_t* __rhs) _NOEXCEPT
|
||||
{
|
||||
return wcscmp(__lhs.data(), __rhs) < 0;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3624,6 +3645,24 @@ operator< (const _CharT* __lhs,
|
||||
return __rhs.compare(__lhs) > 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const char* __lhs,
|
||||
const basic_string<char, char_traits<char>, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return strcmp(__lhs, __rhs.data()) < 0;
|
||||
}
|
||||
|
||||
template<class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator< (const wchar_t* __lhs,
|
||||
const basic_string<wchar_t, char_traits<wchar_t>, _Allocator>& __rhs) _NOEXCEPT
|
||||
{
|
||||
return wcscmp(__lhs, __rhs.data()) < 0;
|
||||
}
|
||||
|
||||
// operator>
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3779,7 +3818,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs)
|
||||
{
|
||||
return _VSTD::move(__lhs.append(__rhs));
|
||||
return _STD::move(__lhs.append(__rhs));
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3787,7 +3826,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs)
|
||||
{
|
||||
return _VSTD::move(__rhs.insert(0, __lhs));
|
||||
return _STD::move(__rhs.insert(0, __lhs));
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3795,7 +3834,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs)
|
||||
{
|
||||
return _VSTD::move(__lhs.append(__rhs));
|
||||
return _STD::move(__lhs.append(__rhs));
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3803,7 +3842,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(const _CharT* __lhs , basic_string<_CharT,_Traits,_Allocator>&& __rhs)
|
||||
{
|
||||
return _VSTD::move(__rhs.insert(0, __lhs));
|
||||
return _STD::move(__rhs.insert(0, __lhs));
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3812,7 +3851,7 @@ basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(_CharT __lhs, basic_string<_CharT,_Traits,_Allocator>&& __rhs)
|
||||
{
|
||||
__rhs.insert(__rhs.begin(), __lhs);
|
||||
return _VSTD::move(__rhs);
|
||||
return _STD::move(__rhs);
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3820,7 +3859,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const _CharT* __rhs)
|
||||
{
|
||||
return _VSTD::move(__lhs.append(__rhs));
|
||||
return _STD::move(__lhs.append(__rhs));
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
@@ -3829,7 +3868,7 @@ basic_string<_CharT, _Traits, _Allocator>
|
||||
operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs)
|
||||
{
|
||||
__lhs.push_back(__rhs);
|
||||
return _VSTD::move(__lhs);
|
||||
return _STD::move(__lhs);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -3897,21 +3936,6 @@ template<class _CharT, class _Traits, class _Allocator>
|
||||
const typename basic_string<_CharT, _Traits, _Allocator>::size_type
|
||||
basic_string<_CharT, _Traits, _Allocator>::npos;
|
||||
|
||||
template<class _Ptr>
|
||||
size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
|
||||
{
|
||||
size_t __r = 0;
|
||||
const size_t __sr = __CHAR_BIT__ * sizeof(size_t) - 8;
|
||||
const size_t __m = size_t(0xF) << (__sr + 4);
|
||||
for (; __p != __e; ++__p)
|
||||
{
|
||||
__r = (__r << 4) + *__p;
|
||||
size_t __g = __r & __m;
|
||||
__r ^= __g | (__g >> __sr);
|
||||
}
|
||||
return __r;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
struct _LIBCPP_VISIBLE hash<basic_string<_CharT, _Traits, _Allocator> >
|
||||
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
|
||||
@@ -3925,49 +3949,73 @@ size_t
|
||||
hash<basic_string<_CharT, _Traits, _Allocator> >::operator()(
|
||||
const basic_string<_CharT, _Traits, _Allocator>& __val) const _NOEXCEPT
|
||||
{
|
||||
return __do_string_hash(__val.data(), __val.data() + __val.size());
|
||||
typedef basic_string<_CharT, _Traits, _Allocator> S;
|
||||
typedef typename S::const_pointer const_pointer;
|
||||
size_t __r = 0;
|
||||
const size_t __sr = __CHAR_BIT__ * sizeof(size_t) - 8;
|
||||
const size_t __m = size_t(0xF) << (__sr + 4);
|
||||
const_pointer __p = __val.data();
|
||||
const_pointer __e = __p + __val.size();
|
||||
for (; __p != __e; ++__p)
|
||||
{
|
||||
__r = (__r << 4) + *__p;
|
||||
size_t __g = __r & __m;
|
||||
__r ^= __g | (__g >> __sr);
|
||||
}
|
||||
return __r;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os,
|
||||
const basic_string<_CharT, _Traits, _Allocator>& __str);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm);
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
extern template class basic_string<char>;
|
||||
extern template class basic_string<wchar_t>;
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<char const*>::value, void>::type
|
||||
basic_string<char, char_traits<char>, allocator<char> >::
|
||||
__init<char const*>(char const*, char const*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<wchar_t const*>::value, void>::type
|
||||
basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >::
|
||||
__init<wchar_t const*>(wchar_t const*, wchar_t const*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<char*>::value,
|
||||
basic_string<char, char_traits<char>, allocator<char> >&>::type
|
||||
basic_string<char, char_traits<char>, allocator<char> >::
|
||||
append<char*>(char*, char*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<wchar_t*>::value,
|
||||
basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&>::type
|
||||
basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >::
|
||||
append<wchar_t*>(wchar_t*, wchar_t*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<char const*>::value,
|
||||
string::iterator>::type
|
||||
string::
|
||||
insert<char const*>(string::const_iterator, char const*, char const*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<wchar_t const*>::value,
|
||||
wstring::iterator>::type
|
||||
wstring::
|
||||
insert<wchar_t const*>(wstring::const_iterator, wchar_t const*, wchar_t const*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_input_iterator<char const*>::value, string&>::type
|
||||
string::
|
||||
replace<char const*>(string::const_iterator, string::const_iterator, char const*, char const*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_input_iterator<wchar_t const*>::value, wstring&>::type
|
||||
wstring::
|
||||
replace<wchar_t const*>(wstring::const_iterator, wstring::const_iterator, wchar_t const*, wchar_t const*);
|
||||
|
||||
extern template
|
||||
enable_if<__is_forward_iterator<wchar_t*>::value, wstring&>::type
|
||||
wstring::assign<wchar_t*>(wchar_t*, wchar_t*);
|
||||
|
||||
extern template
|
||||
string
|
||||
operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
|
||||
|
@@ -150,9 +150,7 @@ public:
|
||||
strstreambuf(const unsigned char* __gnext, streamsize __n);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf(strstreambuf&& __rhs);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf& operator=(strstreambuf&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -189,43 +187,6 @@ private:
|
||||
void __init(char* __gnext, streamsize __n, char* __pbeg);
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf::strstreambuf(strstreambuf&& __rhs)
|
||||
: streambuf(__rhs),
|
||||
__strmode_(__rhs.__strmode_),
|
||||
__alsize_(__rhs.__alsize_),
|
||||
__palloc_(__rhs.__palloc_),
|
||||
__pfree_(__rhs.__pfree_)
|
||||
{
|
||||
__rhs.setg(nullptr, nullptr, nullptr);
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf&
|
||||
strstreambuf::operator=(strstreambuf&& __rhs)
|
||||
{
|
||||
if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0)
|
||||
{
|
||||
if (__pfree_)
|
||||
__pfree_(eback());
|
||||
else
|
||||
delete [] eback();
|
||||
}
|
||||
streambuf::operator=(__rhs);
|
||||
__strmode_ = __rhs.__strmode_;
|
||||
__alsize_ = __rhs.__alsize_;
|
||||
__palloc_ = __rhs.__palloc_;
|
||||
__pfree_ = __rhs.__pfree_;
|
||||
__rhs.setg(nullptr, nullptr, nullptr);
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
class _LIBCPP_VISIBLE istrstream
|
||||
: public istream
|
||||
{
|
||||
@@ -246,8 +207,8 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream(istrstream&& __rhs)
|
||||
: istream(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: istream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
istream::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -255,8 +216,8 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream& operator=(istrstream&& __rhs)
|
||||
{
|
||||
istream::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
istream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -295,8 +256,8 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream(ostrstream&& __rhs)
|
||||
: ostream(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: ostream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
ostream::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -304,8 +265,8 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream& operator=(ostrstream&& __rhs)
|
||||
{
|
||||
ostream::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
ostream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -355,8 +316,8 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream(strstream&& __rhs)
|
||||
: iostream(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: iostream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
iostream::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -364,8 +325,8 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream& operator=(strstream&& __rhs)
|
||||
{
|
||||
iostream::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
iostream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@@ -1,110 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===--------------------- support/win32/locale_win32.h -------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
|
||||
#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
|
||||
|
||||
// ctype mask table defined in msvcrt.dll
|
||||
extern "C" unsigned short __declspec(dllimport) _ctype[];
|
||||
|
||||
#include "support/win32/support.h"
|
||||
#include <memory>
|
||||
#include <xlocinfo.h> // _locale_t
|
||||
#define locale_t _locale_t
|
||||
#define LC_COLLATE_MASK _M_COLLATE
|
||||
#define LC_CTYPE_MASK _M_CTYPE
|
||||
#define LC_MONETARY_MASK _M_MONETARY
|
||||
#define LC_NUMERIC_MASK _M_NUMERIC
|
||||
#define LC_TIME_MASK _M_TIME
|
||||
#define LC_MESSAGES_MASK _M_MESSAGES
|
||||
#define LC_ALL_MASK ( LC_COLLATE_MASK \
|
||||
| LC_CTYPE_MASK \
|
||||
| LC_MESSAGES_MASK \
|
||||
| LC_MONETARY_MASK \
|
||||
| LC_NUMERIC_MASK \
|
||||
| LC_TIME_MASK )
|
||||
#define freelocale _free_locale
|
||||
// FIXME: base currently unused. Needs manual work to construct the new locale
|
||||
locale_t newlocale( int mask, const char * locale, locale_t base );
|
||||
locale_t uselocale( locale_t newloc );
|
||||
lconv *localeconv_l( locale_t loc );
|
||||
size_t mbrlen_l( const char *__restrict__ s, size_t n,
|
||||
mbstate_t *__restrict__ ps, locale_t loc);
|
||||
size_t mbsrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t len, mbstate_t *__restrict__ ps, locale_t loc );
|
||||
size_t wcrtomb_l( char *__restrict__ s, wchar_t wc, mbstate_t *__restrict__ ps,
|
||||
locale_t loc);
|
||||
size_t mbrtowc_l( wchar_t *__restrict__ pwc, const char *__restrict__ s,
|
||||
size_t n, mbstate_t *__restrict__ ps, locale_t loc);
|
||||
size_t mbsnrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t nms, size_t len, mbstate_t *__restrict__ ps, locale_t loc);
|
||||
size_t wcsnrtombs_l( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps, locale_t loc);
|
||||
wint_t btowc_l( int c, locale_t loc );
|
||||
int wctob_l( wint_t c, locale_t loc );
|
||||
typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
|
||||
typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
|
||||
{
|
||||
__locale_raii __current( uselocale(__l), uselocale );
|
||||
return MB_CUR_MAX;
|
||||
}
|
||||
|
||||
// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
|
||||
#include <stdio.h>
|
||||
#define mbtowc_l _mbtowc_l
|
||||
#define strtoll_l _strtoi64_l
|
||||
#define strtoull_l _strtoui64_l
|
||||
// FIXME: current msvcrt does not know about long double
|
||||
#define strtold_l _strtod_l
|
||||
#define islower_l _islower_l
|
||||
#define isupper_l _isupper_l
|
||||
#define isdigit_l _isdigit_l
|
||||
#define isxdigit_l _isxdigit_l
|
||||
#define strcoll_l _strcoll_l
|
||||
#define strxfrm_l _strxfrm_l
|
||||
#define wcscoll_l _wcscoll_l
|
||||
#define wcsxfrm_l _wcsxfrm_l
|
||||
#define toupper_l _toupper_l
|
||||
#define tolower_l _tolower_l
|
||||
#define iswspace_l _iswspace_l
|
||||
#define iswprint_l _iswprint_l
|
||||
#define iswcntrl_l _iswcntrl_l
|
||||
#define iswupper_l _iswupper_l
|
||||
#define iswlower_l _iswlower_l
|
||||
#define iswalpha_l _iswalpha_l
|
||||
#define iswdigit_l _iswdigit_l
|
||||
#define iswpunct_l _iswpunct_l
|
||||
#define iswxdigit_l _iswxdigit_l
|
||||
#define towupper_l _towupper_l
|
||||
#define towlower_l _towlower_l
|
||||
#define strftime_l _strftime_l
|
||||
#define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define vsscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define snprintf_l( __s, __n, __l, __f, ... ) _snprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
|
||||
#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
|
||||
int asprintf_l( char **ret, locale_t loc, const char *format, ... );
|
||||
int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
|
||||
|
||||
|
||||
// not-so-pressing FIXME: use locale to determine blank characters
|
||||
inline int isblank_l( int c, locale_t /*loc*/ )
|
||||
{
|
||||
return ( c == ' ' || c == '\t' );
|
||||
}
|
||||
inline int iswblank_l( wint_t c, locale_t /*loc*/ )
|
||||
{
|
||||
return ( c == L' ' || c == L'\t' );
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
|
@@ -1,31 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===----------------------- support/win32/support.h ----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_SUPPORT_WIN32_SUPPORT_H
|
||||
#define _LIBCPP_SUPPORT_WIN32_SUPPORT_H
|
||||
|
||||
/*
|
||||
Functions and constants used in libc++ that are missing from the Windows C library.
|
||||
*/
|
||||
|
||||
#include <wchar.h> // mbstate_t
|
||||
#include <stdio.h> // _snwprintf
|
||||
#define swprintf _snwprintf
|
||||
#define vswprintf _vsnwprintf
|
||||
|
||||
int vasprintf( char **sptr, const char *__restrict__ fmt , va_list ap );
|
||||
int asprintf(char **sptr, const char *__restrict__ fmt, ...);
|
||||
|
||||
size_t mbsnrtowcs( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t nmc, size_t len, mbstate_t *__restrict__ ps );
|
||||
size_t wcsnrtombs( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps );
|
||||
|
||||
#endif // _LIBCPP_SUPPORT_WIN32_SUPPORT_H
|
@@ -284,7 +284,7 @@ public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(thread& __t) {_VSTD::swap(__t_, __t.__t_);}
|
||||
void swap(thread& __t) {_STD::swap(__t_, __t.__t_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool joinable() const {return __t_ != 0;}
|
||||
@@ -325,7 +325,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__threaad_execute(tuple<_F, _Args...>& __t, __tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
|
||||
__invoke(_STD::move(_STD::get<0>(__t)), _STD::move(_STD::get<_Indices>(__t))...);
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
@@ -345,8 +345,8 @@ template <class _F, class ..._Args,
|
||||
thread::thread(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G;
|
||||
_VSTD::unique_ptr<_G> __p(new _G(__decay_copy(_VSTD::forward<_F>(__f)),
|
||||
__decay_copy(_VSTD::forward<_Args>(__args))...));
|
||||
_STD::unique_ptr<_G> __p(new _G(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get());
|
||||
if (__ec == 0)
|
||||
__p.release();
|
||||
|
@@ -191,7 +191,7 @@ public:
|
||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(_Tp&& __t)
|
||||
: value(_VSTD::forward<_Tp>(__t))
|
||||
: value(_STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
|
||||
: value(_VSTD::forward<_Tp>(__t))
|
||||
: value(_STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
|
||||
: value(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
|
||||
: value(allocator_arg_t(), __a, _STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
|
||||
: value(_VSTD::forward<_Tp>(__t), __a)
|
||||
: value(_STD::forward<_Tp>(__t), __a)
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -260,14 +260,14 @@ public:
|
||||
__tuple_leaf&
|
||||
operator=(_Tp&& __t)
|
||||
{
|
||||
value = _VSTD::forward<_Tp>(__t);
|
||||
value = _STD::forward<_Tp>(__t);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
|
||||
{
|
||||
_VSTD::swap(*this, __t);
|
||||
_STD::swap(*this, __t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -302,22 +302,22 @@ public:
|
||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(_Tp&& __t)
|
||||
: _Hp(_VSTD::forward<_Tp>(__t)) {}
|
||||
: _Hp(_STD::forward<_Tp>(__t)) {}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
|
||||
: _Hp(_VSTD::forward<_Tp>(__t)) {}
|
||||
: _Hp(_STD::forward<_Tp>(__t)) {}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
|
||||
: _Hp(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t)) {}
|
||||
: _Hp(allocator_arg_t(), __a, _STD::forward<_Tp>(__t)) {}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
|
||||
: _Hp(_VSTD::forward<_Tp>(__t), __a) {}
|
||||
: _Hp(_STD::forward<_Tp>(__t), __a) {}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -329,7 +329,7 @@ public:
|
||||
__tuple_leaf&
|
||||
operator=(_Tp&& __t)
|
||||
{
|
||||
_Hp::operator=(_VSTD::forward<_Tp>(__t));
|
||||
_Hp::operator=(_STD::forward<_Tp>(__t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
int
|
||||
swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
|
||||
{
|
||||
_VSTD::swap(*this, __t);
|
||||
_STD::swap(*this, __t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
||||
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
||||
_Up&&... __u) :
|
||||
__tuple_leaf<_Uf, _Tf>(_VSTD::forward<_Up>(__u))...,
|
||||
__tuple_leaf<_Uf, _Tf>(_STD::forward<_Up>(__u))...,
|
||||
__tuple_leaf<_Ul, _Tl>()...
|
||||
{}
|
||||
|
||||
@@ -391,7 +391,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
||||
_Up&&... __u) :
|
||||
__tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a,
|
||||
_VSTD::forward<_Up>(__u))...,
|
||||
_STD::forward<_Up>(__u))...,
|
||||
__tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)...
|
||||
{}
|
||||
|
||||
@@ -403,8 +403,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tuple_impl(_Tuple&& __t)
|
||||
: __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
|
||||
: __tuple_leaf<_Indx, _Tp>(_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
|
||||
{}
|
||||
|
||||
template <class _Alloc, class _Tuple,
|
||||
@@ -417,8 +417,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
__tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
|
||||
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(), __a,
|
||||
_VSTD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
|
||||
_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
|
||||
{}
|
||||
|
||||
template <class _Tuple>
|
||||
@@ -430,8 +430,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
>::type
|
||||
operator=(_Tuple&& __t)
|
||||
{
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ public:
|
||||
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
_VSTD::forward<_Up>(__u)...) {}
|
||||
_STD::forward<_Up>(__u)...) {}
|
||||
|
||||
template <class _Alloc, class ..._Up,
|
||||
class = typename enable_if
|
||||
@@ -522,7 +522,7 @@ public:
|
||||
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
_VSTD::forward<_Up>(__u)...) {}
|
||||
_STD::forward<_Up>(__u)...) {}
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if
|
||||
@@ -532,7 +532,7 @@ public:
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(_Tuple&& __t)
|
||||
: base_(_VSTD::forward<_Tuple>(__t)) {}
|
||||
: base_(_STD::forward<_Tuple>(__t)) {}
|
||||
|
||||
template <class _Alloc, class _Tuple,
|
||||
class = typename enable_if
|
||||
@@ -542,7 +542,7 @@ public:
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
|
||||
: base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
|
||||
: base_(allocator_arg_t(), __a, _STD::forward<_Tuple>(__t)) {}
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if
|
||||
@@ -554,7 +554,7 @@ public:
|
||||
tuple&
|
||||
operator=(_Tuple&& __t)
|
||||
{
|
||||
base_.operator=(_VSTD::forward<_Tuple>(__t));
|
||||
base_.operator=(_STD::forward<_Tuple>(__t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -639,6 +639,11 @@ tie(_Tp&... __t)
|
||||
template <class _Up>
|
||||
struct __ignore_t
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__ignore_t() {}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__ignore_t(_Tp&&) {}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __ignore_t& operator=(_Tp&&) const {return *this;}
|
||||
@@ -671,7 +676,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<typename __make_tuple_return<_Tp>::type...>
|
||||
make_tuple(_Tp&&... __t)
|
||||
{
|
||||
return tuple<typename __make_tuple_return<_Tp>::type...>(_VSTD::forward<_Tp>(__t)...);
|
||||
return tuple<typename __make_tuple_return<_Tp>::type...>(_STD::forward<_Tp>(__t)...);
|
||||
}
|
||||
|
||||
template <class... _Tp>
|
||||
@@ -679,7 +684,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp&&...>
|
||||
forward_as_tuple(_Tp&&... __t)
|
||||
{
|
||||
return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
|
||||
return tuple<_Tp&&...>(_STD::forward<_Tp>(__t)...);
|
||||
}
|
||||
|
||||
template <size_t _I>
|
||||
@@ -877,8 +882,8 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
|
||||
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
|
||||
operator()(tuple<_Types...> __t, _Tuple0&& __t0)
|
||||
{
|
||||
return _VSTD::forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_VSTD::forward<_Tuple0>(__t0))...);
|
||||
return _STD::forward_as_tuple(_STD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_STD::forward<_Tuple0>(__t0))...);
|
||||
}
|
||||
|
||||
template <class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
@@ -892,12 +897,12 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
|
||||
tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,
|
||||
typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,
|
||||
typename __make_tuple_indices<tuple_size<_T1>::value>::type>()
|
||||
(_VSTD::forward_as_tuple(
|
||||
_VSTD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_VSTD::forward<_Tuple0>(__t0))...
|
||||
(_STD::forward_as_tuple(
|
||||
_STD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_STD::forward<_Tuple0>(__t0))...
|
||||
),
|
||||
_VSTD::forward<_Tuple1>(__t1),
|
||||
_VSTD::forward<_Tuples>(__tpls)...);
|
||||
_STD::forward<_Tuple1>(__t1),
|
||||
_STD::forward<_Tuples>(__tpls)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -909,8 +914,8 @@ tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
return __tuple_cat<tuple<>, __tuple_indices<>,
|
||||
typename __make_tuple_indices<tuple_size<_T0>::value>::type>()
|
||||
(tuple<>(), _VSTD::forward<_Tuple0>(__t0),
|
||||
_VSTD::forward<_Tuples>(__tpls)...);
|
||||
(tuple<>(), _STD::forward<_Tuple0>(__t0),
|
||||
_STD::forward<_Tuples>(__tpls)...);
|
||||
}
|
||||
|
||||
template <class ..._Tp, class _Alloc>
|
||||
@@ -923,8 +928,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
pair<_T1, _T2>::pair(piecewise_construct_t,
|
||||
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
|
||||
__tuple_indices<_I1...>, __tuple_indices<_I2...>)
|
||||
: first(_VSTD::forward<_Args1>(get<_I1>( __first_args))...),
|
||||
second(_VSTD::forward<_Args2>(get<_I2>(__second_args))...)
|
||||
: first(_STD::forward<_Args1>(get<_I1>( __first_args))...),
|
||||
second(_STD::forward<_Args2>(get<_I2>(__second_args))...)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -725,7 +725,7 @@ template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
|
||||
|
||||
// is_base_of
|
||||
|
||||
#ifdef _LIBCP_HAS_IS_BASE_OF
|
||||
#if __has_feature(is_base_of)
|
||||
|
||||
template <class _Bp, class _Dp>
|
||||
struct _LIBCPP_VISIBLE is_base_of
|
||||
@@ -733,7 +733,51 @@ struct _LIBCPP_VISIBLE is_base_of
|
||||
|
||||
#else // __has_feature(is_base_of)
|
||||
|
||||
#error is_base_of not implemented.
|
||||
// (C) Copyright Rani Sharoni 2003.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
template <class _Bp, class _Dp>
|
||||
struct __is_base_of_tests
|
||||
{
|
||||
template <class _Tp>
|
||||
static char __test(const volatile _Dp*, _Tp);
|
||||
static __two __test(const volatile _Bp*, int);
|
||||
};
|
||||
|
||||
template <class _Bp, class _Dp>
|
||||
struct __is_base_of_imp
|
||||
{
|
||||
struct __host
|
||||
{
|
||||
operator const volatile _Bp*() const;
|
||||
operator const volatile _Dp*();
|
||||
};
|
||||
|
||||
static const size_t __complete_check = sizeof(_Dp);
|
||||
static const bool value = sizeof(__is_base_of_tests<_Bp, _Dp>::__test(__host(), 0)) == 1;
|
||||
};
|
||||
|
||||
template <class _Bp, class _Dp, bool = is_class<_Bp>::value,
|
||||
bool = is_class<_Dp>::value,
|
||||
bool = is_same<_Bp, _Dp>::value>
|
||||
struct __libcpp_base_of : public false_type {};
|
||||
|
||||
template <class _Bp, class _Dp>
|
||||
struct __libcpp_base_of<_Bp, _Dp, true, true, true> : public true_type {};
|
||||
|
||||
template <class _Bp, class _Dp>
|
||||
struct __libcpp_base_of<_Bp, _Dp, true, true, false>
|
||||
: public integral_constant<bool, __is_base_of_imp<_Bp, _Dp>::value> {};
|
||||
|
||||
template <class _Bp, class _Dp>
|
||||
struct _LIBCPP_VISIBLE is_base_of
|
||||
: public __libcpp_base_of<typename remove_cv<_Bp>::type, typename remove_cv<_Dp>::type>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // __has_feature(is_base_of)
|
||||
|
||||
@@ -774,7 +818,7 @@ template <class _Tp> struct _LIBCPP_VISIBLE is_polymorphic
|
||||
|
||||
// has_virtual_destructor
|
||||
|
||||
#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
||||
#ifdef __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
||||
|
||||
template <class _Tp> struct _LIBCPP_VISIBLE has_virtual_destructor
|
||||
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
|
||||
@@ -1164,7 +1208,7 @@ struct _LIBCPP_VISIBLE common_type<_Tp, _Up, _Vp...>
|
||||
// is_assignable
|
||||
|
||||
template <class _Tp, class _Arg>
|
||||
decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>(), true_type()))
|
||||
decltype((_STD::declval<_Tp>() = _STD::declval<_Arg>(), true_type()))
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__is_assignable_test(_Tp&&, _Arg&&);
|
||||
#else
|
||||
@@ -1221,7 +1265,7 @@ struct __destructible_test
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
decltype((_VSTD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type()))
|
||||
decltype((_STD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type()))
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__is_destructible_test(_Tp&&);
|
||||
#else
|
||||
@@ -1384,28 +1428,14 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename decay<_Tp>::type
|
||||
__decay_copy(_Tp&& __t)
|
||||
{
|
||||
return _VSTD::forward<_Tp>(__t);
|
||||
return _STD::forward<_Tp>(__t);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename decay<_Tp>::type
|
||||
__decay_copy(const _Tp& __t)
|
||||
{
|
||||
return _VSTD::forward<_Tp>(__t);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template <class _MP, bool _IsMemberFuctionPtr, bool _IsMemberObjectPtr>
|
||||
struct __member_pointer_traits_imp
|
||||
{
|
||||
@@ -1636,7 +1666,7 @@ struct __member_pointer_traits
|
||||
|
||||
// result_of
|
||||
|
||||
template <class _Callable> class result_of;
|
||||
template <class> class result_of;
|
||||
|
||||
template <class _Fn, bool, bool>
|
||||
class __result_of
|
||||
@@ -1671,7 +1701,7 @@ struct __result_of_mdp;
|
||||
template <class _R, class _Class, class _Tp>
|
||||
struct __result_of_mdp<_R _Class::*, _Tp, false>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _R>::type&& type;
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_Tp>()), _R>::type&& type;
|
||||
};
|
||||
|
||||
template <class _R, class _Class, class _Tp>
|
||||
@@ -1756,7 +1786,7 @@ struct __result_of_mdp;
|
||||
template <class _R, class _Class, class _Tp>
|
||||
struct __result_of_mdp<_R _Class::*, _Tp, false>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _R>::type& type;
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_Tp>()), _R>::type& type;
|
||||
};
|
||||
|
||||
template <class _R, class _Class, class _Tp>
|
||||
@@ -1857,7 +1887,7 @@ class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1, _A2)>
|
||||
// main is_constructible test
|
||||
|
||||
template <class _Tp, class ..._Args>
|
||||
decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...)), true_type())
|
||||
decltype(_STD::move(_Tp(_STD::declval<_Args>()...)), true_type())
|
||||
__is_constructible_test(_Tp&&, _Args&& ...);
|
||||
|
||||
template <class ..._Args>
|
||||
@@ -1984,7 +2014,7 @@ false_type
|
||||
__is_constructible0_test(__any);
|
||||
|
||||
template <class _Tp, class _A0>
|
||||
decltype((_Tp(_VSTD::declval<_A0>()), true_type()))
|
||||
decltype((_Tp(_STD::declval<_A0>()), true_type()))
|
||||
__is_constructible1_test(_Tp&, _A0&);
|
||||
|
||||
template <class _A0>
|
||||
@@ -1992,7 +2022,7 @@ false_type
|
||||
__is_constructible1_test(__any, _A0&);
|
||||
|
||||
template <class _Tp, class _A0, class _A1>
|
||||
decltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>()), true_type()))
|
||||
decltype((_Tp(_STD::declval<_A0>(), _STD::declval<_A1>()), true_type()))
|
||||
__is_constructible2_test(_Tp&, _A0&, _A1&);
|
||||
|
||||
template <class _A0, class _A1>
|
||||
@@ -2564,7 +2594,7 @@ struct __is_nothrow_assignable<false, _Tp, _Arg>
|
||||
|
||||
template <class _Tp, class _Arg>
|
||||
struct __is_nothrow_assignable<true, _Tp, _Arg>
|
||||
: public integral_constant<bool, noexcept(_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>()) >
|
||||
: public integral_constant<bool, noexcept(_STD::declval<_Tp>() = _STD::declval<_Arg>()) >
|
||||
{
|
||||
};
|
||||
|
||||
@@ -2650,7 +2680,7 @@ struct __is_nothrow_destructible<false, _Tp>
|
||||
|
||||
template <class _Tp>
|
||||
struct __is_nothrow_destructible<true, _Tp>
|
||||
: public integral_constant<bool, noexcept(_VSTD::declval<_Tp>().~_Tp()) >
|
||||
: public integral_constant<bool, noexcept(_STD::declval<_Tp>().~_Tp()) >
|
||||
{
|
||||
};
|
||||
|
||||
@@ -2902,31 +2932,31 @@ __invoke(__any, _Args&& ...__args)
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
|
||||
-> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...));
|
||||
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
|
||||
-> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...));
|
||||
|
||||
// bullets 3 and 4
|
||||
|
||||
template <class _F, class _A0>
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
|
||||
-> decltype(_STD::forward<_A0>(__a0).*__f);
|
||||
|
||||
template <class _F, class _A0>
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
|
||||
-> decltype((*_STD::forward<_A0>(__a0)).*__f);
|
||||
|
||||
// bullet 5
|
||||
|
||||
template <class _F, class ..._Args>
|
||||
auto
|
||||
__invoke(_F&& __f, _Args&& ...__args)
|
||||
-> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...));
|
||||
-> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...));
|
||||
|
||||
// __invokable
|
||||
|
||||
@@ -2935,7 +2965,7 @@ struct __invokable_imp
|
||||
: private __check_complete<_F, _Args...>
|
||||
{
|
||||
typedef decltype(
|
||||
__invoke(_VSTD::declval<_F>(), _VSTD::declval<_Args>()...)
|
||||
__invoke(_STD::declval<_F>(), _STD::declval<_Args>()...)
|
||||
) type;
|
||||
static const bool value = !is_same<type, __nat>::value;
|
||||
};
|
||||
@@ -2970,21 +3000,17 @@ struct __invoke_of
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
typename enable_if
|
||||
<
|
||||
is_move_constructible<_Tp>::value &&
|
||||
is_move_assignable<_Tp>::value
|
||||
>::type
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
|
||||
is_nothrow_move_assignable<_Tp>::value)
|
||||
{
|
||||
_Tp __t(_VSTD::move(__x));
|
||||
__x = _VSTD::move(__y);
|
||||
__y = _VSTD::move(__t);
|
||||
_Tp __t(_STD::move(__x));
|
||||
__x = _STD::move(__y);
|
||||
__y = _STD::move(__t);
|
||||
}
|
||||
|
||||
template <class _ForwardIterator1, class _ForwardIterator2>
|
||||
@@ -2992,8 +3018,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
|
||||
// _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
|
||||
_NOEXCEPT_(_NOEXCEPT_(swap(*_VSTD::declval<_ForwardIterator1>(),
|
||||
*_VSTD::declval<_ForwardIterator2>())))
|
||||
_NOEXCEPT_(_NOEXCEPT_(swap(*_STD::declval<_ForwardIterator1>(),
|
||||
*_STD::declval<_ForwardIterator2>())))
|
||||
{
|
||||
swap(*__a, *__b);
|
||||
}
|
||||
@@ -3003,13 +3029,13 @@ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
|
||||
namespace __detail
|
||||
{
|
||||
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
__nat swap(__any, __any);
|
||||
|
||||
template <class _Tp>
|
||||
struct __swappable
|
||||
{
|
||||
typedef decltype(swap(_VSTD::declval<_Tp&>(), _VSTD::declval<_Tp&>())) type;
|
||||
typedef decltype(swap(_STD::declval<_Tp&>(), _STD::declval<_Tp&>())) type;
|
||||
static const bool value = !is_same<type, __nat>::value;
|
||||
};
|
||||
|
||||
@@ -3025,8 +3051,8 @@ struct __is_swappable
|
||||
|
||||
template <bool, class _Tp>
|
||||
struct __is_nothrow_swappable_imp
|
||||
: public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(),
|
||||
_VSTD::declval<_Tp&>()))>
|
||||
: public integral_constant<bool, noexcept(swap(_STD::declval<_Tp&>(),
|
||||
_STD::declval<_Tp&>()))>
|
||||
{
|
||||
};
|
||||
|
||||
@@ -3052,26 +3078,6 @@ struct __is_nothrow_swappable
|
||||
|
||||
#endif // __has_feature(cxx_noexcept)
|
||||
|
||||
#ifdef _LIBCXX_UNDERLYING_TYPE
|
||||
|
||||
template <class _Tp>
|
||||
struct underlying_type
|
||||
{
|
||||
typedef _LIBCXX_UNDERLYING_TYPE(_Tp) type;
|
||||
};
|
||||
|
||||
#else // _LIBCXX_UNDERLYING_TYPE
|
||||
|
||||
template <class _Tp, bool _Support = false>
|
||||
struct underlying_type
|
||||
{
|
||||
static_assert(_Support, "The underyling_type trait requires compiler "
|
||||
"support. Either no such support exists or "
|
||||
"libc++ does not know how to use it.");
|
||||
};
|
||||
|
||||
#endif // _LIBCXX_UNDERLYING_TYPE
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_TYPE_TRAITS
|
||||
|
@@ -481,9 +481,9 @@ public:
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__second_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
|
||||
if (__first_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.first));
|
||||
if (__p)
|
||||
__alloc_traits::deallocate(__na_, __p, 1);
|
||||
}
|
||||
@@ -560,9 +560,9 @@ public:
|
||||
typedef const value_type& reference;
|
||||
typedef typename __pointer_traits::template
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
rebind<const value_type>
|
||||
rebind<value_type>
|
||||
#else
|
||||
rebind<const value_type>::other
|
||||
rebind<value_type>::other
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
@@ -684,28 +684,19 @@ public:
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_map(unordered_map&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_map(initializer_list<value_type> __il);
|
||||
unordered_map(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
|
||||
unordered_map(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf, const key_equal& __eql,
|
||||
const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
// ~unordered_map() = default;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_map& operator=(const unordered_map& __u)
|
||||
{
|
||||
__table_ = __u.__table_;
|
||||
return *this;
|
||||
}
|
||||
// unordered_map& operator=(const unordered_map& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_map& operator=(unordered_map&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_map& operator=(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
@@ -737,15 +728,15 @@ public:
|
||||
{return __table_.__emplace_unique();}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_A0&& __a0)
|
||||
{return __table_.__emplace_unique(_VSTD::forward<_A0>(__a0));}
|
||||
{return __table_.__emplace_unique(_STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
pair<iterator, bool> emplace(_A0&& __a0, _Args&&... __args);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -755,19 +746,19 @@ public:
|
||||
{return __table_.__emplace_unique().first;}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator, _A0&& __a0)
|
||||
{return __table_.__emplace_unique(_VSTD::forward<_A0>(__a0)).first;}
|
||||
{return __table_.__emplace_unique(_STD::forward<_A0>(__a0)).first;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator, _A0&& __a0, _Args&&... __args)
|
||||
{return emplace(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...).first;}
|
||||
{return emplace(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...).first;}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -775,28 +766,26 @@ public:
|
||||
{return __table_.__insert_unique(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(_P&& __x)
|
||||
{return __table_.__insert_unique(_VSTD::forward<_P>(__x));}
|
||||
{return __table_.__insert_unique(_STD::forward<_P>(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x)
|
||||
{return insert(__x).first;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, _P&& __x)
|
||||
{return insert(_VSTD::forward<_P>(__x)).first;}
|
||||
{return insert(_STD::forward<_P>(__x)).first;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
|
||||
@@ -880,11 +869,11 @@ private:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__node_holder __construct_node(const key_type& __k);
|
||||
@@ -971,29 +960,27 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
unordered_map&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_VSTD::move(__u.__table_))
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
unordered_map&& __u, const allocator_type& __a)
|
||||
: __table_(_VSTD::move(__u.__table_), __a)
|
||||
: __table_(_STD::move(__u.__table_), __a)
|
||||
{
|
||||
if (__a != __u.get_allocator())
|
||||
{
|
||||
iterator __i = __u.begin();
|
||||
while (__u.size() != 0)
|
||||
__table_.__insert_unique(
|
||||
_VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
|
||||
_STD::move(__u.__table_.remove((__i++).__i_)->__value_)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -1021,8 +1008,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
@@ -1031,14 +1016,12 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
|
||||
{
|
||||
__table_ = _VSTD::move(__u.__table_);
|
||||
__table_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
@@ -1049,14 +1032,12 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
>
|
||||
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
|
||||
@@ -1064,11 +1045,11 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
|
||||
_VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first),
|
||||
_STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
@@ -1077,15 +1058,15 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0,
|
||||
class // = typename enable_if<is_constructible<value_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, value_type>::value>::type
|
||||
>
|
||||
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_),
|
||||
_VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_),
|
||||
_STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
@@ -1095,13 +1076,13 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
>
|
||||
pair<typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator, bool>
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
|
||||
if (__r.second)
|
||||
__h.release();
|
||||
@@ -1117,11 +1098,11 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type&
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first), __k);
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second));
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1159,7 +1140,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
|
||||
iterator __i = find(__k);
|
||||
if (__i != end())
|
||||
return __i->second;
|
||||
__node_holder __h = __construct_node(_VSTD::move(__k));
|
||||
__node_holder __h = __construct_node(_STD::move(__k));
|
||||
pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
|
||||
__h.release();
|
||||
return __r.first->second;
|
||||
@@ -1306,7 +1287,6 @@ public:
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_multimap(initializer_list<value_type> __il);
|
||||
unordered_multimap(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(),
|
||||
@@ -1314,21 +1294,13 @@ public:
|
||||
unordered_multimap(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf, const key_equal& __eql,
|
||||
const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
// ~unordered_multimap() = default;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multimap& operator=(const unordered_multimap& __u)
|
||||
{
|
||||
__table_ = __u.__table_;
|
||||
return *this;
|
||||
}
|
||||
// unordered_multimap& operator=(const unordered_multimap& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multimap& operator=(unordered_multimap&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_multimap& operator=(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
@@ -1360,15 +1332,15 @@ public:
|
||||
{return __table_.__emplace_multi();}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_A0&& __a0)
|
||||
{return __table_.__emplace_multi(_VSTD::forward<_A0>(__a0));}
|
||||
{return __table_.__emplace_multi(_STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator emplace(_A0&& __a0, _Args&&... __args);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -1378,15 +1350,15 @@ public:
|
||||
{return __table_.__emplace_hint_multi(__p.__i_);}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _A0&& __a0)
|
||||
{return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_A0>(__a0));}
|
||||
{return __table_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator emplace_hint(const_iterator __p, _A0&& __a0, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1394,28 +1366,26 @@ public:
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(_P&& __x)
|
||||
{return __table_.__insert_multi(_VSTD::forward<_P>(__x));}
|
||||
{return __table_.__insert_multi(_STD::forward<_P>(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, const value_type& __x)
|
||||
{return __table_.__insert_multi(__p.__i_, __x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _P,
|
||||
class = typename enable_if<is_constructible<value_type, _P>::value>::type>
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, _P&& __x)
|
||||
{return __table_.__insert_multi(__p.__i_, _VSTD::forward<_P>(__x));}
|
||||
{return __table_.__insert_multi(__p.__i_, _STD::forward<_P>(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
|
||||
@@ -1491,10 +1461,10 @@ public:
|
||||
private:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0, _Args&&... __args);
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0);
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
};
|
||||
@@ -1579,14 +1549,14 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
unordered_multimap&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_VSTD::move(__u.__table_))
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
unordered_multimap&& __u, const allocator_type& __a)
|
||||
: __table_(_VSTD::move(__u.__table_), __a)
|
||||
: __table_(_STD::move(__u.__table_), __a)
|
||||
{
|
||||
if (__a != __u.get_allocator())
|
||||
{
|
||||
@@ -1594,7 +1564,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
while (__u.size() != 0)
|
||||
{
|
||||
__table_.__insert_multi(
|
||||
_VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
|
||||
_STD::move(__u.__table_.remove((__i++).__i_)->__value_)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1602,8 +1572,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -1631,8 +1599,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
@@ -1641,14 +1607,12 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
|
||||
{
|
||||
__table_ = _VSTD::move(__u.__table_);
|
||||
__table_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
@@ -1659,14 +1623,12 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
>
|
||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
|
||||
@@ -1674,11 +1636,11 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
|
||||
_VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.first),
|
||||
_STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_.second),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
}
|
||||
@@ -1687,15 +1649,15 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0,
|
||||
class // = typename enable_if<is_constructible<value_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, value_type>::value>::type
|
||||
>
|
||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_),
|
||||
_VSTD::forward<_A0>(__a0));
|
||||
__node_traits::construct(__na, _STD::addressof(__h->__value_),
|
||||
_STD::forward<_A0>(__a0));
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return __h;
|
||||
@@ -1705,13 +1667,13 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
>
|
||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __table_.__node_insert_multi(__h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1719,14 +1681,14 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
>
|
||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
|
||||
const_iterator __p, _A0&& __a0, _Args&&... __args)
|
||||
{
|
||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__node_holder __h = __construct_node(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
iterator __r = __table_.__node_insert_multi(__p.__i_, __h.get());
|
||||
__h.release();
|
||||
return __r;
|
||||
@@ -1770,9 +1732,9 @@ operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
{
|
||||
_EqRng __xeq = __x.equal_range(__i->first);
|
||||
_EqRng __yeq = __y.equal_range(__i->first);
|
||||
if (_VSTD::distance(__xeq.first, __xeq.second) !=
|
||||
_VSTD::distance(__yeq.first, __yeq.second) ||
|
||||
!_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
if (_STD::distance(__xeq.first, __xeq.second) !=
|
||||
_STD::distance(__yeq.first, __yeq.second) ||
|
||||
!_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
return false;
|
||||
__i = __xeq.second;
|
||||
}
|
||||
|
@@ -365,7 +365,6 @@ public:
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_set(unordered_set&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_set(initializer_list<value_type> __il);
|
||||
unordered_set(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(),
|
||||
@@ -373,21 +372,13 @@ public:
|
||||
unordered_set(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf, const key_equal& __eql,
|
||||
const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
// ~unordered_set() = default;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set& operator=(const unordered_set& __u)
|
||||
{
|
||||
__table_ = __u.__table_;
|
||||
return *this;
|
||||
}
|
||||
// unordered_set& operator=(const unordered_set& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_set& operator=(unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_set& operator=(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
@@ -417,11 +408,11 @@ public:
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_Args&&... __args)
|
||||
{return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
|
||||
{return __table_.__emplace_unique(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator, _Args&&... __args)
|
||||
{return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;}
|
||||
{return __table_.__emplace_unique(_STD::forward<_Args>(__args)...).first;}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
@@ -429,7 +420,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(value_type&& __x)
|
||||
{return __table_.__insert_unique(_VSTD::move(__x));}
|
||||
{return __table_.__insert_unique(_STD::move(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x)
|
||||
@@ -437,15 +428,13 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, value_type&& __x)
|
||||
{return insert(_VSTD::move(__x)).first;}
|
||||
{return insert(_STD::move(__x)).first;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p);}
|
||||
@@ -594,27 +583,25 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_VSTD::move(__u.__table_))
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
unordered_set&& __u, const allocator_type& __a)
|
||||
: __table_(_VSTD::move(__u.__table_), __a)
|
||||
: __table_(_STD::move(__u.__table_), __a)
|
||||
{
|
||||
if (__a != __u.get_allocator())
|
||||
{
|
||||
iterator __i = __u.begin();
|
||||
while (__u.size() != 0)
|
||||
__table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
|
||||
__table_.__insert_unique(_STD::move(__u.__table_.remove(__i++)->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -642,8 +629,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
@@ -652,14 +637,12 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>&
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
|
||||
{
|
||||
__table_ = _VSTD::move(__u.__table_);
|
||||
__table_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>&
|
||||
@@ -670,8 +653,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -777,7 +758,6 @@ public:
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_multiset(initializer_list<value_type> __il);
|
||||
unordered_multiset(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(),
|
||||
@@ -785,21 +765,13 @@ public:
|
||||
unordered_multiset(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf, const key_equal& __eql,
|
||||
const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
// ~unordered_multiset() = default;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multiset& operator=(const unordered_multiset& __u)
|
||||
{
|
||||
__table_ = __u.__table_;
|
||||
return *this;
|
||||
}
|
||||
// unordered_multiset& operator=(const unordered_multiset& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multiset& operator=(unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
unordered_multiset& operator=(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
@@ -829,17 +801,17 @@ public:
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_Args&&... __args)
|
||||
{return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
|
||||
{return __table_.__emplace_multi(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
|
||||
{return __table_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
|
||||
iterator insert(value_type&& __x) {return __table_.__insert_multi(_STD::move(__x));}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, const value_type& __x)
|
||||
@@ -847,15 +819,13 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, value_type&& __x)
|
||||
{return __table_.__insert_multi(__p, _VSTD::move(__x));}
|
||||
{return __table_.__insert_multi(__p, _STD::move(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p);}
|
||||
@@ -1005,27 +975,25 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_VSTD::move(__u.__table_))
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
unordered_multiset&& __u, const allocator_type& __a)
|
||||
: __table_(_VSTD::move(__u.__table_), __a)
|
||||
: __table_(_STD::move(__u.__table_), __a)
|
||||
{
|
||||
if (__a != __u.get_allocator())
|
||||
{
|
||||
iterator __i = __u.begin();
|
||||
while (__u.size() != 0)
|
||||
__table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
|
||||
__table_.__insert_multi(_STD::move(__u.__table_.remove(__i++)->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -1053,8 +1021,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
@@ -1064,14 +1030,12 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
|
||||
{
|
||||
__table_ = _VSTD::move(__u.__table_);
|
||||
__table_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
|
||||
@@ -1082,8 +1046,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1119,9 +1081,9 @@ operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
{
|
||||
_EqRng __xeq = __x.equal_range(*__i);
|
||||
_EqRng __yeq = __y.equal_range(*__i);
|
||||
if (_VSTD::distance(__xeq.first, __xeq.second) !=
|
||||
_VSTD::distance(__yeq.first, __yeq.second) ||
|
||||
!_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
if (_STD::distance(__xeq.first, __xeq.second) !=
|
||||
_STD::distance(__yeq.first, __yeq.second) ||
|
||||
!_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
return false;
|
||||
__i = __xeq.second;
|
||||
}
|
||||
|
@@ -183,7 +183,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(_Tp (&__a)[_N], _Tp (&__b)[_N]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{
|
||||
_VSTD::swap_ranges(__a, __a + _N, __b);
|
||||
_STD::swap_ranges(__a, __a + _N, __b);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
@@ -200,7 +200,7 @@ const _Tp&
|
||||
#endif
|
||||
move_if_noexcept(_Tp& __x) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::move(__x);
|
||||
return _STD::move(__x);
|
||||
}
|
||||
|
||||
struct _LIBCPP_VISIBLE piecewise_construct_t { };
|
||||
@@ -226,27 +226,13 @@ struct _LIBCPP_VISIBLE pair
|
||||
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(const pair<_U1, _U2>& __p
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
,typename enable_if<is_constructible<_T1, _U1>::value &&
|
||||
is_constructible<_T2, _U2>::value>::type* = 0
|
||||
#endif
|
||||
)
|
||||
pair(const pair<_U1, _U2>& __p,
|
||||
typename enable_if<is_convertible<_U1, _T1>::value &&
|
||||
is_convertible<_U2, _T2>::value>::type* = 0)
|
||||
: first(__p.first), second(__p.second) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(const pair& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
|
||||
is_nothrow_copy_constructible<second_type>::value)
|
||||
: first(__p.first),
|
||||
second(__p.second)
|
||||
{
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair& operator=(const pair& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value &&
|
||||
is_nothrow_copy_assignable<second_type>::value)
|
||||
{
|
||||
first = __p.first;
|
||||
second = __p.second;
|
||||
@@ -256,37 +242,29 @@ struct _LIBCPP_VISIBLE pair
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _U1, class _U2,
|
||||
class = typename enable_if<is_constructible<first_type, _U1 >::value &&
|
||||
is_constructible<second_type, _U2>::value>::type>
|
||||
class = typename enable_if<is_convertible<_U1, first_type >::value &&
|
||||
is_convertible<_U2, second_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(_U1&& __u1, _U2&& __u2)
|
||||
: first(_VSTD::forward<_U1>(__u1)),
|
||||
second(_VSTD::forward<_U2>(__u2))
|
||||
: first(_STD::forward<_U1>(__u1)),
|
||||
second(_STD::forward<_U2>(__u2))
|
||||
{}
|
||||
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(pair<_U1, _U2>&& __p,
|
||||
typename enable_if<is_constructible<_T1, _U1>::value &&
|
||||
is_constructible<_T2, _U2>::value>::type* = 0)
|
||||
: first(_VSTD::forward<_U1>(__p.first)),
|
||||
second(_VSTD::forward<_U2>(__p.second)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(pair&& __p) _NOEXCEPT_(is_nothrow_move_constructible<first_type>::value &&
|
||||
is_nothrow_move_constructible<second_type>::value)
|
||||
: first(_VSTD::forward<first_type>(__p.first)),
|
||||
second(_VSTD::forward<second_type>(__p.second))
|
||||
{
|
||||
}
|
||||
typename enable_if<is_convertible<_U1, _T1>::value &&
|
||||
is_convertible<_U2, _T2>::value>::type* = 0)
|
||||
: first(_STD::forward<_U1>(__p.first)),
|
||||
second(_STD::forward<_U2>(__p.second)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair&
|
||||
operator=(pair&& __p) _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
|
||||
is_nothrow_move_assignable<second_type>::value)
|
||||
{
|
||||
first = _VSTD::forward<first_type>(__p.first);
|
||||
second = _VSTD::forward<second_type>(__p.second);
|
||||
first = _STD::forward<first_type>(__p.first);
|
||||
second = _STD::forward<second_type>(__p.second);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -296,9 +274,9 @@ struct _LIBCPP_VISIBLE pair
|
||||
class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(_Tuple&& __p)
|
||||
: first(_VSTD::forward<typename tuple_element<0,
|
||||
: first(_STD::forward<typename tuple_element<0,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(get<0>(__p))),
|
||||
second(_VSTD::forward<typename tuple_element<1,
|
||||
second(_STD::forward<typename tuple_element<1,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(get<1>(__p)))
|
||||
{}
|
||||
|
||||
@@ -322,8 +300,8 @@ struct _LIBCPP_VISIBLE pair
|
||||
typedef typename __make_tuple_types<_Tuple>::type _TupleRef;
|
||||
typedef typename tuple_element<0, _TupleRef>::type _U0;
|
||||
typedef typename tuple_element<1, _TupleRef>::type _U1;
|
||||
first = _VSTD::forward<_U0>(_VSTD::get<0>(__p));
|
||||
second = _VSTD::forward<_U1>(_VSTD::get<1>(__p));
|
||||
first = _STD::forward<_U0>(_STD::get<0>(__p));
|
||||
second = _STD::forward<_U1>(_STD::get<1>(__p));
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -335,8 +313,8 @@ struct _LIBCPP_VISIBLE pair
|
||||
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
|
||||
__is_nothrow_swappable<second_type>::value)
|
||||
{
|
||||
_VSTD::iter_swap(&first, &__p.first);
|
||||
_VSTD::iter_swap(&second, &__p.second);
|
||||
_STD::iter_swap(&first, &__p.first);
|
||||
_STD::iter_swap(&second, &__p.second);
|
||||
}
|
||||
private:
|
||||
|
||||
@@ -440,7 +418,7 @@ pair<typename __make_pair_return<_T1>::type, typename __make_pair_return<_T2>::t
|
||||
make_pair(_T1&& __t1, _T2&& __t2)
|
||||
{
|
||||
return pair<typename __make_pair_return<_T1>::type, typename __make_pair_return<_T2>::type>
|
||||
(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
|
||||
(_STD::forward<_T1>(__t1), _STD::forward<_T2>(__t2));
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -516,7 +494,7 @@ struct __get_pair<0>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_T1&&
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _STD::forward<_T1>(__p.first);}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
};
|
||||
@@ -542,7 +520,7 @@ struct __get_pair<1>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_T2&&
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _STD::forward<_T2>(__p.second);}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
};
|
||||
@@ -570,7 +548,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT
|
||||
{
|
||||
return __get_pair<_Ip>::get(_VSTD::move(__p));
|
||||
return __get_pair<_Ip>::get(_STD::move(__p));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@@ -798,10 +798,8 @@ public:
|
||||
valarray(const valarray& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
valarray(valarray&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
valarray(initializer_list<value_type> __il);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
valarray(const slice_array<value_type>& __sa);
|
||||
valarray(const gslice_array<value_type>& __ga);
|
||||
valarray(const mask_array<value_type>& __ma);
|
||||
@@ -812,17 +810,13 @@ public:
|
||||
valarray& operator=(const valarray& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
valarray& operator=(valarray&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
valarray& operator=(initializer_list<value_type>);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
valarray& operator=(const value_type& __x);
|
||||
valarray& operator=(const slice_array<value_type>& __sa);
|
||||
valarray& operator=(const gslice_array<value_type>& __ga);
|
||||
valarray& operator=(const mask_array<value_type>& __ma);
|
||||
valarray& operator=(const indirect_array<value_type>& __ia);
|
||||
template <class _ValExpr>
|
||||
valarray& operator=(const __val_expr<_ValExpr>& __v);
|
||||
|
||||
// element access:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2712,10 +2706,6 @@ valarray<_Tp>::valarray(valarray&& __v)
|
||||
__v.__begin_ = __v.__end_ = nullptr;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp>
|
||||
valarray<_Tp>::valarray(initializer_list<value_type> __il)
|
||||
: __begin_(0),
|
||||
@@ -2742,7 +2732,7 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp>
|
||||
valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
|
||||
@@ -2872,7 +2862,7 @@ valarray<_Tp>::operator=(const valarray& __v)
|
||||
{
|
||||
if (size() != __v.size())
|
||||
resize(__v.size());
|
||||
_VSTD::copy(__v.__begin_, __v.__end_, __begin_);
|
||||
_STD::copy(__v.__begin_, __v.__end_, __begin_);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -2892,10 +2882,6 @@ valarray<_Tp>::operator=(valarray&& __v)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
valarray<_Tp>&
|
||||
@@ -2903,18 +2889,18 @@ valarray<_Tp>::operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
if (size() != __il.size())
|
||||
resize(__il.size());
|
||||
_VSTD::copy(__il.begin(), __il.end(), __begin_);
|
||||
_STD::copy(__il.begin(), __il.end(), __begin_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
valarray<_Tp>&
|
||||
valarray<_Tp>::operator=(const value_type& __x)
|
||||
{
|
||||
_VSTD::fill(__begin_, __end_, __x);
|
||||
_STD::fill(__begin_, __end_, __x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -2972,21 +2958,6 @@ valarray<_Tp>::operator=(const indirect_array<value_type>& __ia)
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _ValExpr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
valarray<_Tp>&
|
||||
valarray<_Tp>::operator=(const __val_expr<_ValExpr>& __v)
|
||||
{
|
||||
size_t __n = __v.size();
|
||||
if (size() != __n)
|
||||
resize(__n);
|
||||
value_type* __t = __begin_;
|
||||
for (size_t __i = 0; __i != __n; ++__t, ++__i)
|
||||
*__t = result_type(__v[__i]);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__val_expr<__slice_expr<const valarray<_Tp>&> >
|
||||
@@ -3444,8 +3415,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
valarray<_Tp>::swap(valarray& __v)
|
||||
{
|
||||
_VSTD::swap(__begin_, __v.__begin_);
|
||||
_VSTD::swap(__end_, __v.__end_);
|
||||
_STD::swap(__begin_, __v.__begin_);
|
||||
_STD::swap(__end_, __v.__end_);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
@@ -3469,7 +3440,7 @@ valarray<_Tp>::min() const
|
||||
{
|
||||
if (__begin_ == __end_)
|
||||
return value_type();
|
||||
return *_VSTD::min_element(__begin_, __end_);
|
||||
return *_STD::min_element(__begin_, __end_);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
@@ -3479,7 +3450,7 @@ valarray<_Tp>::max() const
|
||||
{
|
||||
if (__begin_ == __end_)
|
||||
return value_type();
|
||||
return *_VSTD::max_element(__begin_, __end_);
|
||||
return *_STD::max_element(__begin_, __end_);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
@@ -3498,14 +3469,14 @@ valarray<_Tp>::shift(int __i) const
|
||||
value_type* __te;
|
||||
if (__i >= 0)
|
||||
{
|
||||
__i = _VSTD::min(__i, static_cast<int>(__n));
|
||||
__i = _STD::min(__i, static_cast<int>(__n));
|
||||
__sb = __begin_ + __i;
|
||||
__tb = __r.__begin_;
|
||||
__te = __r.__begin_ + (__n - __i);
|
||||
}
|
||||
else
|
||||
{
|
||||
__i = _VSTD::min(-__i, static_cast<int>(__n));
|
||||
__i = _STD::min(-__i, static_cast<int>(__n));
|
||||
__sb = __begin_;
|
||||
__tb = __r.__begin_ + __i;
|
||||
__te = __r.__begin_ + __n;
|
||||
|
494
include/vector
494
include/vector
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,9 @@
|
||||
# Get sources
|
||||
file(GLOB sources ../src/*.cpp)
|
||||
if(WIN32)
|
||||
file(GLOB win32_sources ../src/support/win32/*.cpp)
|
||||
list(APPEND sources ${win32_sources})
|
||||
endif()
|
||||
file(GLOB_RECURSE sources ../src/*.cpp)
|
||||
|
||||
# Add all the headers to the project for IDEs.
|
||||
if (MSVC_IDE OR XCODE)
|
||||
file(GLOB_RECURSE headers ../include/*)
|
||||
if(WIN32)
|
||||
file( GLOB win32_headers ../include/support/win32/*.h)
|
||||
list(APPEND headers ${win32_headers})
|
||||
endif()
|
||||
# Force them all into the headers dir on MSVC, otherwise they end up at
|
||||
# project scope because they don't have extensions.
|
||||
if (MSVC_IDE)
|
||||
|
26
lib/buildit
26
lib/buildit
@@ -26,7 +26,7 @@ if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
if [ -z $IPHONEOS_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.7
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -35,7 +35,7 @@ then
|
||||
RC_ProjectSourceVersion=1
|
||||
fi
|
||||
|
||||
EXTRA_FLAGS="-std=c++0x"
|
||||
EXTRA_FLAGS="-std=c++0x "
|
||||
|
||||
case $TRIPLE in
|
||||
*-apple-*)
|
||||
@@ -70,23 +70,14 @@ case $TRIPLE in
|
||||
fi
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs \
|
||||
-current_version ${RC_ProjectSourceVersion} \
|
||||
-compatibility_version 1 \
|
||||
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.1.dylib \
|
||||
-lSystem \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
${RE_EXPORT_LINE} \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp \
|
||||
-Wl,-force_symbols_weak_list,weak.exp"
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp "
|
||||
fi
|
||||
;;
|
||||
*-*-mingw*)
|
||||
# FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
|
||||
SOEXT=dll
|
||||
LDSHARED_FLAGS="-o libc++.dll \
|
||||
-shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++.dll.a \
|
||||
-lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
|
||||
;;
|
||||
*)
|
||||
RC_CFLAGS="-fPIC"
|
||||
SOEXT=so
|
||||
@@ -106,13 +97,8 @@ set -x
|
||||
for FILE in ../src/*.cpp; do
|
||||
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -nostdinc++ -I../include $FILE
|
||||
done
|
||||
case $TRIPLE in
|
||||
*-*-mingw*)
|
||||
for FILE in ../src/support/win32/*.cpp; do
|
||||
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -nostdinc++ -I../include $FILE
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
|
||||
|
||||
#libtool -static -o libc++.a *.o
|
||||
|
16
lib/weak.exp
16
lib/weak.exp
@@ -1,16 +0,0 @@
|
||||
__ZTISt10bad_typeid
|
||||
__ZTISt11logic_error
|
||||
__ZTISt11range_error
|
||||
__ZTISt12domain_error
|
||||
__ZTISt12length_error
|
||||
__ZTISt12out_of_range
|
||||
__ZTISt13bad_exception
|
||||
__ZTISt13runtime_error
|
||||
__ZTISt14overflow_error
|
||||
__ZTISt15underflow_error
|
||||
__ZTISt16invalid_argument
|
||||
__ZTISt16nested_exception
|
||||
__ZTISt20bad_array_new_length
|
||||
__ZTISt8bad_cast
|
||||
__ZTISt9bad_alloc
|
||||
__ZTISt9exception
|
484
src/debug.cpp
484
src/debug.cpp
@@ -1,484 +0,0 @@
|
||||
//===-------------------------- debug.cpp ---------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define _LIBCPP_DEBUG2 1
|
||||
#include "__config"
|
||||
#include "__debug"
|
||||
#include "functional"
|
||||
#include "algorithm"
|
||||
#include "__hash_table"
|
||||
#include "mutex"
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
__libcpp_db*
|
||||
__get_db()
|
||||
{
|
||||
static __libcpp_db db;
|
||||
return &db;
|
||||
};
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
const __libcpp_db*
|
||||
__get_const_db()
|
||||
{
|
||||
return __get_db();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
typedef mutex mutex_type;
|
||||
typedef lock_guard<mutex_type> WLock;
|
||||
typedef lock_guard<mutex_type> RLock;
|
||||
|
||||
mutex_type&
|
||||
mut()
|
||||
{
|
||||
static mutex_type m;
|
||||
return m;
|
||||
}
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
__i_node::~__i_node()
|
||||
{
|
||||
if (__next_)
|
||||
{
|
||||
__next_->~__i_node();
|
||||
free(__next_);
|
||||
}
|
||||
}
|
||||
|
||||
__c_node::~__c_node()
|
||||
{
|
||||
free(beg_);
|
||||
if (__next_)
|
||||
{
|
||||
__next_->~__c_node();
|
||||
free(__next_);
|
||||
}
|
||||
}
|
||||
|
||||
__libcpp_db::__libcpp_db()
|
||||
: __cbeg_(nullptr),
|
||||
__cend_(nullptr),
|
||||
__csz_(0),
|
||||
__ibeg_(nullptr),
|
||||
__iend_(nullptr),
|
||||
__isz_(0)
|
||||
{
|
||||
}
|
||||
|
||||
__libcpp_db::~__libcpp_db()
|
||||
{
|
||||
if (__cbeg_)
|
||||
{
|
||||
for (__c_node** p = __cbeg_; p != __cend_; ++p)
|
||||
{
|
||||
if (*p != nullptr)
|
||||
{
|
||||
(*p)->~__c_node();
|
||||
free(*p);
|
||||
}
|
||||
}
|
||||
free(__cbeg_);
|
||||
}
|
||||
if (__ibeg_)
|
||||
{
|
||||
for (__i_node** p = __ibeg_; p != __iend_; ++p)
|
||||
{
|
||||
if (*p != nullptr)
|
||||
{
|
||||
(*p)->~__i_node();
|
||||
free(*p);
|
||||
}
|
||||
}
|
||||
free(__ibeg_);
|
||||
}
|
||||
}
|
||||
|
||||
void*
|
||||
__libcpp_db::__find_c_from_i(void* __i) const
|
||||
{
|
||||
RLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
_LIBCPP_ASSERT(i != nullptr, "iterator constructed in translation unit with debug mode not enabled."
|
||||
" #define _LIBCPP_DEBUG2 1 for that translation unit.");
|
||||
return i->__c_ != nullptr ? i->__c_->__c_ : nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::__insert_ic(void* __i, const void* __c)
|
||||
{
|
||||
WLock _(mut());
|
||||
__i_node* i = __insert_iterator(__i);
|
||||
const char* errmsg =
|
||||
"Container constructed in a translation unit with debug mode disabled."
|
||||
" But it is being used in a translation unit with debug mode enabled."
|
||||
" Enable it in the other translation unit with #define _LIBCPP_DEBUG2 1";
|
||||
_LIBCPP_ASSERT(__cbeg_ != __cend_, errmsg);
|
||||
size_t hc = hash<const void*>()(__c) % (__cend_ - __cbeg_);
|
||||
__c_node* c = __cbeg_[hc];
|
||||
_LIBCPP_ASSERT(c != nullptr, errmsg);
|
||||
while (c->__c_ != __c)
|
||||
{
|
||||
c = c->__next_;
|
||||
_LIBCPP_ASSERT(c != nullptr, errmsg);
|
||||
}
|
||||
c->__add(i);
|
||||
i->__c_ = c;
|
||||
}
|
||||
|
||||
__c_node*
|
||||
__libcpp_db::__insert_c(void* __c)
|
||||
{
|
||||
WLock _(mut());
|
||||
if (__csz_ + 1 > __cend_ - __cbeg_)
|
||||
{
|
||||
size_t nc = __next_prime(2*(__cend_ - __cbeg_) + 1);
|
||||
__c_node** cbeg = (__c_node**)calloc(nc, sizeof(void*));
|
||||
if (cbeg == nullptr)
|
||||
throw bad_alloc();
|
||||
for (__c_node** p = __cbeg_; p != __cend_; ++p)
|
||||
{
|
||||
__c_node* q = *p;
|
||||
while (q != nullptr)
|
||||
{
|
||||
size_t h = hash<void*>()(q->__c_) % nc;
|
||||
__c_node* r = q->__next_;
|
||||
q->__next_ = cbeg[h];
|
||||
cbeg[h] = q;
|
||||
q = r;
|
||||
}
|
||||
}
|
||||
free(__cbeg_);
|
||||
__cbeg_ = cbeg;
|
||||
__cend_ = __cbeg_ + nc;
|
||||
}
|
||||
size_t hc = hash<void*>()(__c) % (__cend_ - __cbeg_);
|
||||
__c_node* p = __cbeg_[hc];
|
||||
__c_node* r = __cbeg_[hc] = (__c_node*)malloc(sizeof(__c_node));
|
||||
if (__cbeg_[hc] == nullptr)
|
||||
throw bad_alloc();
|
||||
r->__c_ = __c;
|
||||
r->__next_ = p;
|
||||
++__csz_;
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::__erase_i(void* __i)
|
||||
{
|
||||
WLock _(mut());
|
||||
if (__ibeg_ != __iend_)
|
||||
{
|
||||
size_t hi = hash<void*>()(__i) % (__iend_ - __ibeg_);
|
||||
__i_node* p = __ibeg_[hi];
|
||||
if (p != nullptr)
|
||||
{
|
||||
__i_node* q = nullptr;
|
||||
while (p->__i_ != __i)
|
||||
{
|
||||
q = p;
|
||||
p = p->__next_;
|
||||
if (p == nullptr)
|
||||
return;
|
||||
}
|
||||
if (q == nullptr)
|
||||
__ibeg_[hi] = p->__next_;
|
||||
else
|
||||
q->__next_ = p->__next_;
|
||||
__c_node* c = p->__c_;
|
||||
free(p);
|
||||
--__isz_;
|
||||
if (c != nullptr)
|
||||
c->__remove(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::__invalidate_all(void* __c)
|
||||
{
|
||||
WLock _(mut());
|
||||
size_t hc = hash<void*>()(__c) % (__cend_ - __cbeg_);
|
||||
__c_node* p = __cbeg_[hc];
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __invalidate_all A");
|
||||
while (p->__c_ != __c)
|
||||
{
|
||||
p = p->__next_;
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __invalidate_all B");
|
||||
}
|
||||
while (p->end_ != p->beg_)
|
||||
{
|
||||
--p->end_;
|
||||
(*p->end_)->__c_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
__c_node*
|
||||
__libcpp_db::__find_c_and_lock(void* __c) const
|
||||
{
|
||||
mut().lock();
|
||||
size_t hc = hash<void*>()(__c) % (__cend_ - __cbeg_);
|
||||
__c_node* p = __cbeg_[hc];
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __find_c_and_lock A");
|
||||
while (p->__c_ != __c)
|
||||
{
|
||||
p = p->__next_;
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __find_c_and_lock B");
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
__c_node*
|
||||
__libcpp_db::__find_c(void* __c) const
|
||||
{
|
||||
size_t hc = hash<void*>()(__c) % (__cend_ - __cbeg_);
|
||||
__c_node* p = __cbeg_[hc];
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __find_c A");
|
||||
while (p->__c_ != __c)
|
||||
{
|
||||
p = p->__next_;
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __find_c B");
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::unlock() const
|
||||
{
|
||||
mut().unlock();
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::__erase_c(void* __c)
|
||||
{
|
||||
WLock _(mut());
|
||||
size_t hc = hash<void*>()(__c) % (__cend_ - __cbeg_);
|
||||
__c_node* p = __cbeg_[hc];
|
||||
__c_node* q = nullptr;
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __erase_c A");
|
||||
while (p->__c_ != __c)
|
||||
{
|
||||
q = p;
|
||||
p = p->__next_;
|
||||
_LIBCPP_ASSERT(p != nullptr, "debug mode internal logic error __erase_c B");
|
||||
}
|
||||
if (q == nullptr)
|
||||
__cbeg_[hc] = p->__next_;
|
||||
else
|
||||
q->__next_ = p->__next_;
|
||||
while (p->end_ != p->beg_)
|
||||
{
|
||||
--p->end_;
|
||||
(*p->end_)->__c_ = nullptr;
|
||||
}
|
||||
free(p->beg_);
|
||||
free(p);
|
||||
--__csz_;
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::__iterator_copy(void* __i, const void* __i0)
|
||||
{
|
||||
WLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
__i_node* i0 = __find_iterator(__i0);
|
||||
__c_node* c0 = i0 != nullptr ? i0->__c_ : nullptr;
|
||||
if (i == nullptr && c0 != nullptr)
|
||||
i = __insert_iterator(__i);
|
||||
__c_node* c = i != nullptr ? i->__c_ : nullptr;
|
||||
if (c != c0)
|
||||
{
|
||||
if (c != nullptr)
|
||||
c->__remove(i);
|
||||
if (i != nullptr)
|
||||
{
|
||||
i->__c_ = nullptr;
|
||||
if (c0 != nullptr)
|
||||
{
|
||||
i->__c_ = c0;
|
||||
i->__c_->__add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
__libcpp_db::__dereferenceable(const void* __i) const
|
||||
{
|
||||
RLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
return i != nullptr && i->__c_ != nullptr && i->__c_->__dereferenceable(__i);
|
||||
}
|
||||
|
||||
bool
|
||||
__libcpp_db::__decrementable(const void* __i) const
|
||||
{
|
||||
RLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
return i != nullptr && i->__c_ != nullptr && i->__c_->__decrementable(__i);
|
||||
}
|
||||
|
||||
bool
|
||||
__libcpp_db::__addable(const void* __i, ptrdiff_t __n) const
|
||||
{
|
||||
RLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
return i != nullptr && i->__c_ != nullptr && i->__c_->__addable(__i, __n);
|
||||
}
|
||||
|
||||
bool
|
||||
__libcpp_db::__subscriptable(const void* __i, ptrdiff_t __n) const
|
||||
{
|
||||
RLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
return i != nullptr && i->__c_ != nullptr && i->__c_->__subscriptable(__i, __n);
|
||||
}
|
||||
|
||||
bool
|
||||
__libcpp_db::__comparable(const void* __i, const void* __j) const
|
||||
{
|
||||
RLock _(mut());
|
||||
__i_node* i = __find_iterator(__i);
|
||||
__i_node* j = __find_iterator(__j);
|
||||
__c_node* ci = i != nullptr ? i->__c_ : nullptr;
|
||||
__c_node* cj = j != nullptr ? j->__c_ : nullptr;
|
||||
return ci != nullptr && ci == cj;
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::swap(void* c1, void* c2)
|
||||
{
|
||||
WLock _(mut());
|
||||
size_t hc = hash<void*>()(c1) % (__cend_ - __cbeg_);
|
||||
__c_node* p1 = __cbeg_[hc];
|
||||
_LIBCPP_ASSERT(p1 != nullptr, "debug mode internal logic error swap A");
|
||||
while (p1->__c_ != c1)
|
||||
{
|
||||
p1 = p1->__next_;
|
||||
_LIBCPP_ASSERT(p1 != nullptr, "debug mode internal logic error swap B");
|
||||
}
|
||||
hc = hash<void*>()(c2) % (__cend_ - __cbeg_);
|
||||
__c_node* p2 = __cbeg_[hc];
|
||||
_LIBCPP_ASSERT(p2 != nullptr, "debug mode internal logic error swap C");
|
||||
while (p2->__c_ != c2)
|
||||
{
|
||||
p2 = p2->__next_;
|
||||
_LIBCPP_ASSERT(p2 != nullptr, "debug mode internal logic error swap D");
|
||||
}
|
||||
std::swap(p1->beg_, p2->beg_);
|
||||
std::swap(p1->end_, p2->end_);
|
||||
std::swap(p1->cap_, p2->cap_);
|
||||
for (__i_node** p = p1->beg_; p != p1->end_; ++p)
|
||||
(*p)->__c_ = p1;
|
||||
for (__i_node** p = p2->beg_; p != p2->end_; ++p)
|
||||
(*p)->__c_ = p2;
|
||||
}
|
||||
|
||||
void
|
||||
__libcpp_db::__insert_i(void* __i)
|
||||
{
|
||||
WLock _(mut());
|
||||
__insert_iterator(__i);
|
||||
}
|
||||
|
||||
void
|
||||
__c_node::__add(__i_node* i)
|
||||
{
|
||||
if (end_ == cap_)
|
||||
{
|
||||
size_t nc = 2*(cap_ - beg_);
|
||||
if (nc == 0)
|
||||
nc = 1;
|
||||
__i_node** beg = (__i_node**)malloc(nc * sizeof(__i_node*));
|
||||
if (beg == nullptr)
|
||||
throw bad_alloc();
|
||||
if (nc > 1)
|
||||
memcpy(beg, beg_, nc/2*sizeof(__i_node*));
|
||||
free(beg_);
|
||||
beg_ = beg;
|
||||
end_ = beg_ + nc/2;
|
||||
cap_ = beg_ + nc;
|
||||
}
|
||||
*end_++ = i;
|
||||
}
|
||||
|
||||
// private api
|
||||
|
||||
_LIBCPP_HIDDEN
|
||||
__i_node*
|
||||
__libcpp_db::__insert_iterator(void* __i)
|
||||
{
|
||||
if (__isz_ + 1 > __iend_ - __ibeg_)
|
||||
{
|
||||
size_t nc = __next_prime(2*(__iend_ - __ibeg_) + 1);
|
||||
__i_node** ibeg = (__i_node**)calloc(nc, sizeof(void*));
|
||||
if (ibeg == nullptr)
|
||||
throw bad_alloc();
|
||||
for (__i_node** p = __ibeg_; p != __iend_; ++p)
|
||||
{
|
||||
__i_node* q = *p;
|
||||
while (q != nullptr)
|
||||
{
|
||||
size_t h = hash<void*>()(q->__i_) % nc;
|
||||
__i_node* r = q->__next_;
|
||||
q->__next_ = ibeg[h];
|
||||
ibeg[h] = q;
|
||||
q = r;
|
||||
}
|
||||
}
|
||||
free(__ibeg_);
|
||||
__ibeg_ = ibeg;
|
||||
__iend_ = __ibeg_ + nc;
|
||||
}
|
||||
size_t hi = hash<void*>()(__i) % (__iend_ - __ibeg_);
|
||||
__i_node* p = __ibeg_[hi];
|
||||
__i_node* r = __ibeg_[hi] = (__i_node*)malloc(sizeof(__i_node));
|
||||
if (r == nullptr)
|
||||
throw bad_alloc();
|
||||
::new(r) __i_node(__i, p, nullptr);
|
||||
++__isz_;
|
||||
return r;
|
||||
}
|
||||
|
||||
_LIBCPP_HIDDEN
|
||||
__i_node*
|
||||
__libcpp_db::__find_iterator(const void* __i) const
|
||||
{
|
||||
__i_node* r = nullptr;
|
||||
if (__ibeg_ != __iend_)
|
||||
{
|
||||
size_t h = hash<const void*>()(__i) % (__iend_ - __ibeg_);
|
||||
for (__i_node* nd = __ibeg_[h]; nd != nullptr; nd = nd->__next_)
|
||||
{
|
||||
if (nd->__i_ == __i)
|
||||
{
|
||||
r = nd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
_LIBCPP_HIDDEN
|
||||
void
|
||||
__c_node::__remove(__i_node* p)
|
||||
{
|
||||
__i_node** r = find(beg_, end_, p);
|
||||
_LIBCPP_ASSERT(r != end_, "debug mode internal logic error __c_node::__remove");
|
||||
if (--end_ != r)
|
||||
memmove(r, r+1, (end_ - r)*sizeof(__i_node*));
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
@@ -13,24 +13,16 @@
|
||||
#if __APPLE__
|
||||
#include <cxxabi.h>
|
||||
using namespace __cxxabiv1;
|
||||
using namespace __cxxabiapple;
|
||||
// On Darwin, there are two STL shared libraries and a lower level ABI
|
||||
// shared libray. The globals holding the current terminate handler and
|
||||
// current unexpected handler are in the ABI library.
|
||||
#define __terminate_handler __cxxabiapple::__cxa_terminate_handler
|
||||
#define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
|
||||
#define HAVE_DEPENDENT_EH_ABI 1
|
||||
#elif defined(LIBCXXRT)
|
||||
#include <cxxabi.h>
|
||||
using namespace __cxxabiv1;
|
||||
#define HAVE_DEPENDENT_EH_ABI 1
|
||||
#else // __APPLE__
|
||||
static std::terminate_handler __terminate_handler;
|
||||
static std::unexpected_handler __unexpected_handler;
|
||||
#endif // __APPLE__
|
||||
|
||||
#ifndef LIBCXXRT
|
||||
// libcxxrt provides implementations of these functions itself.
|
||||
std::unexpected_handler
|
||||
std::set_unexpected(std::unexpected_handler func) _NOEXCEPT
|
||||
{
|
||||
@@ -64,7 +56,6 @@ std::get_terminate() _NOEXCEPT
|
||||
return __sync_fetch_and_add(&__terminate_handler, (std::terminate_handler)0);
|
||||
}
|
||||
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
std::terminate() _NOEXCEPT
|
||||
{
|
||||
@@ -84,19 +75,18 @@ std::terminate() _NOEXCEPT
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
#endif // LIBCXXRT
|
||||
|
||||
bool std::uncaught_exception() _NOEXCEPT
|
||||
{
|
||||
#if __APPLE__
|
||||
// on Darwin, there is a helper function so __cxa_get_globals is private
|
||||
return __cxxabiapple::__cxa_uncaught_exception();
|
||||
#elif LIBCXXRT
|
||||
__cxa_eh_globals * globals = __cxa_get_globals();
|
||||
return (globals->uncaughtExceptions != 0);
|
||||
#else // __APPLE__
|
||||
#warning uncaught_exception not yet implemented
|
||||
::abort();
|
||||
// Not provided by Ubuntu gcc-4.2.4's cxxabi.h.
|
||||
// __cxa_eh_globals * globals = __cxa_get_globals();
|
||||
// return (globals->uncaughtExceptions != 0);
|
||||
#endif // __APPLE__
|
||||
}
|
||||
|
||||
@@ -123,8 +113,8 @@ const char* bad_exception::what() const _NOEXCEPT
|
||||
|
||||
exception_ptr::~exception_ptr() _NOEXCEPT
|
||||
{
|
||||
#if HAVE_DEPENDENT_EH_ABI
|
||||
__cxa_decrement_exception_refcount(__ptr_);
|
||||
#if __APPLE__
|
||||
__cxxabiapple::__cxa_decrement_exception_refcount(__ptr_);
|
||||
#else
|
||||
#warning exception_ptr not yet implemented
|
||||
::abort();
|
||||
@@ -134,8 +124,8 @@ exception_ptr::~exception_ptr() _NOEXCEPT
|
||||
exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
|
||||
: __ptr_(other.__ptr_)
|
||||
{
|
||||
#if HAVE_DEPENDENT_EH_ABI
|
||||
__cxa_increment_exception_refcount(__ptr_);
|
||||
#if __APPLE__
|
||||
__cxxabiapple::__cxa_increment_exception_refcount(__ptr_);
|
||||
#else
|
||||
#warning exception_ptr not yet implemented
|
||||
::abort();
|
||||
@@ -144,11 +134,11 @@ exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
|
||||
|
||||
exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
|
||||
{
|
||||
#if HAVE_DEPENDENT_EH_ABI
|
||||
#if __APPLE__
|
||||
if (__ptr_ != other.__ptr_)
|
||||
{
|
||||
__cxa_increment_exception_refcount(other.__ptr_);
|
||||
__cxa_decrement_exception_refcount(__ptr_);
|
||||
__cxxabiapple::__cxa_increment_exception_refcount(other.__ptr_);
|
||||
__cxxabiapple::__cxa_decrement_exception_refcount(__ptr_);
|
||||
__ptr_ = other.__ptr_;
|
||||
}
|
||||
return *this;
|
||||
@@ -180,12 +170,12 @@ nested_exception::rethrow_nested() const
|
||||
|
||||
std::exception_ptr std::current_exception() _NOEXCEPT
|
||||
{
|
||||
#if HAVE_DEPENDENT_EH_ABI
|
||||
#if __APPLE__
|
||||
// be nicer if there was a constructor that took a ptr, then
|
||||
// this whole function would be just:
|
||||
// return exception_ptr(__cxa_current_primary_exception());
|
||||
std::exception_ptr ptr;
|
||||
ptr.__ptr_ = __cxa_current_primary_exception();
|
||||
ptr.__ptr_ = __cxxabiapple::__cxa_current_primary_exception();
|
||||
return ptr;
|
||||
#else // __APPLE__
|
||||
#warning exception_ptr not yet implemented
|
||||
@@ -195,8 +185,8 @@ std::exception_ptr std::current_exception() _NOEXCEPT
|
||||
|
||||
void std::rethrow_exception(exception_ptr p)
|
||||
{
|
||||
#if HAVE_DEPENDENT_EH_ABI
|
||||
__cxa_rethrow_primary_exception(p.__ptr_);
|
||||
#if __APPLE__
|
||||
__cxxabiapple::__cxa_rethrow_primary_exception(p.__ptr_);
|
||||
// if p.__ptr_ is NULL, above returns so we terminate
|
||||
terminate();
|
||||
#else // __APPLE__
|
||||
|
@@ -59,10 +59,6 @@ future_error::future_error(error_code __ec)
|
||||
{
|
||||
}
|
||||
|
||||
future_error::~future_error() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
@@ -73,10 +69,8 @@ void
|
||||
__assoc_sub_state::set_value()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
__state_ |= __constructed | ready;
|
||||
__lk.unlock();
|
||||
__cv_.notify_all();
|
||||
@@ -86,10 +80,8 @@ void
|
||||
__assoc_sub_state::set_value_at_thread_exit()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
__state_ |= __constructed;
|
||||
__thread_local_data()->__make_ready_at_thread_exit(this);
|
||||
__lk.unlock();
|
||||
@@ -99,10 +91,8 @@ void
|
||||
__assoc_sub_state::set_exception(exception_ptr __p)
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
__exception_ = __p;
|
||||
__state_ |= ready;
|
||||
__lk.unlock();
|
||||
@@ -113,10 +103,8 @@ void
|
||||
__assoc_sub_state::set_exception_at_thread_exit(exception_ptr __p)
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
#endif
|
||||
__exception_ = __p;
|
||||
__thread_local_data()->__make_ready_at_thread_exit(this);
|
||||
__lk.unlock();
|
||||
@@ -167,18 +155,14 @@ __assoc_sub_state::__sub_wait(unique_lock<mutex>& __lk)
|
||||
void
|
||||
__assoc_sub_state::__execute()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
}
|
||||
|
||||
future<void>::future(__assoc_sub_state* __state)
|
||||
: __state_(__state)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_->__has_future_attached())
|
||||
throw future_error(make_error_code(future_errc::future_already_retrieved));
|
||||
#endif
|
||||
__state_->__add_shared();
|
||||
__state_->__set_future_attached();
|
||||
}
|
||||
@@ -218,50 +202,40 @@ promise<void>::~promise()
|
||||
future<void>
|
||||
promise<void>::get_future()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
return future<void>(__state_);
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_value()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value();
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_exception(exception_ptr __p)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_exception(__p);
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_value_at_thread_exit()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_value_at_thread_exit();
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_exception_at_thread_exit(exception_ptr __p)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
#endif
|
||||
__state_->set_exception_at_thread_exit(__p);
|
||||
}
|
||||
|
||||
|
38
src/ios.cpp
38
src/ios.cpp
@@ -165,7 +165,7 @@ ios_base::iword(int index)
|
||||
size_t newcap;
|
||||
const size_t mx = std::numeric_limits<size_t>::max();
|
||||
if (req_size < mx/2)
|
||||
newcap = _VSTD::max(2 * __iarray_cap_, req_size);
|
||||
newcap = _STD::max(2 * __iarray_cap_, req_size);
|
||||
else
|
||||
newcap = mx;
|
||||
long* iarray = (long*)realloc(__iarray_, newcap * sizeof(long));
|
||||
@@ -193,7 +193,7 @@ ios_base::pword(int index)
|
||||
size_t newcap;
|
||||
const size_t mx = std::numeric_limits<size_t>::max();
|
||||
if (req_size < mx/2)
|
||||
newcap = _VSTD::max(2 * __parray_cap_, req_size);
|
||||
newcap = _STD::max(2 * __parray_cap_, req_size);
|
||||
else
|
||||
newcap = mx;
|
||||
void** parray = (void**)realloc(__parray_, newcap * sizeof(void*));
|
||||
@@ -223,7 +223,7 @@ ios_base::register_callback(event_callback fn, int index)
|
||||
size_t newcap;
|
||||
const size_t mx = std::numeric_limits<size_t>::max();
|
||||
if (req_size < mx/2)
|
||||
newcap = _VSTD::max(2 * __event_cap_, req_size);
|
||||
newcap = _STD::max(2 * __event_cap_, req_size);
|
||||
else
|
||||
newcap = mx;
|
||||
event_callback* fns = (event_callback*)realloc(__fn_, newcap * sizeof(event_callback));
|
||||
@@ -403,24 +403,24 @@ ios_base::move(ios_base& rhs)
|
||||
void
|
||||
ios_base::swap(ios_base& rhs)
|
||||
{
|
||||
_VSTD::swap(__fmtflags_, rhs.__fmtflags_);
|
||||
_VSTD::swap(__precision_, rhs.__precision_);
|
||||
_VSTD::swap(__width_, rhs.__width_);
|
||||
_VSTD::swap(__rdstate_, rhs.__rdstate_);
|
||||
_VSTD::swap(__exceptions_, rhs.__exceptions_);
|
||||
_STD::swap(__fmtflags_, rhs.__fmtflags_);
|
||||
_STD::swap(__precision_, rhs.__precision_);
|
||||
_STD::swap(__width_, rhs.__width_);
|
||||
_STD::swap(__rdstate_, rhs.__rdstate_);
|
||||
_STD::swap(__exceptions_, rhs.__exceptions_);
|
||||
locale& lhs_loc = *(locale*)&__loc_;
|
||||
locale& rhs_loc = *(locale*)&rhs.__loc_;
|
||||
_VSTD::swap(lhs_loc, rhs_loc);
|
||||
_VSTD::swap(__fn_, rhs.__fn_);
|
||||
_VSTD::swap(__index_, rhs.__index_);
|
||||
_VSTD::swap(__event_size_, rhs.__event_size_);
|
||||
_VSTD::swap(__event_cap_, rhs.__event_cap_);
|
||||
_VSTD::swap(__iarray_, rhs.__iarray_);
|
||||
_VSTD::swap(__iarray_size_, rhs.__iarray_size_);
|
||||
_VSTD::swap(__iarray_cap_, rhs.__iarray_cap_);
|
||||
_VSTD::swap(__parray_, rhs.__parray_);
|
||||
_VSTD::swap(__parray_size_, rhs.__parray_size_);
|
||||
_VSTD::swap(__parray_cap_, rhs.__parray_cap_);
|
||||
_STD::swap(lhs_loc, rhs_loc);
|
||||
_STD::swap(__fn_, rhs.__fn_);
|
||||
_STD::swap(__index_, rhs.__index_);
|
||||
_STD::swap(__event_size_, rhs.__event_size_);
|
||||
_STD::swap(__event_cap_, rhs.__event_cap_);
|
||||
_STD::swap(__iarray_, rhs.__iarray_);
|
||||
_STD::swap(__iarray_size_, rhs.__iarray_size_);
|
||||
_STD::swap(__iarray_cap_, rhs.__iarray_cap_);
|
||||
_STD::swap(__parray_, rhs.__parray_);
|
||||
_STD::swap(__parray_size_, rhs.__parray_size_);
|
||||
_STD::swap(__parray_cap_, rhs.__parray_cap_);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -33,11 +33,11 @@ ios_base::Init __start_std_streams;
|
||||
ios_base::Init::Init()
|
||||
{
|
||||
cin.tie(&cout);
|
||||
_VSTD::unitbuf(cerr);
|
||||
_STD::unitbuf(cerr);
|
||||
cerr.tie(&cout);
|
||||
|
||||
wcin.tie(&wcout);
|
||||
_VSTD::unitbuf(wcerr);
|
||||
_STD::unitbuf(wcerr);
|
||||
wcerr.tie(&wcout);
|
||||
}
|
||||
|
||||
|
453
src/locale.cpp
453
src/locale.cpp
File diff suppressed because it is too large
Load Diff
@@ -28,9 +28,6 @@
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void *
|
||||
operator new(std::size_t size)
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
throw(std::bad_alloc)
|
||||
#endif
|
||||
{
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
@@ -74,9 +71,6 @@ operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void*
|
||||
operator new[](size_t size)
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
throw(std::bad_alloc)
|
||||
#endif
|
||||
{
|
||||
return ::operator new(size);
|
||||
}
|
||||
|
@@ -229,7 +229,7 @@ string
|
||||
__get_collation_name(const char* s)
|
||||
{
|
||||
const collationnames* i =
|
||||
_VSTD::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
|
||||
_STD::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
|
||||
string r;
|
||||
if (i != end(collatenames) && strcmp(s, i->elem_) == 0)
|
||||
r = char(i->char_);
|
||||
@@ -240,7 +240,7 @@ ctype_base::mask
|
||||
__get_classname(const char* s, bool __icase)
|
||||
{
|
||||
const classnames* i =
|
||||
_VSTD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
|
||||
_STD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
|
||||
ctype_base::mask r = 0;
|
||||
if (i != end(ClassNames) && strcmp(s, i->elem_) == 0)
|
||||
{
|
||||
|
@@ -11,9 +11,6 @@
|
||||
#include "cstdlib"
|
||||
#include "cwchar"
|
||||
#include "cerrno"
|
||||
#if _WIN32
|
||||
#include "support/win32/support.h"
|
||||
#endif // _WIN32
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
@@ -22,6 +19,52 @@ template class __basic_string_common<true>;
|
||||
template class basic_string<char>;
|
||||
template class basic_string<wchar_t>;
|
||||
|
||||
template enable_if<__is_forward_iterator<char const*>::value, void>::type
|
||||
basic_string<char, char_traits<char>, allocator<char> >
|
||||
::__init<char const*>(char const*, char const*);
|
||||
|
||||
template enable_if<__is_forward_iterator<wchar_t const*>::value, void>::type
|
||||
basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >
|
||||
::__init<wchar_t const*>(wchar_t const*, wchar_t const*);
|
||||
|
||||
template
|
||||
enable_if<__is_forward_iterator<char*>::value,
|
||||
basic_string<char, char_traits<char>, allocator<char> >&>::type
|
||||
basic_string<char, char_traits<char>, allocator<char> >::
|
||||
append<char*>(char*, char*);
|
||||
|
||||
template
|
||||
enable_if<__is_forward_iterator<wchar_t*>::value,
|
||||
basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&>::type
|
||||
basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >::
|
||||
append<wchar_t*>(wchar_t*, wchar_t*);
|
||||
|
||||
template
|
||||
enable_if<__is_forward_iterator<char const*>::value,
|
||||
string::iterator>::type
|
||||
string::
|
||||
insert<char const*>(string::const_iterator, char const*, char const*);
|
||||
|
||||
template
|
||||
enable_if<__is_forward_iterator<wchar_t const*>::value,
|
||||
wstring::iterator>::type
|
||||
wstring::
|
||||
insert<wchar_t const*>(wstring::const_iterator, wchar_t const*, wchar_t const*);
|
||||
|
||||
template
|
||||
enable_if<__is_input_iterator<char const*>::value, string&>::type
|
||||
string::
|
||||
replace<char const*>(string::const_iterator, string::const_iterator, char const*, char const*);
|
||||
|
||||
template
|
||||
enable_if<__is_input_iterator<wchar_t const*>::value, wstring&>::type
|
||||
wstring::
|
||||
replace<wchar_t const*>(wstring::const_iterator, wstring::const_iterator, wchar_t const*, wchar_t const*);
|
||||
|
||||
template
|
||||
enable_if<__is_forward_iterator<wchar_t*>::value, wstring&>::type
|
||||
wstring::assign<wchar_t*>(wchar_t*, wchar_t*);
|
||||
|
||||
template
|
||||
string
|
||||
operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
|
||||
|
@@ -100,6 +100,41 @@ strstreambuf::strstreambuf(const unsigned char* __gnext, streamsize __n)
|
||||
__init((char*)__gnext, __n, nullptr);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
strstreambuf::strstreambuf(strstreambuf&& __rhs)
|
||||
: streambuf(__rhs),
|
||||
__strmode_(__rhs.__strmode_),
|
||||
__alsize_(__rhs.__alsize_),
|
||||
__palloc_(__rhs.__palloc_),
|
||||
__pfree_(__rhs.__pfree_)
|
||||
{
|
||||
__rhs.setg(nullptr, nullptr, nullptr);
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
}
|
||||
|
||||
strstreambuf&
|
||||
strstreambuf::operator=(strstreambuf&& __rhs)
|
||||
{
|
||||
if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0)
|
||||
{
|
||||
if (__pfree_)
|
||||
__pfree_(eback());
|
||||
else
|
||||
delete [] eback();
|
||||
}
|
||||
streambuf::operator=(__rhs);
|
||||
__strmode_ = __rhs.__strmode_;
|
||||
__alsize_ = __rhs.__alsize_;
|
||||
__palloc_ = __rhs.__palloc_;
|
||||
__pfree_ = __rhs.__pfree_;
|
||||
__rhs.setg(nullptr, nullptr, nullptr);
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
strstreambuf::~strstreambuf()
|
||||
{
|
||||
if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0)
|
||||
@@ -115,10 +150,10 @@ void
|
||||
strstreambuf::swap(strstreambuf& __rhs)
|
||||
{
|
||||
streambuf::swap(__rhs);
|
||||
_VSTD::swap(__strmode_, __rhs.__strmode_);
|
||||
_VSTD::swap(__alsize_, __rhs.__alsize_);
|
||||
_VSTD::swap(__palloc_, __rhs.__palloc_);
|
||||
_VSTD::swap(__pfree_, __rhs.__pfree_);
|
||||
_STD::swap(__strmode_, __rhs.__strmode_);
|
||||
_STD::swap(__alsize_, __rhs.__alsize_);
|
||||
_STD::swap(__palloc_, __rhs.__palloc_);
|
||||
_STD::swap(__pfree_, __rhs.__pfree_);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -267,7 +302,7 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod
|
||||
{
|
||||
char* newpos = eback() + newoff;
|
||||
if (pos_in)
|
||||
setg(eback(), newpos, _VSTD::max(newpos, egptr()));
|
||||
setg(eback(), newpos, _STD::max(newpos, egptr()));
|
||||
if (pos_out)
|
||||
{
|
||||
// min(pbase, newpos), newpos, epptr()
|
||||
@@ -297,7 +332,7 @@ strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which)
|
||||
{
|
||||
char* newpos = eback() + newoff;
|
||||
if (pos_in)
|
||||
setg(eback(), newpos, _VSTD::max(newpos, egptr()));
|
||||
setg(eback(), newpos, _STD::max(newpos, egptr()));
|
||||
if (pos_out)
|
||||
{
|
||||
// min(pbase, newpos), newpos, epptr()
|
||||
|
@@ -1,94 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===-------------------- support/win32/locale_win32.cpp ------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "support/win32/locale_win32.h"
|
||||
|
||||
#include <stdarg.h> // va_start, va_end
|
||||
|
||||
// FIXME: base currently unused. Needs manual work to construct the new locale
|
||||
locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
|
||||
{
|
||||
return _create_locale( mask, locale );
|
||||
}
|
||||
locale_t uselocale( locale_t newloc )
|
||||
{
|
||||
locale_t old_locale = _get_current_locale();
|
||||
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
|
||||
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
|
||||
// uselocale sets all categories
|
||||
setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
|
||||
// uselocale returns the old locale_t
|
||||
return old_locale;
|
||||
}
|
||||
lconv *localeconv_l( locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return localeconv();
|
||||
}
|
||||
size_t mbrlen_l( const char *__restrict__ s, size_t n,
|
||||
mbstate_t *__restrict__ ps, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return mbrlen( s, n, ps );
|
||||
}
|
||||
size_t mbsrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t len, mbstate_t *__restrict__ ps, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return mbsrtowcs( dst, src, len, ps );
|
||||
}
|
||||
size_t wcrtomb_l( char *__restrict__ s, wchar_t wc, mbstate_t *__restrict__ ps,
|
||||
locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return wcrtomb( s, wc, ps );
|
||||
}
|
||||
size_t mbrtowc_l( wchar_t *__restrict__ pwc, const char *__restrict__ s,
|
||||
size_t n, mbstate_t *__restrict__ ps, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return mbrtowc( pwc, s, n, ps );
|
||||
}
|
||||
size_t mbsnrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t nms, size_t len, mbstate_t *__restrict__ ps, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return mbsnrtowcs( dst, src, nms, len, ps );
|
||||
}
|
||||
size_t wcsnrtombs_l( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return wcsnrtombs( dst, src, nwc, len, ps );
|
||||
}
|
||||
wint_t btowc_l( int c, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return btowc( c );
|
||||
}
|
||||
int wctob_l( wint_t c, locale_t loc )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return wctob( c );
|
||||
}
|
||||
|
||||
int asprintf_l( char **ret, locale_t loc, const char *format, ... )
|
||||
{
|
||||
va_list ap;
|
||||
va_start( ap, format );
|
||||
int result = vasprintf_l( ret, loc, format, ap );
|
||||
va_end(ap);
|
||||
return result;
|
||||
}
|
||||
int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap )
|
||||
{
|
||||
__locale_raii __current( uselocale(loc), uselocale );
|
||||
return vasprintf( ret, format, ap );
|
||||
}
|
@@ -1,70 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===----------------------- support/win32/support.h ----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <support/win32/support.h>
|
||||
#include <stdarg.h> // va_start, va_end
|
||||
#include <stddef.h> // size_t
|
||||
#include <stdlib.h> // malloc
|
||||
#include <stdio.h> // vsprintf, vsnprintf
|
||||
#include <string.h> // strcpy, wcsncpy
|
||||
|
||||
int asprintf(char **sptr, const char *__restrict__ fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int result = vasprintf(sptr, fmt, ap);
|
||||
va_end(ap);
|
||||
return result;
|
||||
}
|
||||
int vasprintf( char **sptr, const char *__restrict__ fmt, va_list ap )
|
||||
{
|
||||
*sptr = NULL;
|
||||
int count = vsnprintf( *sptr, 0, fmt, ap );
|
||||
if( (count >= 0) && ((*sptr = (char*)malloc(count+1)) != NULL) )
|
||||
{
|
||||
vsprintf( *sptr, fmt, ap );
|
||||
sptr[count] = '\0';
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
// FIXME: use wcrtomb and avoid copy
|
||||
// use mbsrtowcs which is available, first copy first nwc elements of src
|
||||
size_t mbsnrtowcs( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t nmc, size_t len, mbstate_t *__restrict__ ps )
|
||||
{
|
||||
char* local_src = new char[nmc+1];
|
||||
char* nmcsrc = local_src;
|
||||
strncpy( nmcsrc, *src, nmc );
|
||||
nmcsrc[nmc] = '\0';
|
||||
const size_t result = mbsrtowcs( dst, const_cast<const char **>(&nmcsrc), len, ps );
|
||||
// propagate error
|
||||
if( nmcsrc == NULL )
|
||||
*src = NULL;
|
||||
delete[] local_src;
|
||||
return result;
|
||||
}
|
||||
// FIXME: use wcrtomb and avoid copy
|
||||
// use wcsrtombs which is available, first copy first nwc elements of src
|
||||
size_t wcsnrtombs( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps )
|
||||
{
|
||||
wchar_t* local_src = new wchar_t[nwc];
|
||||
wchar_t* nwcsrc = local_src;
|
||||
wcsncpy(nwcsrc, *src, nwc);
|
||||
nwcsrc[nwc] = '\0';
|
||||
const size_t result = wcsrtombs( dst, const_cast<const wchar_t **>(&nwcsrc), len, ps );
|
||||
// propogate error
|
||||
if( nwcsrc == NULL )
|
||||
*src = NULL;
|
||||
delete[] nwcsrc;
|
||||
return result;
|
||||
}
|
@@ -147,7 +147,7 @@ system_error::__init(const error_code& ec, string what_arg)
|
||||
what_arg += ": ";
|
||||
what_arg += ec.message();
|
||||
}
|
||||
return _VSTD::move(what_arg);
|
||||
return _STD::move(what_arg);
|
||||
}
|
||||
|
||||
system_error::system_error(error_code ec, const string& what_arg)
|
||||
|
@@ -12,9 +12,7 @@
|
||||
#include "vector"
|
||||
#include "future"
|
||||
#include <sys/types.h>
|
||||
#if !_WIN32
|
||||
#include <sys/sysctl.h>
|
||||
#endif // _WIN32
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
int i = std::max({2, 3, 1});
|
||||
assert(i == 3);
|
||||
i = std::max({2, 1, 3});
|
||||
@@ -31,5 +31,5 @@ int main()
|
||||
assert(i == 3);
|
||||
i = std::max({1, 3, 2});
|
||||
assert(i == 3);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
@@ -19,7 +19,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
int i = std::max({2, 3, 1}, std::greater<int>());
|
||||
assert(i == 1);
|
||||
i = std::max({2, 1, 3}, std::greater<int>());
|
||||
@@ -32,5 +32,5 @@ int main()
|
||||
assert(i == 1);
|
||||
i = std::max({1, 3, 2}, std::greater<int>());
|
||||
assert(i == 1);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
@@ -18,7 +18,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
int i = std::min({2, 3, 1});
|
||||
assert(i == 1);
|
||||
i = std::min({2, 1, 3});
|
||||
@@ -31,5 +31,5 @@ int main()
|
||||
assert(i == 1);
|
||||
i = std::min({1, 3, 2});
|
||||
assert(i == 1);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
@@ -19,7 +19,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
int i = std::min({2, 3, 1}, std::greater<int>());
|
||||
assert(i == 3);
|
||||
i = std::min({2, 1, 3}, std::greater<int>());
|
||||
@@ -32,5 +32,5 @@ int main()
|
||||
assert(i == 3);
|
||||
i = std::min({1, 3, 2}, std::greater<int>());
|
||||
assert(i == 3);
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
@@ -18,12 +18,12 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)));
|
||||
assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)));
|
||||
assert((std::minmax({2, 1, 3}) == std::pair<int, int>(1, 3)));
|
||||
assert((std::minmax({2, 3, 1}) == std::pair<int, int>(1, 3)));
|
||||
assert((std::minmax({3, 1, 2}) == std::pair<int, int>(1, 3)));
|
||||
assert((std::minmax({3, 2, 1}) == std::pair<int, int>(1, 3)));
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
@@ -19,12 +19,12 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
assert((std::minmax({1, 2, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)));
|
||||
assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)));
|
||||
assert((std::minmax({2, 1, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)));
|
||||
assert((std::minmax({2, 3, 1}, std::greater<int>()) == std::pair<int, int>(3, 1)));
|
||||
assert((std::minmax({3, 1, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)));
|
||||
assert((std::minmax({3, 2, 1}, std::greater<int>()) == std::pair<int, int>(3, 1)));
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user