Compare commits
109 Commits
svn-tags/l
...
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 | ||
![]() |
8f5f2563aa | ||
![]() |
c7c3891199 | ||
![]() |
c28dbeee52 | ||
![]() |
58cd8231d8 | ||
![]() |
6a09441022 | ||
![]() |
04dae1df22 | ||
![]() |
5f2f14c5d2 | ||
![]() |
8b53768dac | ||
![]() |
b2e2a8f6f3 | ||
![]() |
7686add61e | ||
![]() |
d1d27a4afa | ||
![]() |
53f7d4cc62 | ||
![]() |
c560727d5e | ||
![]() |
b965fed10b | ||
![]() |
009b2c4583 | ||
![]() |
93f2764b16 | ||
![]() |
18884f4e9f | ||
![]() |
0a612b0891 | ||
![]() |
8790cabd86 | ||
![]() |
a12beb35e5 | ||
![]() |
aabf28721b | ||
![]() |
d737382dfd | ||
![]() |
083ba5f5ca | ||
![]() |
f0562af9dd | ||
![]() |
20eda8b563 | ||
![]() |
c983454d30 | ||
![]() |
c26fd8061e | ||
![]() |
a6119a86c5 | ||
![]() |
d5fed03778 | ||
![]() |
ad1a5cc5f0 | ||
![]() |
0687adca37 | ||
![]() |
0667433587 | ||
![]() |
756a1763d1 | ||
![]() |
603d2c0989 | ||
![]() |
1694d23e23 | ||
![]() |
10f25d2739 | ||
![]() |
a5e0121b8d | ||
![]() |
e9b2c2d669 | ||
![]() |
1e15fd1856 | ||
![]() |
19ce6a4792 | ||
![]() |
ed56921d6e | ||
![]() |
4b7a43da34 | ||
![]() |
8feadca3fa | ||
![]() |
1122fec973 | ||
![]() |
20542c0b94 | ||
![]() |
ef54251a84 | ||
![]() |
e003ce4899 | ||
![]() |
bd89e4b0dd | ||
![]() |
0148a838d0 | ||
![]() |
57cff290a4 | ||
![]() |
3dd965bdf9 | ||
![]() |
932209b344 | ||
![]() |
fead2e2de9 | ||
![]() |
6b9826b2dc | ||
![]() |
6cbf9f9b25 | ||
![]() |
97ecd64913 | ||
![]() |
ad935d583d | ||
![]() |
656bdc3667 | ||
![]() |
ed22f562e5 | ||
![]() |
941138f8c9 | ||
![]() |
496934a803 | ||
![]() |
37c53b6221 | ||
![]() |
5ec7f5a518 | ||
![]() |
e06b9965ad | ||
![]() |
f6cc833ae7 | ||
![]() |
783b810cae | ||
![]() |
a5a0ba86c8 | ||
![]() |
e80c36e27b | ||
![]() |
d515df2a50 | ||
![]() |
f1151efcb1 | ||
![]() |
2d01bf0665 | ||
![]() |
0a111118a6 | ||
![]() |
11a58a68e1 | ||
![]() |
6063ec176d | ||
![]() |
0cfa1f7cbd | ||
![]() |
9e604b442c | ||
![]() |
d5c2f255c5 | ||
![]() |
7bbce3c0e7 | ||
![]() |
6b41c6047b | ||
![]() |
5d37fb32d2 | ||
![]() |
3666695f0d | ||
![]() |
d982028b92 | ||
![]() |
ffadfd4c1e | ||
![]() |
c6e08d6c44 |
@@ -16,3 +16,7 @@ N: Marshall Clow
|
||||
E: marshall@idio.com
|
||||
E: mclow@qualcomm.com
|
||||
D: Minor patches and bug fixes.
|
||||
|
||||
N: Bjorn Reese
|
||||
E: breese@users.sourceforge.net
|
||||
D: Initial regex prototype
|
||||
|
26
Makefile
26
Makefile
@@ -9,6 +9,12 @@ OBJROOT=.
|
||||
SYMROOT=.
|
||||
export TRIPLE=-apple-
|
||||
|
||||
ifeq (,$(RC_INDIGO))
|
||||
INSTALL_PREFIX=""
|
||||
else
|
||||
INSTALL_PREFIX="$(SDKROOT)"
|
||||
endif
|
||||
|
||||
installsrc:: $(SRCROOT)
|
||||
|
||||
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
||||
@@ -20,19 +26,19 @@ clean::
|
||||
|
||||
installhdrs::
|
||||
|
||||
mkdir -p $(DSTROOT)/usr/include/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/usr/include/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/usr/include
|
||||
chmod 755 $(DSTROOT)/usr/include/c++/v1
|
||||
chmod 644 $(DSTROOT)/usr/include/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/usr/include/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/usr/include/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)
|
||||
|
||||
cd lib && ./buildit
|
||||
ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
mkdir -p $(DSTROOT)/usr/lib
|
||||
strip -S -o $(DSTROOT)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd $(DSTROOT)/usr/lib && ln -s libc++.1.dylib libc++.dylib
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib
|
||||
strip -S -o $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib && ln -s libc++.1.dylib libc++.dylib
|
||||
|
@@ -25,6 +25,7 @@ check_cxx_compiler_flag(/GR- LIBCXX_HAS_NO_GR_FLAG)
|
||||
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
|
||||
check_library_exists(c printf "" LIBCXX_HAS_C_LIB)
|
||||
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
|
||||
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
|
||||
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
|
||||
|
||||
# Check C++0x features
|
||||
|
@@ -38,11 +38,13 @@ class __bit_reference
|
||||
friend class __bit_const_reference<_C>;
|
||||
friend class __bit_iterator<_C, false>;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator ~() const {return !static_cast<bool>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
|
||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT
|
||||
{return !static_cast<bool>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference& operator=(bool __x)
|
||||
__bit_reference& operator=(bool __x) _NOEXCEPT
|
||||
{
|
||||
if (__x)
|
||||
*__seg_ |= __mask_;
|
||||
@@ -52,20 +54,22 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference& operator=(const __bit_reference& __x) {return operator=(static_cast<bool>(__x));}
|
||||
__bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT
|
||||
{return operator=(static_cast<bool>(__x));}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() {*__seg_ ^= __mask_;}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT
|
||||
{return __bit_iterator<_C, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference(__storage_pointer __s, __storage_type __m) : __seg_(__s), __mask_(__m) {}
|
||||
__bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
};
|
||||
|
||||
template <class _C, class _D>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(__bit_reference<_C> __x, __bit_reference<_D> __y)
|
||||
swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT
|
||||
{
|
||||
bool __t = __x;
|
||||
__x = __y;
|
||||
@@ -75,7 +79,7 @@ swap(__bit_reference<_C> __x, __bit_reference<_D> __y)
|
||||
template <class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(__bit_reference<_C> __x, bool& __y)
|
||||
swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT
|
||||
{
|
||||
bool __t = __x;
|
||||
__x = __y;
|
||||
@@ -85,7 +89,7 @@ swap(__bit_reference<_C> __x, bool& __y)
|
||||
template <class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(bool& __x, __bit_reference<_C> __y)
|
||||
swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT
|
||||
{
|
||||
bool __t = __x;
|
||||
__x = __y;
|
||||
@@ -109,16 +113,18 @@ class __bit_const_reference
|
||||
friend class __bit_iterator<_C, true>;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_const_reference(const __bit_reference<_C>& __x)
|
||||
__bit_const_reference(const __bit_reference<_C>& __x) _NOEXCEPT
|
||||
: __seg_(__x.__seg_), __mask_(__x.__mask_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
|
||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT
|
||||
{return __bit_iterator<_C, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_const_reference(__storage_pointer __s, __storage_type __m) : __seg_(__s), __mask_(__m) {}
|
||||
__bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
|
||||
__bit_const_reference& operator=(const __bit_const_reference& __x);
|
||||
};
|
||||
@@ -1057,12 +1063,14 @@ private:
|
||||
unsigned __ctz_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator(const __bit_iterator<_C, false>& __it)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator(const __bit_iterator<_C, false>& __it) _NOEXCEPT
|
||||
: __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return reference(__seg_, __storage_type(1) << __ctz_);}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
|
||||
{return reference(__seg_, __storage_type(1) << __ctz_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator& operator++()
|
||||
{
|
||||
@@ -1162,7 +1170,8 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator(__storage_pointer __s, unsigned __ctz) : __seg_(__s), __ctz_(__ctz) {}
|
||||
__bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
|
||||
: __seg_(__s), __ctz_(__ctz) {}
|
||||
|
||||
#if defined(__clang__)
|
||||
friend typename _C::__self;
|
||||
|
@@ -47,6 +47,11 @@
|
||||
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#endif // __FreeBSD__
|
||||
|
||||
#ifdef _WIN32
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
#endif // _WIN32
|
||||
|
||||
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
@@ -86,8 +91,9 @@
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#if !__has_feature(cxx_alias_templates)
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
#endif
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
#ifdef __linux__
|
||||
@@ -110,8 +116,10 @@ typedef __char32_t char32_t;
|
||||
#define _LIBCPP_HAS_NO_DECLTYPE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_attributes))
|
||||
#define _LIBCPP_HAS_NO_ATTRIBUTES
|
||||
#if __has_feature(cxx_attributes)
|
||||
# define _ATTRIBUTE(x) [[x]]
|
||||
#else
|
||||
# define _ATTRIBUTE(x) __attribute__ ((x))
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
@@ -138,6 +146,7 @@ typedef __char32_t char32_t;
|
||||
|
||||
#if !(__has_feature(cxx_auto_type))
|
||||
#define _LIBCPP_HAS_NO_AUTO_TYPE
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_variadic_templates))
|
||||
@@ -162,10 +171,20 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if (__has_feature(cxx_noexcept))
|
||||
# define _NOEXCEPT noexcept
|
||||
# define _NOEXCEPT_(x) noexcept(x)
|
||||
#else
|
||||
# define _NOEXCEPT throw()
|
||||
# define _NOEXCEPT_(x)
|
||||
#endif
|
||||
|
||||
// end defined(__clang__)
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
#define _ATTRIBUTE(x) __attribute__((x))
|
||||
|
||||
#if !__EXCEPTIONS
|
||||
#define _LIBCPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
@@ -173,6 +192,9 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
|
||||
#define _NOEXCEPT throw()
|
||||
#define _NOEXCEPT_(x)
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
@@ -281,161 +281,55 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile>
|
||||
|
||||
// __invoke
|
||||
|
||||
// first bullet
|
||||
// bullets 1 and 2
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return (_STD::forward<const _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return ((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
// bullets 3 and 4
|
||||
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype(_STD::forward<_A0>(__a0).*__f)
|
||||
{
|
||||
return (_STD::forward<volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return _STD::forward<_A0>(__a0).*__f;
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype((*_STD::forward<_A0>(__a0)).*__f)
|
||||
{
|
||||
return (_STD::forward<const volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (*_STD::forward<_A0>(__a0)).*__f;
|
||||
}
|
||||
|
||||
// second bullet
|
||||
// bullet 5
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _Args&& ...__args)
|
||||
-> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// third bullet
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
typename __apply_cv<_T1, _R>::type&&
|
||||
>::type
|
||||
__invoke(_R _T::* __f, _T1&& __t1)
|
||||
{
|
||||
return _STD::forward<_T1>(__t1).*__f;
|
||||
}
|
||||
|
||||
// forth bullet
|
||||
|
||||
template <class _T1, class _R, bool>
|
||||
struct __4th_helper
|
||||
{
|
||||
};
|
||||
|
||||
template <class _T1, class _R>
|
||||
struct __4th_helper<_T1, _R, true>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __4th_helper<_T1, _R,
|
||||
!is_base_of<_T,
|
||||
typename remove_reference<_T1>::type
|
||||
>::value
|
||||
>::type&&
|
||||
__invoke(_R _T::* __f, _T1&& __t1)
|
||||
{
|
||||
return (*_STD::forward<_T1>(__t1)).*__f;
|
||||
}
|
||||
|
||||
// fifth bullet
|
||||
|
||||
template <class _F, class ..._T>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename result_of<_F(_T...)>::type
|
||||
__invoke(_F&& __f, _T&& ...__t)
|
||||
{
|
||||
return _STD::forward<_F>(__f)(_STD::forward<_T>(__t)...);
|
||||
return _STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _Tp, class ..._Args>
|
||||
@@ -456,19 +350,19 @@ private:
|
||||
|
||||
public:
|
||||
// construct/copy/destroy
|
||||
_LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) : __f_(&__f) {}
|
||||
_LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT : __f_(&__f) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
|
||||
#endif
|
||||
|
||||
// access
|
||||
_LIBCPP_INLINE_VISIBILITY operator type& () const {return *__f_;}
|
||||
_LIBCPP_INLINE_VISIBILITY type& get() const {return *__f_;}
|
||||
_LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
|
||||
_LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
|
||||
|
||||
// invoke
|
||||
template <class... _ArgTypes>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return<type&, _ArgTypes...>::type
|
||||
typename __invoke_of<type&, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args) const
|
||||
{
|
||||
return __invoke(get(), _STD::forward<_ArgTypes>(__args)...);
|
||||
@@ -483,7 +377,7 @@ template <class _Tp> struct __is_reference_wrapper
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<_Tp>
|
||||
ref(_Tp& __t)
|
||||
ref(_Tp& __t) _NOEXCEPT
|
||||
{
|
||||
return reference_wrapper<_Tp>(__t);
|
||||
}
|
||||
@@ -491,7 +385,7 @@ ref(_Tp& __t)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<_Tp>
|
||||
ref(reference_wrapper<_Tp> __t)
|
||||
ref(reference_wrapper<_Tp> __t) _NOEXCEPT
|
||||
{
|
||||
return ref(__t.get());
|
||||
}
|
||||
@@ -499,7 +393,7 @@ ref(reference_wrapper<_Tp> __t)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<const _Tp>
|
||||
cref(const _Tp& __t)
|
||||
cref(const _Tp& __t) _NOEXCEPT
|
||||
{
|
||||
return reference_wrapper<const _Tp>(__t);
|
||||
}
|
||||
@@ -507,7 +401,7 @@ cref(const _Tp& __t)
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<const _Tp>
|
||||
cref(reference_wrapper<_Tp> __t)
|
||||
cref(reference_wrapper<_Tp> __t) _NOEXCEPT
|
||||
{
|
||||
return cref(__t.get());
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ struct __hash_node_base
|
||||
|
||||
_NodePtr __next_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_node_base() : __next_(nullptr) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_node_base() _NOEXCEPT : __next_(nullptr) {}
|
||||
};
|
||||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_iterator(__node_pointer __node)
|
||||
__hash_iterator(__node_pointer __node) _NOEXCEPT
|
||||
: __node_(__node)
|
||||
{}
|
||||
|
||||
@@ -154,9 +154,9 @@ public:
|
||||
__non_const_node_pointer;
|
||||
typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_iterator(const __non_const_iterator& __x)
|
||||
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
|
||||
: __node_(__x.__node_)
|
||||
{}
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_iterator(__node_pointer __node)
|
||||
__hash_const_iterator(__node_pointer __node) _NOEXCEPT
|
||||
: __node_(__node)
|
||||
{}
|
||||
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_local_iterator(__node_pointer __node, size_t __bucket,
|
||||
size_t __bucket_count)
|
||||
size_t __bucket_count) _NOEXCEPT
|
||||
: __node_(__node),
|
||||
__bucket_(__bucket),
|
||||
__bucket_count_(__bucket_count)
|
||||
@@ -308,9 +308,9 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_local_iterator(const __non_const_iterator& __x)
|
||||
__hash_const_local_iterator(const __non_const_iterator& __x) _NOEXCEPT
|
||||
: __node_(__x.__node_),
|
||||
__bucket_(__x.__bucket_),
|
||||
__bucket_count_(__x.__bucket_count_)
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_local_iterator(__node_pointer __node, size_t __bucket,
|
||||
size_t __bucket_count)
|
||||
size_t __bucket_count) _NOEXCEPT
|
||||
: __node_(__node),
|
||||
__bucket_(__bucket),
|
||||
__bucket_count_(__bucket_count)
|
||||
@@ -374,16 +374,19 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
: __data_(0) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator(const allocator_type& __a, size_type __size)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
|
||||
: __data_(__size, __a) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator(__bucket_list_deallocator&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __data_(_STD::move(__x.__data_))
|
||||
{
|
||||
__x.size() = 0;
|
||||
@@ -391,14 +394,18 @@ public:
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type& size() {return __data_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return __data_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type& __alloc() {return __data_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const allocator_type& __alloc() const {return __data_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& size() _NOEXCEPT {return __data_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __data_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
allocator_type& __alloc() _NOEXCEPT {return __data_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const allocator_type& __alloc() const _NOEXCEPT {return __data_.second();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
__alloc_traits::deallocate(__alloc(), __p, size());
|
||||
}
|
||||
@@ -424,13 +431,13 @@ public:
|
||||
bool __value_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_node_destructor(allocator_type& __na)
|
||||
explicit __hash_node_destructor(allocator_type& __na) _NOEXCEPT
|
||||
: __na_(__na),
|
||||
__value_constructed(false)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__value_constructed)
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
|
||||
@@ -495,21 +502,32 @@ private:
|
||||
__compressed_pair<float, key_equal> __p3_;
|
||||
// --- Member data end ---
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type& size() {return __p2_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& size() _NOEXCEPT {return __p2_.first();}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return __p2_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __p2_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY hasher& hash_function() {return __p2_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const hasher& hash_function() const {return __p2_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher& hash_function() _NOEXCEPT {return __p2_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const hasher& hash_function() const _NOEXCEPT {return __p2_.second();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY float& max_load_factor() {return __p3_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY float max_load_factor() const {return __p3_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float& max_load_factor() _NOEXCEPT {return __p3_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const _NOEXCEPT {return __p3_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY key_equal& key_eq() {return __p3_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const key_equal& key_eq() const {return __p3_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal& key_eq() _NOEXCEPT {return __p3_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const key_equal& key_eq() const _NOEXCEPT {return __p3_.second();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __node_allocator& __node_alloc() {return __p1_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const __node_allocator& __node_alloc() const {return __p1_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_allocator& __node_alloc() _NOEXCEPT {return __p1_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __node_alloc() const _NOEXCEPT
|
||||
{return __p1_.second();}
|
||||
|
||||
public:
|
||||
typedef __hash_iterator<__node_pointer> iterator;
|
||||
@@ -517,7 +535,13 @@ public:
|
||||
typedef __hash_local_iterator<__node_pointer> local_iterator;
|
||||
typedef __hash_const_local_iterator<__node_const_pointer> const_local_iterator;
|
||||
|
||||
__hash_table();
|
||||
__hash_table()
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<__bucket_list>::value &&
|
||||
is_nothrow_default_constructible<__first_node>::value &&
|
||||
is_nothrow_default_constructible<__node_allocator>::value &&
|
||||
is_nothrow_default_constructible<hasher>::value &&
|
||||
is_nothrow_default_constructible<key_equal>::value);
|
||||
__hash_table(const hasher& __hf, const key_equal& __eql);
|
||||
__hash_table(const hasher& __hf, const key_equal& __eql,
|
||||
const allocator_type& __a);
|
||||
@@ -525,14 +549,25 @@ public:
|
||||
__hash_table(const __hash_table& __u);
|
||||
__hash_table(const __hash_table& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__hash_table(__hash_table&& __u);
|
||||
__hash_table(__hash_table&& __u)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_constructible<__bucket_list>::value &&
|
||||
is_nothrow_move_constructible<__first_node>::value &&
|
||||
is_nothrow_move_constructible<__node_allocator>::value &&
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value);
|
||||
__hash_table(__hash_table&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
~__hash_table();
|
||||
|
||||
__hash_table& operator=(const __hash_table& __u);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__hash_table& operator=(__hash_table&& __u);
|
||||
__hash_table& operator=(__hash_table&& __u)
|
||||
_NOEXCEPT_(
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value);
|
||||
#endif
|
||||
template <class _InputIterator>
|
||||
void __assign_unique(_InputIterator __first, _InputIterator __last);
|
||||
@@ -540,7 +575,7 @@ public:
|
||||
void __assign_multi(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const
|
||||
size_type max_size() const _NOEXCEPT
|
||||
{
|
||||
return allocator_traits<__pointer_allocator>::max_size(
|
||||
__bucket_list_.get_deleter().__alloc());
|
||||
@@ -577,21 +612,21 @@ public:
|
||||
iterator __insert_multi(const_iterator __p, const value_type& __x);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
void clear();
|
||||
void clear() _NOEXCEPT;
|
||||
void rehash(size_type __n);
|
||||
_LIBCPP_INLINE_VISIBILITY void reserve(size_type __n)
|
||||
{rehash(static_cast<size_type>(ceil(__n / max_load_factor())));}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const
|
||||
size_type bucket_count() const _NOEXCEPT
|
||||
{
|
||||
return __bucket_list_.get_deleter().size();
|
||||
}
|
||||
|
||||
iterator begin();
|
||||
iterator end();
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
iterator begin() _NOEXCEPT;
|
||||
iterator end() _NOEXCEPT;
|
||||
const_iterator begin() const _NOEXCEPT;
|
||||
const_iterator end() const _NOEXCEPT;
|
||||
|
||||
template <class _Key>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -612,7 +647,7 @@ public:
|
||||
size_type __erase_unique(const _Key& __k);
|
||||
template <class _Key>
|
||||
size_type __erase_multi(const _Key& __k);
|
||||
__node_holder remove(const_iterator __p);
|
||||
__node_holder remove(const_iterator __p) _NOEXCEPT;
|
||||
|
||||
template <class _Key>
|
||||
size_type __count_unique(const _Key& __k) const;
|
||||
@@ -633,18 +668,25 @@ public:
|
||||
pair<const_iterator, const_iterator>
|
||||
__equal_range_multi(const _Key& __k) const;
|
||||
|
||||
void swap(__hash_table& __u);
|
||||
void swap(__hash_table& __u)
|
||||
_NOEXCEPT_(
|
||||
(!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__pointer_allocator>::value) &&
|
||||
(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value) &&
|
||||
__is_nothrow_swappable<hasher>::value &&
|
||||
__is_nothrow_swappable<key_equal>::value);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const
|
||||
size_type max_bucket_count() const _NOEXCEPT
|
||||
{return __bucket_list_.get_deleter().__alloc().max_size();}
|
||||
size_type bucket_size(size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY float load_factor() const
|
||||
_LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
|
||||
{
|
||||
size_type __bc = bucket_count();
|
||||
return __bc != 0 ? (float)size() / __bc : 0.f;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf)
|
||||
_LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
|
||||
{max_load_factor() = _STD::max(__mlf, load_factor());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY local_iterator begin(size_type __n)
|
||||
@@ -678,25 +720,40 @@ private:
|
||||
void __copy_assign_alloc(const __hash_table& __u, false_type) {}
|
||||
|
||||
void __move_assign(__hash_table& __u, false_type);
|
||||
void __move_assign(__hash_table& __u, true_type);
|
||||
_LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__hash_table& __u)
|
||||
void __move_assign(__hash_table& __u, true_type)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_assignable<__node_allocator>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__hash_table& __u)
|
||||
_NOEXCEPT_(
|
||||
!__node_traits::propagate_on_container_move_assignment::value ||
|
||||
(is_nothrow_move_assignable<__pointer_allocator>::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value))
|
||||
{__move_assign_alloc(__u, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__hash_table& __u, true_type)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_assignable<__pointer_allocator>::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{
|
||||
__bucket_list_.get_deleter().__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) {}
|
||||
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
|
||||
|
||||
template <class _A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
void
|
||||
__swap_alloc(_A& __x, _A& __y)
|
||||
_NOEXCEPT_(
|
||||
!allocator_traits<_A>::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<_A>::value)
|
||||
{
|
||||
__swap_alloc(__x, __y,
|
||||
integral_constant<bool,
|
||||
@@ -709,6 +766,7 @@ private:
|
||||
static
|
||||
void
|
||||
__swap_alloc(_A& __x, _A& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_A>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
@@ -718,15 +776,20 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
void
|
||||
__swap_alloc(_A& __x, _A& __y, false_type) {}
|
||||
__swap_alloc(_A& __x, _A& __y, false_type) _NOEXCEPT {}
|
||||
|
||||
void __deallocate(__node_pointer __np);
|
||||
__node_pointer __detach();
|
||||
void __deallocate(__node_pointer __np) _NOEXCEPT;
|
||||
__node_pointer __detach() _NOEXCEPT;
|
||||
};
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<__bucket_list>::value &&
|
||||
is_nothrow_default_constructible<__first_node>::value &&
|
||||
is_nothrow_default_constructible<hasher>::value &&
|
||||
is_nothrow_default_constructible<key_equal>::value)
|
||||
: __p2_(0),
|
||||
__p3_(1.0f)
|
||||
{
|
||||
@@ -790,6 +853,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_constructible<__bucket_list>::value &&
|
||||
is_nothrow_move_constructible<__first_node>::value &&
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value)
|
||||
: __bucket_list_(_STD::move(__u.__bucket_list_)),
|
||||
__p1_(_STD::move(__u.__p1_)),
|
||||
__p2_(_STD::move(__u.__p2_)),
|
||||
@@ -870,6 +938,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __u)
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
|
||||
_NOEXCEPT
|
||||
{
|
||||
__node_allocator& __na = __node_alloc();
|
||||
while (__np != nullptr)
|
||||
@@ -883,7 +952,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_pointer
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach()
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT
|
||||
{
|
||||
size_type __bc = bucket_count();
|
||||
for (size_type __i = 0; __i < __bc; ++__i)
|
||||
@@ -900,6 +969,10 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
||||
__hash_table& __u, true_type)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_assignable<__node_allocator>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value)
|
||||
{
|
||||
clear();
|
||||
__bucket_list_.reset(__u.__bucket_list_.release());
|
||||
@@ -972,6 +1045,11 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>&
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
|
||||
_NOEXCEPT_(
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value)
|
||||
{
|
||||
__move_assign(__u, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -1051,7 +1129,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin()
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
|
||||
{
|
||||
return iterator(__p1_.first().__next_);
|
||||
}
|
||||
@@ -1059,7 +1137,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::begin()
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end()
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
|
||||
{
|
||||
return iterator(nullptr);
|
||||
}
|
||||
@@ -1067,7 +1145,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::end()
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
|
||||
{
|
||||
return const_iterator(__p1_.first().__next_);
|
||||
}
|
||||
@@ -1075,14 +1153,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
|
||||
{
|
||||
return const_iterator(nullptr);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::clear()
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT
|
||||
{
|
||||
if (size() > 0)
|
||||
{
|
||||
@@ -1645,7 +1723,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__erase_multi(const _Key& __k)
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p)
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
|
||||
{
|
||||
// current node
|
||||
__node_pointer __cn = const_cast<__node_pointer>(__p.__node_);
|
||||
@@ -1776,6 +1854,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi(
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
|
||||
_NOEXCEPT_(
|
||||
(!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__pointer_allocator>::value) &&
|
||||
(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value) &&
|
||||
__is_nothrow_swappable<hasher>::value &&
|
||||
__is_nothrow_swappable<key_equal>::value)
|
||||
{
|
||||
{
|
||||
__node_pointer_pointer __npp = __bucket_list_.release();
|
||||
@@ -1814,6 +1899,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
|
||||
return __r;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP__HASH_TABLE
|
||||
|
@@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class locale;
|
||||
|
||||
template <class _Facet> bool has_facet(const locale&) throw();
|
||||
template <class _Facet> bool has_facet(const locale&) _NOEXCEPT;
|
||||
template <class _Facet> const _Facet& use_facet(const locale&);
|
||||
|
||||
class _LIBCPP_VISIBLE locale
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
all = collate | ctype | monetary | numeric | time | messages;
|
||||
|
||||
// construct/copy/destroy:
|
||||
locale() throw();
|
||||
locale(const locale&) throw();
|
||||
locale() _NOEXCEPT;
|
||||
locale(const locale&) _NOEXCEPT;
|
||||
explicit locale(const char*);
|
||||
explicit locale(const string&);
|
||||
locale(const locale&, const char*, category);
|
||||
@@ -59,9 +59,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*);
|
||||
locale(const locale&, const locale&, category);
|
||||
|
||||
~locale() throw();
|
||||
~locale();
|
||||
|
||||
const locale& operator=(const locale&) throw();
|
||||
const locale& operator=(const locale&) _NOEXCEPT;
|
||||
|
||||
template <class _Facet> locale combine(const locale&) const;
|
||||
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
bool has_facet(id&) const;
|
||||
const facet* use_facet(id&) const;
|
||||
|
||||
template <class _Facet> friend bool has_facet(const locale&) throw();
|
||||
template <class _Facet> friend bool has_facet(const locale&) _NOEXCEPT;
|
||||
template <class _Facet> friend const _Facet& use_facet(const locale&);
|
||||
};
|
||||
|
||||
@@ -103,7 +103,7 @@ protected:
|
||||
// facet(const facet&) = delete; // effectively done in __shared_count
|
||||
// void operator=(const facet&) = delete;
|
||||
private:
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE locale::id
|
||||
@@ -146,7 +146,7 @@ locale::combine(const locale& __other) const
|
||||
template <class _Facet>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
has_facet(const locale& __l) throw()
|
||||
has_facet(const locale& __l) _NOEXCEPT
|
||||
{
|
||||
return __l.has_facet(_Facet::id);
|
||||
}
|
||||
@@ -451,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
|
||||
@@ -535,8 +535,8 @@ public:
|
||||
#else
|
||||
static const size_t table_size = 256; // FIXME: Don't hardcode this.
|
||||
#endif
|
||||
_LIBCPP_ALWAYS_INLINE const mask* table() const throw() {return __tab_;}
|
||||
static const mask* classic_table() throw();
|
||||
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
||||
static const mask* classic_table() _NOEXCEPT;
|
||||
|
||||
protected:
|
||||
~ctype();
|
||||
@@ -755,13 +755,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const throw()
|
||||
int encoding() const _NOEXCEPT
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const throw()
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -773,7 +773,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const throw()
|
||||
int max_length() const _NOEXCEPT
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -795,10 +795,10 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const throw();
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
// template <> class codecvt<wchar_t, char, mbstate_t>
|
||||
@@ -840,13 +840,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const throw()
|
||||
int encoding() const _NOEXCEPT
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const throw()
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -858,7 +858,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const throw()
|
||||
int max_length() const _NOEXCEPT
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -878,10 +878,10 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const throw();
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
// template <> class codecvt<char16_t, char, mbstate_t>
|
||||
@@ -924,13 +924,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const throw()
|
||||
int encoding() const _NOEXCEPT
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const throw()
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -942,7 +942,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const throw()
|
||||
int max_length() const _NOEXCEPT
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -964,10 +964,10 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const throw();
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
// template <> class codecvt<char32_t, char, mbstate_t>
|
||||
@@ -1010,13 +1010,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const throw()
|
||||
int encoding() const _NOEXCEPT
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const throw()
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -1028,7 +1028,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const throw()
|
||||
int max_length() const _NOEXCEPT
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -1050,10 +1050,10 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const throw();
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
|
||||
|
@@ -47,29 +47,36 @@ public:
|
||||
typedef typename add_lvalue_reference<allocator_type>::type __alloc_ref;
|
||||
typedef typename add_lvalue_reference<allocator_type>::type __alloc_const_ref;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __alloc_rr& __alloc() {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const __alloc_rr& __alloc() const {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();}
|
||||
|
||||
__split_buffer();
|
||||
__split_buffer()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit __split_buffer(__alloc_rr& __a);
|
||||
explicit __split_buffer(const __alloc_rr& __a);
|
||||
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
|
||||
~__split_buffer();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__split_buffer(__split_buffer&& __c);
|
||||
__split_buffer(__split_buffer&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
|
||||
__split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
|
||||
__split_buffer& operator=(__split_buffer&& __c);
|
||||
__split_buffer& operator=(__split_buffer&& __c)
|
||||
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value) ||
|
||||
!__alloc_traits::propagate_on_container_move_assignment::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() {return __end_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const {return __end_;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT {return __end_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT {return __end_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__destruct_at_end(__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT
|
||||
{__destruct_at_end(__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return __end_ == __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
|
||||
@@ -82,7 +89,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const {return *(__end_ - 1);}
|
||||
|
||||
void reserve(size_type __n);
|
||||
void shrink_to_fit();
|
||||
void shrink_to_fit() _NOEXCEPT;
|
||||
void push_front(const_reference __x);
|
||||
void push_back(const_reference __x);
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
@@ -120,40 +127,47 @@ public:
|
||||
void __destruct_at_begin(pointer __new_begin, false_type);
|
||||
void __destruct_at_begin(pointer __new_begin, true_type);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __destruct_at_end(pointer __new_last) _NOEXCEPT
|
||||
{__destruct_at_end(__new_last, is_trivially_destructible<value_type>());}
|
||||
void __destruct_at_end(pointer __new_last, false_type);
|
||||
void __destruct_at_end(pointer __new_last, true_type);
|
||||
void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
|
||||
void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
|
||||
|
||||
void swap(__split_buffer& __x);
|
||||
void swap(__split_buffer& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value);
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __split_buffer& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __split_buffer& __c, false_type)
|
||||
void __move_assign_alloc(const __split_buffer& __c, false_type) _NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_swap::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, false_type)
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, false_type) _NOEXCEPT
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -284,7 +298,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_t
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type)
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
|
||||
{
|
||||
while (__new_last < __end_)
|
||||
__alloc_traits::destroy(__alloc(), --__end_);
|
||||
@@ -293,7 +307,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_typ
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type)
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type) _NOEXCEPT
|
||||
{
|
||||
__end_ = __new_last;
|
||||
}
|
||||
@@ -310,6 +324,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
__split_buffer<_Tp, _Allocator>::__split_buffer()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
: __first_(0), __begin_(0), __end_(0), __end_cap_(0)
|
||||
{
|
||||
}
|
||||
@@ -340,6 +355,7 @@ __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_(_STD::move(__c.__first_)),
|
||||
__begin_(_STD::move(__c.__begin_)),
|
||||
__end_(_STD::move(__c.__end_)),
|
||||
@@ -380,6 +396,9 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al
|
||||
template <class _Tp, class _Allocator>
|
||||
__split_buffer<_Tp, _Allocator>&
|
||||
__split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
|
||||
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value) ||
|
||||
!__alloc_traits::propagate_on_container_move_assignment::value)
|
||||
{
|
||||
clear();
|
||||
shrink_to_fit();
|
||||
@@ -399,6 +418,8 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{
|
||||
_STD::swap(__first_, __x.__first_);
|
||||
_STD::swap(__begin_, __x.__begin_);
|
||||
@@ -425,7 +446,7 @@ __split_buffer<_Tp, _Allocator>::reserve(size_type __n)
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::shrink_to_fit()
|
||||
__split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
{
|
||||
if (capacity() > size())
|
||||
{
|
||||
@@ -612,6 +633,16 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_SPLIT_BUFFER
|
||||
|
@@ -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;
|
||||
|
155
include/__tree
155
include/__tree
@@ -55,7 +55,7 @@ __root, have a non-null __parent_ field.
|
||||
template <class _NodePtr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
__tree_is_left_child(_NodePtr __x)
|
||||
__tree_is_left_child(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
return __x == __x->__parent_->__left_;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ __tree_invariant(_NodePtr __root)
|
||||
template <class _NodePtr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_NodePtr
|
||||
__tree_min(_NodePtr __x)
|
||||
__tree_min(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
while (__x->__left_ != nullptr)
|
||||
__x = __x->__left_;
|
||||
@@ -133,7 +133,7 @@ __tree_min(_NodePtr __x)
|
||||
template <class _NodePtr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_NodePtr
|
||||
__tree_max(_NodePtr __x)
|
||||
__tree_max(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
while (__x->__right_ != nullptr)
|
||||
__x = __x->__right_;
|
||||
@@ -144,7 +144,7 @@ __tree_max(_NodePtr __x)
|
||||
// Precondition: __x != nullptr.
|
||||
template <class _NodePtr>
|
||||
_NodePtr
|
||||
__tree_next(_NodePtr __x)
|
||||
__tree_next(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
if (__x->__right_ != nullptr)
|
||||
return __tree_min(__x->__right_);
|
||||
@@ -157,7 +157,7 @@ __tree_next(_NodePtr __x)
|
||||
// Precondition: __x != nullptr.
|
||||
template <class _NodePtr>
|
||||
_NodePtr
|
||||
__tree_prev(_NodePtr __x)
|
||||
__tree_prev(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
if (__x->__left_ != nullptr)
|
||||
return __tree_max(__x->__left_);
|
||||
@@ -170,7 +170,7 @@ __tree_prev(_NodePtr __x)
|
||||
// Precondition: __x != nullptr.
|
||||
template <class _NodePtr>
|
||||
_NodePtr
|
||||
__tree_leaf(_NodePtr __x)
|
||||
__tree_leaf(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -194,7 +194,7 @@ __tree_leaf(_NodePtr __x)
|
||||
// Precondition: __x->__right_ != nullptr
|
||||
template <class _NodePtr>
|
||||
void
|
||||
__tree_left_rotate(_NodePtr __x)
|
||||
__tree_left_rotate(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
_NodePtr __y = __x->__right_;
|
||||
__x->__right_ = __y->__left_;
|
||||
@@ -214,7 +214,7 @@ __tree_left_rotate(_NodePtr __x)
|
||||
// Precondition: __x->__left_ != nullptr
|
||||
template <class _NodePtr>
|
||||
void
|
||||
__tree_right_rotate(_NodePtr __x)
|
||||
__tree_right_rotate(_NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
_NodePtr __y = __x->__left_;
|
||||
__x->__left_ = __y->__right_;
|
||||
@@ -239,7 +239,7 @@ __tree_right_rotate(_NodePtr __x)
|
||||
// may be different than the value passed in as __root.
|
||||
template <class _NodePtr>
|
||||
void
|
||||
__tree_balance_after_insert(_NodePtr __root, _NodePtr __x)
|
||||
__tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
|
||||
{
|
||||
__x->__is_black_ = __x == __root;
|
||||
while (__x != __root && !__x->__parent_->__is_black_)
|
||||
@@ -309,7 +309,7 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x)
|
||||
// may be different than the value passed in as __root.
|
||||
template <class _NodePtr>
|
||||
void
|
||||
__tree_remove(_NodePtr __root, _NodePtr __z)
|
||||
__tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
|
||||
{
|
||||
// __z will be removed from the tree. Client still needs to destruct/deallocate it
|
||||
// __y is either __z, or if __z has two children, __tree_next(__z).
|
||||
@@ -514,13 +514,13 @@ public:
|
||||
bool __value_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_node_destructor(allocator_type& __na)
|
||||
explicit __tree_node_destructor(allocator_type& __na) _NOEXCEPT
|
||||
: __na_(__na),
|
||||
__value_constructed(false)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__value_constructed)
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_));
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
pointer __left_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_end_node() : __left_() {}
|
||||
__tree_end_node() _NOEXCEPT : __left_() {}
|
||||
};
|
||||
|
||||
template <class _VoidPtr>
|
||||
@@ -580,7 +580,8 @@ public:
|
||||
bool __is_black_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_node_base() : __right_(), __parent_(), __is_black_(false) {}
|
||||
__tree_node_base() _NOEXCEPT
|
||||
: __right_(), __parent_(), __is_black_(false) {}
|
||||
};
|
||||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
@@ -632,7 +633,7 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __tree_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
|
||||
@@ -662,7 +663,7 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||
template <class, class, class> friend class __tree;
|
||||
template <class, class, class> friend class _LIBCPP_VISIBLE __tree_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __map_iterator;
|
||||
@@ -716,7 +717,8 @@ private:
|
||||
__non_const_iterator;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_const_iterator(__non_const_iterator __p) : __ptr_(__p.__ptr_) {}
|
||||
__tree_const_iterator(__non_const_iterator __p) _NOEXCEPT
|
||||
: __ptr_(__p.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
|
||||
@@ -746,7 +748,8 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_const_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
|
||||
: __ptr_(__p) {}
|
||||
template <class, class, class> friend class __tree;
|
||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
|
||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
|
||||
@@ -805,7 +808,7 @@ private:
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer __end_node()
|
||||
__node_pointer __end_node() _NOEXCEPT
|
||||
{
|
||||
return static_cast<__node_pointer>
|
||||
(
|
||||
@@ -813,7 +816,7 @@ public:
|
||||
);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_const_pointer __end_node() const
|
||||
__node_const_pointer __end_node() const _NOEXCEPT
|
||||
{
|
||||
return static_cast<__node_const_pointer>
|
||||
(
|
||||
@@ -821,39 +824,45 @@ public:
|
||||
);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_allocator& __node_alloc() {return __pair1_.second();}
|
||||
__node_allocator& __node_alloc() _NOEXCEPT {return __pair1_.second();}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __node_alloc() const {return __pair1_.second();}
|
||||
const __node_allocator& __node_alloc() const _NOEXCEPT
|
||||
{return __pair1_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer& __begin_node() {return __begin_node_;}
|
||||
__node_pointer& __begin_node() _NOEXCEPT {return __begin_node_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_pointer& __begin_node() const {return __begin_node_;}
|
||||
const __node_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type __alloc() const {return allocator_type(__node_alloc());}
|
||||
allocator_type __alloc() const _NOEXCEPT
|
||||
{return allocator_type(__node_alloc());}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& size() {return __pair3_.first();}
|
||||
size_type& size() _NOEXCEPT {return __pair3_.first();}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const size_type& size() const {return __pair3_.first();}
|
||||
const size_type& size() const _NOEXCEPT {return __pair3_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare& value_comp() {return __pair3_.second();}
|
||||
value_compare& value_comp() _NOEXCEPT {return __pair3_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_compare& value_comp() const {return __pair3_.second();}
|
||||
const value_compare& value_comp() const _NOEXCEPT
|
||||
{return __pair3_.second();}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer __root()
|
||||
__node_pointer __root() _NOEXCEPT
|
||||
{return static_cast<__node_pointer> (__end_node()->__left_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_const_pointer __root() const
|
||||
__node_const_pointer __root() const _NOEXCEPT
|
||||
{return static_cast<__node_const_pointer>(__end_node()->__left_);}
|
||||
|
||||
typedef __tree_iterator<value_type, __node_pointer, difference_type> iterator;
|
||||
typedef __tree_const_iterator<value_type, __node_const_pointer, difference_type> const_iterator;
|
||||
|
||||
explicit __tree(const value_compare& __comp);
|
||||
explicit __tree(const value_compare& __comp)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<__node_allocator>::value &&
|
||||
is_nothrow_copy_constructible<value_compare>::value);
|
||||
explicit __tree(const allocator_type& __a);
|
||||
__tree(const value_compare& __comp, const allocator_type& __a);
|
||||
__tree(const __tree& __t);
|
||||
@@ -863,28 +872,40 @@ public:
|
||||
template <class _InputIterator>
|
||||
void __assign_multi(_InputIterator __first, _InputIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__tree(__tree&& __t);
|
||||
__tree(__tree&& __t)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_constructible<__node_allocator>::value &&
|
||||
is_nothrow_move_constructible<value_compare>::value);
|
||||
__tree(__tree&& __t, const allocator_type& __a);
|
||||
__tree& operator=(__tree&& __t);
|
||||
__tree& operator=(__tree&& __t)
|
||||
_NOEXCEPT_(
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<value_compare>::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
~__tree();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return iterator(__begin_node());}
|
||||
iterator begin() _NOEXCEPT {return iterator(__begin_node());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return const_iterator(__begin_node());}
|
||||
const_iterator begin() const _NOEXCEPT {return const_iterator(__begin_node());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return iterator(__end_node());}
|
||||
iterator end() _NOEXCEPT {return iterator(__end_node());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return const_iterator(__end_node());}
|
||||
const_iterator end() const _NOEXCEPT {return const_iterator(__end_node());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __node_traits::max_size(__node_alloc());}
|
||||
size_type max_size() const _NOEXCEPT
|
||||
{return __node_traits::max_size(__node_alloc());}
|
||||
|
||||
void clear();
|
||||
void clear() _NOEXCEPT;
|
||||
|
||||
void swap(__tree& __t);
|
||||
void swap(__tree& __t)
|
||||
_NOEXCEPT_(
|
||||
__is_nothrow_swappable<value_compare>::value &&
|
||||
(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value));
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -995,7 +1016,7 @@ public:
|
||||
typedef __tree_node_destructor<__node_allocator> _D;
|
||||
typedef unique_ptr<__node, _D> __node_holder;
|
||||
|
||||
__node_holder remove(const_iterator __p);
|
||||
__node_holder remove(const_iterator __p) _NOEXCEPT;
|
||||
private:
|
||||
typename __node_base::pointer&
|
||||
__find_leaf_low(typename __node_base::pointer& __parent, const value_type& __v);
|
||||
@@ -1019,7 +1040,7 @@ private:
|
||||
__node_holder __construct_node(const value_type& __v);
|
||||
#endif
|
||||
|
||||
void destroy(__node_pointer __nd);
|
||||
void destroy(__node_pointer __nd) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __tree& __t)
|
||||
@@ -1033,31 +1054,42 @@ private:
|
||||
void __copy_assign_alloc(const __tree& __t, false_type) {}
|
||||
|
||||
void __move_assign(__tree& __t, false_type);
|
||||
void __move_assign(__tree& __t, true_type);
|
||||
void __move_assign(__tree& __t, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t)
|
||||
_NOEXCEPT_(
|
||||
!__node_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__move_assign_alloc(__t, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__node_alloc() = _STD::move(__t.__node_alloc());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t, false_type) {}
|
||||
void __move_assign_alloc(__tree& __t, false_type) _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
||||
_NOEXCEPT_(
|
||||
!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_swap::value>());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
|
||||
__node_pointer __detach();
|
||||
@@ -1066,6 +1098,9 @@ private:
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<__node_allocator>::value &&
|
||||
is_nothrow_copy_constructible<value_compare>::value)
|
||||
: __pair3_(0, __comp)
|
||||
{
|
||||
__begin_node() = __end_node();
|
||||
@@ -1240,6 +1275,9 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_move_constructible<__node_allocator>::value &&
|
||||
is_nothrow_move_constructible<value_compare>::value)
|
||||
: __begin_node_(_STD::move(__t.__begin_node_)),
|
||||
__pair1_(_STD::move(__t.__pair1_)),
|
||||
__pair3_(_STD::move(__t.__pair3_))
|
||||
@@ -1284,6 +1322,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
void
|
||||
__tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{
|
||||
destroy(static_cast<__node_pointer>(__end_node()->__left_));
|
||||
__begin_node_ = __t.__begin_node_;
|
||||
@@ -1350,6 +1390,11 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
__tree<_Tp, _Compare, _Allocator>&
|
||||
__tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
|
||||
_NOEXCEPT_(
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<value_compare>::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
|
||||
{
|
||||
__move_assign(__t, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -1366,7 +1411,7 @@ __tree<_Tp, _Compare, _Allocator>::~__tree()
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
void
|
||||
__tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd)
|
||||
__tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
|
||||
{
|
||||
if (__nd != nullptr)
|
||||
{
|
||||
@@ -1381,6 +1426,10 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd)
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
void
|
||||
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
|
||||
_NOEXCEPT_(
|
||||
__is_nothrow_swappable<value_compare>::value &&
|
||||
(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value))
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__begin_node_, __t.__begin_node_);
|
||||
@@ -1399,7 +1448,7 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
void
|
||||
__tree<_Tp, _Compare, _Allocator>::clear()
|
||||
__tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT
|
||||
{
|
||||
destroy(__root());
|
||||
size() = 0;
|
||||
@@ -2205,7 +2254,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
|
||||
__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p)
|
||||
__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
|
||||
{
|
||||
__node_pointer __np = const_cast<__node_pointer>(__p.__ptr_);
|
||||
if (__begin_node() == __np)
|
||||
@@ -2221,6 +2270,16 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p)
|
||||
return __node_holder(__np, _D(__node_alloc()));
|
||||
}
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(__tree<_Tp, _Compare, _Allocator>& __x,
|
||||
__tree<_Tp, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP___TREE
|
||||
|
@@ -78,39 +78,39 @@ template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : tru
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(tuple<_Tp...>&);
|
||||
get(tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(const tuple<_Tp...>&);
|
||||
get(const tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(tuple<_Tp...>&&);
|
||||
get(tuple<_Tp...>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(pair<_T1, _T2>&);
|
||||
get(pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(const pair<_T1, _T2>&);
|
||||
get(const pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(pair<_T1, _T2>&&);
|
||||
get(pair<_T1, _T2>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_Tp&
|
||||
get(array<_Tp, _Size>&);
|
||||
get(array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
const _Tp&
|
||||
get(const array<_Tp, _Size>&);
|
||||
get(const array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_Tp&&
|
||||
get(array<_Tp, _Size>&&);
|
||||
get(array<_Tp, _Size>&&) _NOEXCEPT;
|
||||
|
||||
// __make_tuple_indices
|
||||
|
||||
|
@@ -1659,13 +1659,7 @@ move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
|
||||
|
||||
// iter_swap
|
||||
|
||||
template <class _ForwardIterator1, class _ForwardIterator2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
|
||||
{
|
||||
swap(*__a, *__b);
|
||||
}
|
||||
// moved to <type_traits> for better swap / noexcept support
|
||||
|
||||
// transform
|
||||
|
||||
|
111
include/array
111
include/array
@@ -34,28 +34,28 @@ struct array
|
||||
|
||||
// No explicit construct/copy/destroy for aggregate type
|
||||
void fill(const T& u);
|
||||
void swap(array& a);
|
||||
void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>())));
|
||||
|
||||
// iterators:
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
// capacity:
|
||||
constexpr size_type size() const;
|
||||
constexpr size_type max_size() const;
|
||||
bool empty() const;
|
||||
constexpr size_type size() const noexcept;
|
||||
constexpr size_type max_size() const noexcept;
|
||||
bool empty() const noexcept;
|
||||
|
||||
// element access:
|
||||
reference operator[](size_type n);
|
||||
@@ -68,8 +68,8 @@ struct array
|
||||
reference back();
|
||||
const_reference back() const;
|
||||
|
||||
T* data();
|
||||
const T* data() const;
|
||||
T* data() noexcept;
|
||||
const T* data() const noexcept;
|
||||
};
|
||||
|
||||
template <class T, size_t N>
|
||||
@@ -86,15 +86,15 @@ template <class T, size_t N>
|
||||
bool operator>=(const array<T,N>& x, const array<T,N>& y);
|
||||
|
||||
template <class T, size_t N >
|
||||
void swap(array<T,N>& x, array<T,N>& y);
|
||||
void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class T> class tuple_size;
|
||||
template <int I, class T> class tuple_element;
|
||||
template <class T, size_t N> struct tuple_size<array<T, N>>;
|
||||
template <int I, class T, size_t N> struct tuple_element<I, array<T, N>>;
|
||||
template <int I, class T, size_t N> T& get(array<T, N>&);
|
||||
template <int I, class T, size_t N> const T& get(const array<T, N>&);
|
||||
template <int I, class T, size_t N> T&& get(array<T, N>&&);
|
||||
template <int I, class T, size_t N> T& get(array<T, N>&) noexcept;
|
||||
template <int I, class T, size_t N> const T& get(const array<T, N>&) noexcept;
|
||||
template <int I, class T, size_t N> T&& get(array<T, N>&&) noexcept;
|
||||
|
||||
} // std
|
||||
|
||||
@@ -137,29 +137,45 @@ struct _LIBCPP_VISIBLE array
|
||||
// No explicit construct/copy/destroy for aggregate type
|
||||
_LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u)
|
||||
{_STD::fill_n(__elems_, _Size, __u);}
|
||||
_LIBCPP_INLINE_VISIBILITY void swap(array& __a)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{_STD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
|
||||
// iterators:
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const {return const_iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__elems_ + _Size);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const {return const_iterator(__elems_ + _Size);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() _NOEXCEPT {return iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const _NOEXCEPT {return const_iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() _NOEXCEPT {return iterator(__elems_ + _Size);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const _NOEXCEPT {return const_iterator(__elems_ + _Size);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cbegin() const {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cend() const {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crbegin() const {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crend() const {return rend();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
// capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY /*constexpr*/ size_type size() const {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY /*constexpr*/ size_type max_size() const {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return _Size == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*constexpr*/ size_type size() const _NOEXCEPT {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*constexpr*/ size_type max_size() const _NOEXCEPT {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return _Size == 0;}
|
||||
|
||||
// element access:
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];}
|
||||
@@ -172,8 +188,10 @@ struct _LIBCPP_VISIBLE array
|
||||
_LIBCPP_INLINE_VISIBILITY reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY value_type* data() {return __elems_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const value_type* data() const {return __elems_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type* data() _NOEXCEPT {return __elems_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type* data() const _NOEXCEPT {return __elems_;}
|
||||
};
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
@@ -252,8 +270,13 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
typename enable_if
|
||||
<
|
||||
__is_swappable<_Tp>::value,
|
||||
void
|
||||
>::type
|
||||
swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
@@ -283,7 +306,7 @@ public:
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
_Tp&
|
||||
get(array<_Tp, _Size>& __a)
|
||||
get(array<_Tp, _Size>& __a) _NOEXCEPT
|
||||
{
|
||||
return __a[_Ip];
|
||||
}
|
||||
@@ -291,7 +314,7 @@ get(array<_Tp, _Size>& __a)
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
const _Tp&
|
||||
get(const array<_Tp, _Size>& __a)
|
||||
get(const array<_Tp, _Size>& __a) _NOEXCEPT
|
||||
{
|
||||
return __a[_Ip];
|
||||
}
|
||||
@@ -301,7 +324,7 @@ get(const array<_Tp, _Size>& __a)
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
_Tp&&
|
||||
get(array<_Tp, _Size>&& __a)
|
||||
get(array<_Tp, _Size>&& __a) _NOEXCEPT
|
||||
{
|
||||
return _STD::move(__a[_Ip]);
|
||||
}
|
||||
|
264
include/bitset
264
include/bitset
@@ -27,19 +27,19 @@ public:
|
||||
class reference
|
||||
{
|
||||
friend class bitset;
|
||||
reference();
|
||||
reference() noexcept;
|
||||
public:
|
||||
~reference();
|
||||
reference& operator=(bool x); // for b[i] = x;
|
||||
reference& operator=(const reference&); // for b[i] = b[j];
|
||||
bool operator~() const; // flips the bit
|
||||
operator bool() const; // for x = b[i];
|
||||
reference& flip(); // for b[i].flip();
|
||||
~reference() noexcept;
|
||||
reference& operator=(bool x) noexcept; // for b[i] = x;
|
||||
reference& operator=(const reference&) noexcept; // for b[i] = b[j];
|
||||
bool operator~() const noexcept; // flips the bit
|
||||
operator bool() const noexcept; // for x = b[i];
|
||||
reference& flip() noexcept; // for b[i].flip();
|
||||
};
|
||||
|
||||
// 23.3.5.1 constructors:
|
||||
constexpr bitset();
|
||||
constexpr bitset(unsigned long long val);
|
||||
constexpr bitset() noexcept;
|
||||
constexpr bitset(unsigned long long val) noexcept;
|
||||
template <class charT>
|
||||
explicit bitset(const charT* str,
|
||||
typename basic_string<charT>::size_type n = basic_string<charT>::npos,
|
||||
@@ -52,17 +52,17 @@ public:
|
||||
charT zero = charT('0'), charT one = charT('1'));
|
||||
|
||||
// 23.3.5.2 bitset operations:
|
||||
bitset& operator&=(const bitset& rhs);
|
||||
bitset& operator|=(const bitset& rhs);
|
||||
bitset& operator^=(const bitset& rhs);
|
||||
bitset& operator<<=(size_t pos);
|
||||
bitset& operator>>=(size_t pos);
|
||||
bitset& set();
|
||||
bitset& operator&=(const bitset& rhs) noexcept;
|
||||
bitset& operator|=(const bitset& rhs) noexcept;
|
||||
bitset& operator^=(const bitset& rhs) noexcept;
|
||||
bitset& operator<<=(size_t pos) noexcept;
|
||||
bitset& operator>>=(size_t pos) noexcept;
|
||||
bitset& set() noexcept;
|
||||
bitset& set(size_t pos, bool val = true);
|
||||
bitset& reset();
|
||||
bitset& reset() noexcept;
|
||||
bitset& reset(size_t pos);
|
||||
bitset operator~() const;
|
||||
bitset& flip();
|
||||
bitset operator~() const noexcept;
|
||||
bitset& flip() noexcept;
|
||||
bitset& flip(size_t pos);
|
||||
|
||||
// element access:
|
||||
@@ -77,27 +77,27 @@ public:
|
||||
template <class charT>
|
||||
basic_string<charT, char_traits<charT>, allocator<charT> > to_string(charT zero = charT('0'), charT one = charT('1')) const;
|
||||
basic_string<char, char_traits<char>, allocator<char> > to_string(char zero = '0', char one = '1') const;
|
||||
size_t count() const;
|
||||
constexpr size_t size() const;
|
||||
bool operator==(const bitset& rhs) const;
|
||||
bool operator!=(const bitset& rhs) const;
|
||||
size_t count() const noexcept;
|
||||
constexpr size_t size() const noexcept;
|
||||
bool operator==(const bitset& rhs) const noexcept;
|
||||
bool operator!=(const bitset& rhs) const noexcept;
|
||||
bool test(size_t pos) const;
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
bool none() const;
|
||||
bitset operator<<(size_t pos) const;
|
||||
bitset operator>>(size_t pos) const;
|
||||
bool all() const noexcept;
|
||||
bool any() const noexcept;
|
||||
bool none() const noexcept;
|
||||
bitset operator<<(size_t pos) const noexcept;
|
||||
bitset operator>>(size_t pos) const noexcept;
|
||||
};
|
||||
|
||||
// 23.3.5.3 bitset operators:
|
||||
template <size_t N>
|
||||
bitset<N> operator&(const bitset<N>&, const bitset<N>&);
|
||||
bitset<N> operator&(const bitset<N>&, const bitset<N>&) noexcept;
|
||||
|
||||
template <size_t N>
|
||||
bitset<N> operator|(const bitset<N>&, const bitset<N>&);
|
||||
bitset<N> operator|(const bitset<N>&, const bitset<N>&) noexcept;
|
||||
|
||||
template <size_t N>
|
||||
bitset<N> operator^(const bitset<N>&, const bitset<N>&);
|
||||
bitset<N> operator^(const bitset<N>&, const bitset<N>&) noexcept;
|
||||
|
||||
template <class charT, class traits, size_t N>
|
||||
basic_istream<charT, traits>&
|
||||
@@ -155,34 +155,34 @@ protected:
|
||||
typedef __bit_iterator<__bitset, false> iterator;
|
||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||
|
||||
__bitset();
|
||||
explicit __bitset(unsigned long long __v);
|
||||
__bitset() _NOEXCEPT;
|
||||
explicit __bitset(unsigned long long __v) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
||||
{return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
||||
{return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||
{return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
|
||||
{return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
|
||||
void operator&=(const __bitset& __v);
|
||||
void operator|=(const __bitset& __v);
|
||||
void operator^=(const __bitset& __v);
|
||||
void operator&=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator|=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator^=(const __bitset& __v) _NOEXCEPT;
|
||||
|
||||
void flip();
|
||||
void flip() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const
|
||||
{return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());}
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const
|
||||
{return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());}
|
||||
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
size_t __hash_code() const;
|
||||
bool all() const _NOEXCEPT;
|
||||
bool any() const _NOEXCEPT;
|
||||
size_t __hash_code() const _NOEXCEPT;
|
||||
private:
|
||||
void __init(unsigned long long __v, false_type);
|
||||
void __init(unsigned long long __v, true_type);
|
||||
void __init(unsigned long long __v, false_type) _NOEXCEPT;
|
||||
void __init(unsigned long long __v, true_type) _NOEXCEPT;
|
||||
unsigned long to_ulong(false_type) const;
|
||||
unsigned long to_ulong(true_type) const;
|
||||
unsigned long long to_ullong(false_type) const;
|
||||
@@ -193,7 +193,7 @@ private:
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<_N_words, _Size>::__bitset()
|
||||
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
|
||||
{
|
||||
_STD::fill_n(__first_, _N_words, __storage_type(0));
|
||||
}
|
||||
@@ -221,7 +221,7 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type)
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<_N_words, _Size>::__bitset(unsigned long long __v)
|
||||
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
{
|
||||
__init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
|
||||
}
|
||||
@@ -229,7 +229,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v)
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<_N_words, _Size>::operator&=(const __bitset& __v)
|
||||
__bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
|
||||
{
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
__first_[__i] &= __v.__first_[__i];
|
||||
@@ -238,7 +238,7 @@ __bitset<_N_words, _Size>::operator&=(const __bitset& __v)
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<_N_words, _Size>::operator|=(const __bitset& __v)
|
||||
__bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
|
||||
{
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
__first_[__i] |= __v.__first_[__i];
|
||||
@@ -247,7 +247,7 @@ __bitset<_N_words, _Size>::operator|=(const __bitset& __v)
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<_N_words, _Size>::operator^=(const __bitset& __v)
|
||||
__bitset<_N_words, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
|
||||
{
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
__first_[__i] ^= __v.__first_[__i];
|
||||
@@ -255,7 +255,7 @@ __bitset<_N_words, _Size>::operator^=(const __bitset& __v)
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
void
|
||||
__bitset<_N_words, _Size>::flip()
|
||||
__bitset<_N_words, _Size>::flip() _NOEXCEPT
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = _Size;
|
||||
@@ -338,7 +338,7 @@ __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
bool
|
||||
__bitset<_N_words, _Size>::all() const
|
||||
__bitset<_N_words, _Size>::all() const _NOEXCEPT
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = _Size;
|
||||
@@ -358,7 +358,7 @@ __bitset<_N_words, _Size>::all() const
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
bool
|
||||
__bitset<_N_words, _Size>::any() const
|
||||
__bitset<_N_words, _Size>::any() const _NOEXCEPT
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = _Size;
|
||||
@@ -379,7 +379,7 @@ __bitset<_N_words, _Size>::any() const
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
__bitset<_N_words, _Size>::__hash_code() const
|
||||
__bitset<_N_words, _Size>::__hash_code() const _NOEXCEPT
|
||||
{
|
||||
size_t __h = 0;
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
@@ -413,43 +413,43 @@ protected:
|
||||
typedef __bit_iterator<__bitset, false> iterator;
|
||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||
|
||||
__bitset();
|
||||
explicit __bitset(unsigned long long __v);
|
||||
__bitset() _NOEXCEPT;
|
||||
explicit __bitset(unsigned long long __v) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
||||
{return reference(&__first_, __storage_type(1) << __pos);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
||||
{return const_reference(&__first_, __storage_type(1) << __pos);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||
{return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
|
||||
{return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
|
||||
void operator&=(const __bitset& __v);
|
||||
void operator|=(const __bitset& __v);
|
||||
void operator^=(const __bitset& __v);
|
||||
void operator&=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator|=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator^=(const __bitset& __v) _NOEXCEPT;
|
||||
|
||||
void flip();
|
||||
void flip() _NOEXCEPT;
|
||||
|
||||
unsigned long to_ulong() const;
|
||||
unsigned long long to_ullong() const;
|
||||
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
bool all() const _NOEXCEPT;
|
||||
bool any() const _NOEXCEPT;
|
||||
|
||||
size_t __hash_code() const;
|
||||
size_t __hash_code() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<1, _Size>::__bitset()
|
||||
__bitset<1, _Size>::__bitset() _NOEXCEPT
|
||||
: __first_(0)
|
||||
{
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<1, _Size>::__bitset(unsigned long long __v)
|
||||
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
: __first_(static_cast<__storage_type>(__v))
|
||||
{
|
||||
}
|
||||
@@ -457,7 +457,7 @@ __bitset<1, _Size>::__bitset(unsigned long long __v)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::operator&=(const __bitset& __v)
|
||||
__bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
|
||||
{
|
||||
__first_ &= __v.__first_;
|
||||
}
|
||||
@@ -465,7 +465,7 @@ __bitset<1, _Size>::operator&=(const __bitset& __v)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::operator|=(const __bitset& __v)
|
||||
__bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
|
||||
{
|
||||
__first_ |= __v.__first_;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ __bitset<1, _Size>::operator|=(const __bitset& __v)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::operator^=(const __bitset& __v)
|
||||
__bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
|
||||
{
|
||||
__first_ ^= __v.__first_;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ __bitset<1, _Size>::operator^=(const __bitset& __v)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::flip()
|
||||
__bitset<1, _Size>::flip() _NOEXCEPT
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
|
||||
__first_ = ~__first_;
|
||||
@@ -507,7 +507,7 @@ __bitset<1, _Size>::to_ullong() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
__bitset<1, _Size>::all() const
|
||||
__bitset<1, _Size>::all() const _NOEXCEPT
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
|
||||
return !(~__first_ & __m);
|
||||
@@ -516,7 +516,7 @@ __bitset<1, _Size>::all() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
__bitset<1, _Size>::any() const
|
||||
__bitset<1, _Size>::any() const _NOEXCEPT
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
|
||||
return __first_ & __m;
|
||||
@@ -525,7 +525,7 @@ __bitset<1, _Size>::any() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
__bitset<1, _Size>::__hash_code() const
|
||||
__bitset<1, _Size>::__hash_code() const _NOEXCEPT
|
||||
{
|
||||
return __first_;
|
||||
}
|
||||
@@ -554,40 +554,40 @@ protected:
|
||||
typedef __bit_iterator<__bitset, false> iterator;
|
||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||
|
||||
__bitset();
|
||||
explicit __bitset(unsigned long long);
|
||||
__bitset() _NOEXCEPT;
|
||||
explicit __bitset(unsigned long long) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t)
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
|
||||
{return reference(0, 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t) const
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t) const _NOEXCEPT
|
||||
{return const_reference(0, 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||
{return iterator(0, 0);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
|
||||
{return const_iterator(0, 0);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator^=(const __bitset&) {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator^=(const __bitset&) _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() {}
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const {return 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const {return 0;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool all() const {return true;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool any() const {return false;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_t __hash_code() const {return 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<0, 0>::__bitset()
|
||||
__bitset<0, 0>::__bitset() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<0, 0>::__bitset(unsigned long long)
|
||||
__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
@@ -606,8 +606,8 @@ public:
|
||||
typedef typename base::const_reference const_reference;
|
||||
|
||||
// 23.3.5.1 constructors:
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset() {}
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset(unsigned long long __v) : base(__v) {}
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset() _NOEXCEPT {}
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
|
||||
template<class _CharT>
|
||||
explicit bitset(const _CharT* __str,
|
||||
typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
|
||||
@@ -620,17 +620,17 @@ public:
|
||||
_CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
|
||||
|
||||
// 23.3.5.2 bitset operations:
|
||||
bitset& operator&=(const bitset& __rhs);
|
||||
bitset& operator|=(const bitset& __rhs);
|
||||
bitset& operator^=(const bitset& __rhs);
|
||||
bitset& operator<<=(size_t __pos);
|
||||
bitset& operator>>=(size_t __pos);
|
||||
bitset& set();
|
||||
bitset& operator&=(const bitset& __rhs) _NOEXCEPT;
|
||||
bitset& operator|=(const bitset& __rhs) _NOEXCEPT;
|
||||
bitset& operator^=(const bitset& __rhs) _NOEXCEPT;
|
||||
bitset& operator<<=(size_t __pos) _NOEXCEPT;
|
||||
bitset& operator>>=(size_t __pos) _NOEXCEPT;
|
||||
bitset& set() _NOEXCEPT;
|
||||
bitset& set(size_t __pos, bool __val = true);
|
||||
bitset& reset();
|
||||
bitset& reset() _NOEXCEPT;
|
||||
bitset& reset(size_t __pos);
|
||||
bitset operator~() const;
|
||||
bitset& flip();
|
||||
bitset operator~() const _NOEXCEPT;
|
||||
bitset& flip() _NOEXCEPT;
|
||||
bitset& flip(size_t __pos);
|
||||
|
||||
// element access:
|
||||
@@ -649,21 +649,21 @@ public:
|
||||
_CharT __one = _CharT('1')) const;
|
||||
basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
|
||||
char __one = '1') const;
|
||||
size_t count() const;
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY size_t size() const {return _Size;}
|
||||
bool operator==(const bitset& __rhs) const;
|
||||
bool operator!=(const bitset& __rhs) const;
|
||||
size_t count() const _NOEXCEPT;
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY size_t size() const _NOEXCEPT {return _Size;}
|
||||
bool operator==(const bitset& __rhs) const _NOEXCEPT;
|
||||
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
|
||||
bool test(size_t __pos) const;
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool none() const {return !any();}
|
||||
bitset operator<<(size_t __pos) const;
|
||||
bitset operator>>(size_t __pos) const;
|
||||
bool all() const _NOEXCEPT;
|
||||
bool any() const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();}
|
||||
bitset operator<<(size_t __pos) const _NOEXCEPT;
|
||||
bitset operator>>(size_t __pos) const _NOEXCEPT;
|
||||
|
||||
private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t __hash_code() const {return base::__hash_code();}
|
||||
size_t __hash_code() const _NOEXCEPT {return base::__hash_code();}
|
||||
|
||||
friend struct hash<bitset>;
|
||||
};
|
||||
@@ -732,7 +732,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator&=(const bitset& __rhs)
|
||||
bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
|
||||
{
|
||||
base::operator&=(__rhs);
|
||||
return *this;
|
||||
@@ -741,7 +741,7 @@ bitset<_Size>::operator&=(const bitset& __rhs)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator|=(const bitset& __rhs)
|
||||
bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT
|
||||
{
|
||||
base::operator|=(__rhs);
|
||||
return *this;
|
||||
@@ -750,7 +750,7 @@ bitset<_Size>::operator|=(const bitset& __rhs)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator^=(const bitset& __rhs)
|
||||
bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT
|
||||
{
|
||||
base::operator^=(__rhs);
|
||||
return *this;
|
||||
@@ -758,7 +758,7 @@ bitset<_Size>::operator^=(const bitset& __rhs)
|
||||
|
||||
template <size_t _Size>
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator<<=(size_t __pos)
|
||||
bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
|
||||
{
|
||||
__pos = _STD::min(__pos, _Size);
|
||||
_STD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
|
||||
@@ -768,7 +768,7 @@ bitset<_Size>::operator<<=(size_t __pos)
|
||||
|
||||
template <size_t _Size>
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator>>=(size_t __pos)
|
||||
bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
|
||||
{
|
||||
__pos = _STD::min(__pos, _Size);
|
||||
_STD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
|
||||
@@ -779,7 +779,7 @@ bitset<_Size>::operator>>=(size_t __pos)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::set()
|
||||
bitset<_Size>::set() _NOEXCEPT
|
||||
{
|
||||
_STD::fill_n(base::__make_iter(0), _Size, true);
|
||||
return *this;
|
||||
@@ -802,7 +802,7 @@ bitset<_Size>::set(size_t __pos, bool __val)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::reset()
|
||||
bitset<_Size>::reset() _NOEXCEPT
|
||||
{
|
||||
_STD::fill_n(base::__make_iter(0), _Size, false);
|
||||
return *this;
|
||||
@@ -825,7 +825,7 @@ bitset<_Size>::reset(size_t __pos)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
bitset<_Size>::operator~() const
|
||||
bitset<_Size>::operator~() const _NOEXCEPT
|
||||
{
|
||||
bitset __x(*this);
|
||||
__x.flip();
|
||||
@@ -835,7 +835,7 @@ bitset<_Size>::operator~() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::flip()
|
||||
bitset<_Size>::flip() _NOEXCEPT
|
||||
{
|
||||
base::flip();
|
||||
return *this;
|
||||
@@ -915,7 +915,7 @@ bitset<_Size>::to_string(char __zero, char __one) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
bitset<_Size>::count() const
|
||||
bitset<_Size>::count() const _NOEXCEPT
|
||||
{
|
||||
return static_cast<size_t>(_STD::count(base::__make_iter(0), base::__make_iter(_Size), true));
|
||||
}
|
||||
@@ -923,7 +923,7 @@ bitset<_Size>::count() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::operator==(const bitset& __rhs) const
|
||||
bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
|
||||
{
|
||||
return _STD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
|
||||
}
|
||||
@@ -931,7 +931,7 @@ bitset<_Size>::operator==(const bitset& __rhs) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::operator!=(const bitset& __rhs) const
|
||||
bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT
|
||||
{
|
||||
return !(*this == __rhs);
|
||||
}
|
||||
@@ -952,7 +952,7 @@ bitset<_Size>::test(size_t __pos) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::all() const
|
||||
bitset<_Size>::all() const _NOEXCEPT
|
||||
{
|
||||
return base::all();
|
||||
}
|
||||
@@ -960,7 +960,7 @@ bitset<_Size>::all() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::any() const
|
||||
bitset<_Size>::any() const _NOEXCEPT
|
||||
{
|
||||
return base::any();
|
||||
}
|
||||
@@ -968,7 +968,7 @@ bitset<_Size>::any() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
bitset<_Size>::operator<<(size_t __pos) const
|
||||
bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT
|
||||
{
|
||||
bitset __r = *this;
|
||||
__r <<= __pos;
|
||||
@@ -978,7 +978,7 @@ bitset<_Size>::operator<<(size_t __pos) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
bitset<_Size>::operator>>(size_t __pos) const
|
||||
bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT
|
||||
{
|
||||
bitset __r = *this;
|
||||
__r >>= __pos;
|
||||
@@ -988,7 +988,7 @@ bitset<_Size>::operator>>(size_t __pos) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
operator&(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
{
|
||||
bitset<_Size> __r = __x;
|
||||
__r &= __y;
|
||||
@@ -998,7 +998,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
operator|(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
{
|
||||
bitset<_Size> __r = __x;
|
||||
__r |= __y;
|
||||
@@ -1008,7 +1008,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
operator^(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
{
|
||||
bitset<_Size> __r = __x;
|
||||
__r ^= __y;
|
||||
@@ -1020,7 +1020,7 @@ struct _LIBCPP_VISIBLE hash<bitset<_Size> >
|
||||
: public unary_function<bitset<_Size>, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const bitset<_Size>& __bs) const
|
||||
size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT
|
||||
{return __bs.__hash_code();}
|
||||
};
|
||||
|
||||
|
@@ -225,9 +225,9 @@ public:
|
||||
typedef chrono::time_point<system_clock> time_point;
|
||||
static const bool is_steady = false;
|
||||
|
||||
static time_point now();
|
||||
static time_t to_time_t (const time_point& __t);
|
||||
static time_point from_time_t(time_t __t);
|
||||
static time_point now() noexcept;
|
||||
static time_t to_time_t (const time_point& __t) noexcept;
|
||||
static time_point from_time_t(time_t __t) noexcept;
|
||||
};
|
||||
|
||||
class steady_clock
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
typedef chrono::time_point<steady_clock, duration> time_point;
|
||||
static const bool is_steady = true;
|
||||
|
||||
static time_point now();
|
||||
static time_point now() noexcept;
|
||||
};
|
||||
|
||||
typedef steady_clock high_resolution_clock;
|
||||
@@ -845,9 +845,9 @@ public:
|
||||
typedef chrono::time_point<system_clock> time_point;
|
||||
static const bool is_steady = false;
|
||||
|
||||
static time_point now();
|
||||
static time_t to_time_t (const time_point& __t);
|
||||
static time_point from_time_t(time_t __t);
|
||||
static time_point now() _NOEXCEPT;
|
||||
static time_t to_time_t (const time_point& __t) _NOEXCEPT;
|
||||
static time_point from_time_t(time_t __t) _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE steady_clock
|
||||
@@ -859,7 +859,7 @@ public:
|
||||
typedef chrono::time_point<steady_clock, duration> time_point;
|
||||
static const bool is_steady = true;
|
||||
|
||||
static time_point now();
|
||||
static time_point now() _NOEXCEPT;
|
||||
};
|
||||
|
||||
typedef steady_clock high_resolution_clock;
|
||||
|
674
include/cmath
674
include/cmath
@@ -303,8 +303,340 @@ long double truncl(long double x);
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
// signbit
|
||||
|
||||
#ifdef signbit
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_signbit(_A1 __x)
|
||||
{
|
||||
return signbit(__x);
|
||||
}
|
||||
|
||||
#undef signbit
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
signbit(_A1 __x)
|
||||
{
|
||||
return __libcpp_signbit(__x);
|
||||
}
|
||||
|
||||
#endif // signbit
|
||||
|
||||
// fpclassify
|
||||
|
||||
#ifdef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int
|
||||
__libcpp_fpclassify(_A1 __x)
|
||||
{
|
||||
return fpclassify(__x);
|
||||
}
|
||||
|
||||
#undef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
|
||||
fpclassify(_A1 __x)
|
||||
{
|
||||
return __libcpp_fpclassify(__x);
|
||||
}
|
||||
|
||||
#endif // fpclassify
|
||||
|
||||
// isfinite
|
||||
|
||||
#ifdef isfinite
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isfinite(_A1 __x)
|
||||
{
|
||||
return isfinite(__x);
|
||||
}
|
||||
|
||||
#undef isfinite
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isfinite(_A1 __x)
|
||||
{
|
||||
return __libcpp_isfinite(__x);
|
||||
}
|
||||
|
||||
#endif // isfinite
|
||||
|
||||
// isinf
|
||||
|
||||
#ifdef isinf
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isinf(_A1 __x)
|
||||
{
|
||||
return isinf(__x);
|
||||
}
|
||||
|
||||
#undef isinf
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isinf(_A1 __x)
|
||||
{
|
||||
return __libcpp_isinf(__x);
|
||||
}
|
||||
|
||||
#endif // isinf
|
||||
|
||||
// isnan
|
||||
|
||||
#ifdef isnan
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnan(_A1 __x)
|
||||
{
|
||||
return isnan(__x);
|
||||
}
|
||||
|
||||
#undef isnan
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isnan(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnan(__x);
|
||||
}
|
||||
|
||||
#endif // isnan
|
||||
|
||||
// isnormal
|
||||
|
||||
#ifdef isnormal
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnormal(_A1 __x)
|
||||
{
|
||||
return isnormal(__x);
|
||||
}
|
||||
|
||||
#undef isnormal
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isnormal(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnormal(__x);
|
||||
}
|
||||
|
||||
#endif // isnormal
|
||||
|
||||
// isgreater
|
||||
|
||||
#ifdef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreater
|
||||
|
||||
// isgreaterequal
|
||||
|
||||
#ifdef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreaterequal
|
||||
|
||||
// isless
|
||||
|
||||
#ifdef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isless(__x, __y);
|
||||
}
|
||||
|
||||
#undef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isless(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isless
|
||||
|
||||
// islessequal
|
||||
|
||||
#ifdef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessequal
|
||||
|
||||
// islessgreater
|
||||
|
||||
#ifdef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessgreater
|
||||
|
||||
// isunordered
|
||||
|
||||
#ifdef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#undef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isunordered
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
using ::signbit;
|
||||
using ::fpclassify;
|
||||
using ::isfinite;
|
||||
using ::isinf;
|
||||
using ::isnan;
|
||||
using ::isnormal;
|
||||
using ::isgreater;
|
||||
using ::isgreaterequal;
|
||||
using ::isless;
|
||||
using ::islessequal;
|
||||
using ::islessgreater;
|
||||
using ::isunordered;
|
||||
using ::isunordered;
|
||||
|
||||
using ::float_t;
|
||||
using ::double_t;
|
||||
|
||||
@@ -629,348 +961,6 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
tanh(_A1 __x) {return tanh((double)__x);}
|
||||
|
||||
// signbit
|
||||
|
||||
#ifndef signbit
|
||||
#error Implementation error: signbit not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_signbit(_A1 __x)
|
||||
{
|
||||
return signbit(__x);
|
||||
}
|
||||
|
||||
#undef signbit
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
signbit(_A1 __x)
|
||||
{
|
||||
return __libcpp_signbit(__x);
|
||||
}
|
||||
|
||||
#endif // signbit
|
||||
|
||||
// fpclassify
|
||||
|
||||
#ifndef fpclassify
|
||||
#error Implementation error: fpclassify not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int
|
||||
__libcpp_fpclassify(_A1 __x)
|
||||
{
|
||||
return fpclassify(__x);
|
||||
}
|
||||
|
||||
#undef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, int>::type
|
||||
fpclassify(_A1 __x)
|
||||
{
|
||||
return __libcpp_fpclassify(__x);
|
||||
}
|
||||
|
||||
#endif // fpclassify
|
||||
|
||||
// isfinite
|
||||
|
||||
#ifndef isfinite
|
||||
#error Implementation error: isfinite not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isfinite(_A1 __x)
|
||||
{
|
||||
return isfinite(__x);
|
||||
}
|
||||
|
||||
#undef isfinite
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isfinite(_A1 __x)
|
||||
{
|
||||
return __libcpp_isfinite(__x);
|
||||
}
|
||||
|
||||
#endif // isfinite
|
||||
|
||||
// isinf
|
||||
|
||||
#ifndef isinf
|
||||
#error Implementation error: isinf not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isinf(_A1 __x)
|
||||
{
|
||||
return isinf(__x);
|
||||
}
|
||||
|
||||
#undef isinf
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isinf(_A1 __x)
|
||||
{
|
||||
return __libcpp_isinf(__x);
|
||||
}
|
||||
|
||||
#endif // isinf
|
||||
|
||||
// isnan
|
||||
|
||||
#ifndef isnan
|
||||
#error Implementation error: isnan not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnan(_A1 __x)
|
||||
{
|
||||
return isnan(__x);
|
||||
}
|
||||
|
||||
#undef isnan
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isnan(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnan(__x);
|
||||
}
|
||||
|
||||
#endif // isnan
|
||||
|
||||
// isnormal
|
||||
|
||||
#ifndef isnormal
|
||||
#error Implementation error: isnormal not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnormal(_A1 __x)
|
||||
{
|
||||
return isnormal(__x);
|
||||
}
|
||||
|
||||
#undef isnormal
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isnormal(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnormal(__x);
|
||||
}
|
||||
|
||||
#endif // isnormal
|
||||
|
||||
// isgreater
|
||||
|
||||
#ifndef isgreater
|
||||
#error Implementation error: isgreater not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreater
|
||||
|
||||
// isgreaterequal
|
||||
|
||||
#ifndef isgreaterequal
|
||||
#error Implementation error: isgreaterequal not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreaterequal
|
||||
|
||||
// isless
|
||||
|
||||
#ifndef isless
|
||||
#error Implementation error: isless not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isless(__x, __y);
|
||||
}
|
||||
|
||||
#undef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isless(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isless
|
||||
|
||||
// islessequal
|
||||
|
||||
#ifndef islessequal
|
||||
#error Implementation error: islessequal not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessequal
|
||||
|
||||
// islessgreater
|
||||
|
||||
#ifndef islessgreater
|
||||
#error Implementation error: islessgreater not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessgreater
|
||||
|
||||
// isunordered
|
||||
|
||||
#ifndef isunordered
|
||||
#error Implementation error: isunordered not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#undef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isunordered
|
||||
|
||||
// acosh
|
||||
|
||||
using ::acosh;
|
||||
|
@@ -84,12 +84,17 @@ inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
||||
|
||||
#define nullptr _STD::__get_nullptr_t()
|
||||
|
||||
#else // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
namespace std
|
||||
{
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
#endif // _LIBCPP_CSTDDEF
|
||||
|
188
include/deque
188
include/deque
@@ -38,7 +38,7 @@ public:
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
deque();
|
||||
deque() noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit deque(const allocator_type& a);
|
||||
explicit deque(size_type n);
|
||||
deque(size_type n, const value_type& v);
|
||||
@@ -48,14 +48,18 @@ public:
|
||||
template <class InputIterator>
|
||||
deque(InputIterator f, InputIterator l, const allocator_type& a);
|
||||
deque(const deque& c);
|
||||
deque(deque&& c);
|
||||
deque(deque&& c)
|
||||
noexcept(is_nothrow_move_constructible<allocator_type>::value);
|
||||
deque(initializer_list<value_type> il, const Allocator& a = allocator_type());
|
||||
deque(const deque& c, const allocator_type& a);
|
||||
deque(deque&& c, const allocator_type& a);
|
||||
~deque();
|
||||
|
||||
deque& operator=(const deque& c);
|
||||
deque& operator=(deque&& c);
|
||||
deque& operator=(deque&& c)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
deque& operator=(initializer_list<value_type> il);
|
||||
|
||||
template <class InputIterator>
|
||||
@@ -63,32 +67,32 @@ public:
|
||||
void assign(size_type n, const value_type& v);
|
||||
void assign(initializer_list<value_type> il);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
// iterators:
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
// capacity:
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
void resize(size_type n);
|
||||
void resize(size_type n, const value_type& v);
|
||||
void shrink_to_fit();
|
||||
bool empty() const;
|
||||
bool empty() const noexcept;
|
||||
|
||||
// element access:
|
||||
reference operator[](size_type i);
|
||||
@@ -118,8 +122,10 @@ public:
|
||||
void pop_back();
|
||||
iterator erase(const_iterator p);
|
||||
iterator erase(const_iterator f, const_iterator l);
|
||||
void swap(deque& c);
|
||||
void clear();
|
||||
void swap(deque& c)
|
||||
noexcept(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
void clear() noexcept;
|
||||
};
|
||||
|
||||
template <class T, class Allocator>
|
||||
@@ -137,7 +143,8 @@ template <class T, class Allocator>
|
||||
|
||||
// specialized algorithms:
|
||||
template <class T, class Allocator>
|
||||
void swap(deque<T,Allocator>& x, deque<T,Allocator>& y);
|
||||
void swap(deque<T,Allocator>& x, deque<T,Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -267,12 +274,12 @@ public:
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
typedef _Reference reference;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __deque_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT {}
|
||||
|
||||
template <class _P, class _R, class _MP>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__deque_iterator(const __deque_iterator<value_type, _P, _R, _MP, difference_type, __block_size>& __it,
|
||||
typename enable_if<is_convertible<_P, pointer>::value>::type* = 0)
|
||||
typename enable_if<is_convertible<_P, pointer>::value>::type* = 0) _NOEXCEPT
|
||||
: __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__ptr_;}
|
||||
@@ -395,7 +402,7 @@ public:
|
||||
{return !(__x < __y);}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY __deque_iterator(__map_iterator __m, pointer __p)
|
||||
_LIBCPP_INLINE_VISIBILITY __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
|
||||
: __m_iter_(__m), __ptr_(__p) {}
|
||||
|
||||
template <class _Tp, class _A> friend class __deque_base;
|
||||
@@ -916,33 +923,43 @@ protected:
|
||||
size_type __start_;
|
||||
__compressed_pair<size_type, allocator_type> __size_;
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() _NOEXCEPT;
|
||||
const_iterator begin() const _NOEXCEPT;
|
||||
iterator end() _NOEXCEPT;
|
||||
const_iterator end() const _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type& size() {return __size_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const size_type& size() const {return __size_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const size_type& size() const _NOEXCEPT {return __size_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type& __alloc() {return __size_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const allocator_type& __alloc() const {return __size_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const allocator_type& __alloc() const _NOEXCEPT {return __size_.second();}
|
||||
|
||||
__deque_base();
|
||||
__deque_base()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit __deque_base(const allocator_type& __a);
|
||||
public:
|
||||
~__deque_base();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
__deque_base(__deque_base&& __c);
|
||||
__deque_base(__deque_base&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
|
||||
__deque_base(__deque_base&& __c, const allocator_type& __a);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void swap(__deque_base& __c);
|
||||
void clear();
|
||||
void swap(__deque_base& __c)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
protected:
|
||||
void clear() _NOEXCEPT;
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign(__deque_base& __c)
|
||||
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__map_ = _STD::move(__c.__map_);
|
||||
__start_ = __c.__start_;
|
||||
@@ -953,27 +970,33 @@ protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__deque_base& __c)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{__move_assign_alloc(__c, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_move_assignment::value>());}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __deque_base& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __deque_base& __c, false_type)
|
||||
void __move_assign_alloc(const __deque_base& __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 ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_swap::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
@@ -981,6 +1004,7 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -1015,7 +1039,7 @@ __deque_base<_Tp, _Allocator>::__invariants() const
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename __deque_base<_Tp, _Allocator>::iterator
|
||||
__deque_base<_Tp, _Allocator>::begin()
|
||||
__deque_base<_Tp, _Allocator>::begin() _NOEXCEPT
|
||||
{
|
||||
__map_pointer __mp = __map_.begin() + __start_ / __block_size;
|
||||
return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
|
||||
@@ -1023,7 +1047,7 @@ __deque_base<_Tp, _Allocator>::begin()
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename __deque_base<_Tp, _Allocator>::const_iterator
|
||||
__deque_base<_Tp, _Allocator>::begin() const
|
||||
__deque_base<_Tp, _Allocator>::begin() const _NOEXCEPT
|
||||
{
|
||||
__map_const_pointer __mp = __map_.begin() + __start_ / __block_size;
|
||||
return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
|
||||
@@ -1031,7 +1055,7 @@ __deque_base<_Tp, _Allocator>::begin() const
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename __deque_base<_Tp, _Allocator>::iterator
|
||||
__deque_base<_Tp, _Allocator>::end()
|
||||
__deque_base<_Tp, _Allocator>::end() _NOEXCEPT
|
||||
{
|
||||
size_type __p = size() + __start_;
|
||||
__map_pointer __mp = __map_.begin() + __p / __block_size;
|
||||
@@ -1040,7 +1064,7 @@ __deque_base<_Tp, _Allocator>::end()
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename __deque_base<_Tp, _Allocator>::const_iterator
|
||||
__deque_base<_Tp, _Allocator>::end() const
|
||||
__deque_base<_Tp, _Allocator>::end() const _NOEXCEPT
|
||||
{
|
||||
size_type __p = size() + __start_;
|
||||
__map_const_pointer __mp = __map_.begin() + __p / __block_size;
|
||||
@@ -1050,6 +1074,7 @@ __deque_base<_Tp, _Allocator>::end() const
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__deque_base<_Tp, _Allocator>::__deque_base()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
: __start_(0), __size_(0) {}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
@@ -1071,6 +1096,7 @@ __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_(_STD::move(__c.__map_)),
|
||||
__start_(_STD::move(__c.__start_)),
|
||||
__size_(_STD::move(__c.__size_))
|
||||
@@ -1103,6 +1129,8 @@ __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
__map_.swap(__c.__map_);
|
||||
_STD::swap(__start_, __c.__start_);
|
||||
@@ -1112,7 +1140,7 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__deque_base<_Tp, _Allocator>::clear()
|
||||
__deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
|
||||
{
|
||||
allocator_type& __a = __alloc();
|
||||
for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
|
||||
@@ -1160,7 +1188,10 @@ public:
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY deque() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
deque()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY deque(const allocator_type& __a) : __base(__a) {}
|
||||
explicit deque(size_type __n);
|
||||
deque(size_type __n, const value_type& __v);
|
||||
@@ -1181,9 +1212,11 @@ public:
|
||||
deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
deque(deque&& __c);
|
||||
deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
|
||||
deque(deque&& __c, const allocator_type& __a);
|
||||
deque& operator=(deque&& __c);
|
||||
deque& operator=(deque&& __c)
|
||||
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _InputIter>
|
||||
@@ -1197,45 +1230,56 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const _NOEXCEPT;
|
||||
|
||||
// iterators:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __base::begin();}
|
||||
iterator begin() _NOEXCEPT {return __base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __base::begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __base::end();}
|
||||
iterator end() _NOEXCEPT {return __base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __base::end();}
|
||||
const_iterator end() const _NOEXCEPT {return __base::end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(__base::end());}
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(__base::end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(__base::end());}
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(__base::end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(__base::begin());}
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(__base::begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(__base::begin());}
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(__base::begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __base::begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT
|
||||
{return __base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __base::end();}
|
||||
const_iterator cend() const _NOEXCEPT
|
||||
{return __base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return const_reverse_iterator(__base::end());}
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(__base::end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return const_reverse_iterator(__base::begin());}
|
||||
const_reverse_iterator crend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(__base::begin());}
|
||||
|
||||
// capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return __base::size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __alloc_traits::max_size(__base::__alloc());}
|
||||
size_type size() const _NOEXCEPT {return __base::size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const _NOEXCEPT
|
||||
{return __alloc_traits::max_size(__base::__alloc());}
|
||||
void resize(size_type __n);
|
||||
void resize(size_type __n, const value_type& __v);
|
||||
void shrink_to_fit();
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return __base::size() == 0;}
|
||||
void shrink_to_fit() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __base::size() == 0;}
|
||||
|
||||
// element access:
|
||||
reference operator[](size_type __i);
|
||||
@@ -1277,8 +1321,10 @@ public:
|
||||
iterator erase(const_iterator __p);
|
||||
iterator erase(const_iterator __f, const_iterator __l);
|
||||
|
||||
void swap(deque& __c);
|
||||
void clear();
|
||||
void swap(deque& __c)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
void clear() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool __invariants() const {return __base::__invariants();}
|
||||
@@ -1348,7 +1394,8 @@ private:
|
||||
void __copy_assign_alloc(const deque& __c, false_type)
|
||||
{}
|
||||
|
||||
void __move_assign(deque& __c, true_type);
|
||||
void __move_assign(deque& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
||||
void __move_assign(deque& __c, false_type);
|
||||
};
|
||||
|
||||
@@ -1435,6 +1482,7 @@ deque<_Tp, _Allocator>::operator=(const deque& __c)
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
deque<_Tp, _Allocator>::deque(deque&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __base(_STD::move(__c))
|
||||
{
|
||||
}
|
||||
@@ -1455,6 +1503,8 @@ template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
deque<_Tp, _Allocator>&
|
||||
deque<_Tp, _Allocator>::operator=(deque&& __c)
|
||||
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__move_assign(__c, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -1477,6 +1527,7 @@ deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type)
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
clear();
|
||||
shrink_to_fit();
|
||||
@@ -1535,7 +1586,7 @@ deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v)
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_Allocator
|
||||
deque<_Tp, _Allocator>::get_allocator() const
|
||||
deque<_Tp, _Allocator>::get_allocator() const _NOEXCEPT
|
||||
{
|
||||
return __base::__alloc();
|
||||
}
|
||||
@@ -1562,7 +1613,7 @@ deque<_Tp, _Allocator>::resize(size_type __n, const value_type& __v)
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
deque<_Tp, _Allocator>::shrink_to_fit()
|
||||
deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
{
|
||||
allocator_type& __a = __base::__alloc();
|
||||
if (empty())
|
||||
@@ -2700,6 +2751,8 @@ template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
deque<_Tp, _Allocator>::swap(deque& __c)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
__base::swap(__c);
|
||||
}
|
||||
@@ -2707,7 +2760,7 @@ deque<_Tp, _Allocator>::swap(deque& __c)
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
deque<_Tp, _Allocator>::clear()
|
||||
deque<_Tp, _Allocator>::clear() _NOEXCEPT
|
||||
{
|
||||
__base::clear();
|
||||
}
|
||||
@@ -2765,6 +2818,7 @@ template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -20,56 +20,56 @@ namespace std
|
||||
class exception
|
||||
{
|
||||
public:
|
||||
exception() throw();
|
||||
exception(const exception&) throw();
|
||||
exception& operator=(const exception&) throw();
|
||||
virtual ~exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
exception() noexcept;
|
||||
exception(const exception&) noexcept;
|
||||
exception& operator=(const exception&) noexcept;
|
||||
virtual ~exception() noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
};
|
||||
|
||||
class bad_exception
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_exception() throw();
|
||||
bad_exception(const bad_exception&) throw();
|
||||
bad_exception& operator=(const bad_exception&) throw();
|
||||
virtual ~bad_exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_exception() noexcept;
|
||||
bad_exception(const bad_exception&) noexcept;
|
||||
bad_exception& operator=(const bad_exception&) noexcept;
|
||||
virtual ~bad_exception() noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
};
|
||||
|
||||
typedef void (*unexpected_handler)();
|
||||
unexpected_handler set_unexpected(unexpected_handler f ) throw();
|
||||
unexpected_handler get_unexpected() throw();
|
||||
void unexpected [[noreturn]] ();
|
||||
unexpected_handler set_unexpected(unexpected_handler f ) noexcept;
|
||||
unexpected_handler get_unexpected() noexcept;
|
||||
[[noreturn]] void unexpected();
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
terminate_handler set_terminate(terminate_handler f ) throw();
|
||||
terminate_handler get_terminate() throw();
|
||||
void terminate [[noreturn]] ();
|
||||
terminate_handler set_terminate(terminate_handler f ) noexcept;
|
||||
terminate_handler get_terminate() noexcept;
|
||||
[[noreturn]] void terminate() noexcept;
|
||||
|
||||
bool uncaught_exception() throw();
|
||||
bool uncaught_exception() noexcept;
|
||||
|
||||
typedef unspecified exception_ptr;
|
||||
|
||||
exception_ptr current_exception();
|
||||
exception_ptr current_exception() noexcept;
|
||||
void rethrow_exception [[noreturn]] (exception_ptr p);
|
||||
template<class E> exception_ptr make_exception_ptr(E e);
|
||||
template<class E> exception_ptr make_exception_ptr(E e) noexcept;
|
||||
|
||||
class nested_exception
|
||||
{
|
||||
public:
|
||||
nested_exception() throw();
|
||||
nested_exception(const nested_exception&) throw() = default;
|
||||
nested_exception& operator=(const nested_exception&) throw() = default;
|
||||
nested_exception() noexcept;
|
||||
nested_exception(const nested_exception&) noexcept = default;
|
||||
nested_exception& operator=(const nested_exception&) noexcept = default;
|
||||
virtual ~nested_exception() = default;
|
||||
|
||||
// access functions
|
||||
void rethrow_nested [[noreturn]] () const;
|
||||
exception_ptr nested_ptr() const;
|
||||
[[noreturn]] void rethrow_nested() const;
|
||||
exception_ptr nested_ptr() const noexcept;
|
||||
};
|
||||
|
||||
template <class T> void throw_with_nested [[noreturn]] (T&& t);
|
||||
template <class T> [[noreturn]] void throw_with_nested(T&& t);
|
||||
template <class E> void rethrow_if_nested(const E& e);
|
||||
|
||||
} // std
|
||||
@@ -88,65 +88,65 @@ namespace std // purposefully not using versioning namespace
|
||||
class _LIBCPP_EXCEPTION_ABI exception
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY exception() throw() {}
|
||||
virtual ~exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
_LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
|
||||
virtual ~exception() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_exception
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY bad_exception() throw() {}
|
||||
virtual ~bad_exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
_LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
|
||||
virtual ~bad_exception() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
typedef void (*unexpected_handler)();
|
||||
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) throw();
|
||||
_LIBCPP_VISIBLE unexpected_handler get_unexpected() throw();
|
||||
_LIBCPP_VISIBLE void unexpected();
|
||||
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void unexpected();
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) throw();
|
||||
_LIBCPP_VISIBLE terminate_handler get_terminate() throw();
|
||||
_LIBCPP_VISIBLE void terminate() __attribute__((__noreturn__));
|
||||
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_VISIBLE bool uncaught_exception() throw();
|
||||
_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
|
||||
|
||||
class exception_ptr;
|
||||
|
||||
exception_ptr current_exception();
|
||||
void rethrow_exception(exception_ptr); // noreturn
|
||||
exception_ptr current_exception() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) void rethrow_exception(exception_ptr);
|
||||
|
||||
class _LIBCPP_VISIBLE exception_ptr
|
||||
{
|
||||
void* __ptr_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr() : __ptr_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) : __ptr_() {}
|
||||
exception_ptr(const exception_ptr&);
|
||||
exception_ptr& operator=(const exception_ptr&);
|
||||
~exception_ptr();
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
|
||||
exception_ptr(const exception_ptr&) _NOEXCEPT;
|
||||
exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
|
||||
~exception_ptr() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool() const {return __ptr_ != nullptr;}
|
||||
operator bool() const _NOEXCEPT {return __ptr_ != nullptr;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const exception_ptr& __x, const exception_ptr& __y)
|
||||
bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const exception_ptr& __x, const exception_ptr& __y)
|
||||
bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
|
||||
friend exception_ptr current_exception();
|
||||
friend void rethrow_exception(exception_ptr); // noreturn
|
||||
friend exception_ptr current_exception() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr);
|
||||
};
|
||||
|
||||
template<class _E>
|
||||
exception_ptr
|
||||
make_exception_ptr(_E __e)
|
||||
make_exception_ptr(_E __e) _NOEXCEPT
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
@@ -166,14 +166,14 @@ class _LIBCPP_EXCEPTION_ABI nested_exception
|
||||
{
|
||||
exception_ptr __ptr_;
|
||||
public:
|
||||
nested_exception();
|
||||
// nested_exception(const nested_exception&) throw() = default;
|
||||
// nested_exception& operator=(const nested_exception&) throw() = default;
|
||||
virtual ~nested_exception();
|
||||
nested_exception() _NOEXCEPT;
|
||||
// nested_exception(const nested_exception&) noexcept = default;
|
||||
// nested_exception& operator=(const nested_exception&) noexcept = default;
|
||||
virtual ~nested_exception() _NOEXCEPT;
|
||||
|
||||
// access functions
|
||||
void rethrow_nested /*[[noreturn]]*/ () const;
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const {return __ptr_;}
|
||||
_ATTRIBUTE(noreturn) void rethrow_nested() const;
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
@@ -185,9 +185,10 @@ struct __nested
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
throw_with_nested /*[[noreturn]]*/ (_Tp&& __t, typename enable_if<
|
||||
throw_with_nested(_Tp&& __t, typename enable_if<
|
||||
is_class<typename remove_reference<_Tp>::type>::value &&
|
||||
!is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
|
||||
>::type* = 0)
|
||||
@@ -203,9 +204,10 @@ throw_with_nested (_Tp& __t, typename enable_if<
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
throw_with_nested /*[[noreturn]]*/ (_Tp&& __t, typename enable_if<
|
||||
throw_with_nested(_Tp&& __t, typename enable_if<
|
||||
!is_class<typename remove_reference<_Tp>::type>::value ||
|
||||
is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
|
||||
>::type* = 0)
|
||||
|
@@ -34,7 +34,8 @@ public:
|
||||
typedef <details> iterator;
|
||||
typedef <details> const_iterator;
|
||||
|
||||
forward_list();
|
||||
forward_list()
|
||||
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit forward_list(const allocator_type& a);
|
||||
explicit forward_list(size_type n);
|
||||
forward_list(size_type n, const value_type& v);
|
||||
@@ -45,7 +46,8 @@ public:
|
||||
forward_list(InputIterator first, InputIterator last, const allocator_type& a);
|
||||
forward_list(const forward_list& x);
|
||||
forward_list(const forward_list& x, const allocator_type& a);
|
||||
forward_list(forward_list&& x);
|
||||
forward_list(forward_list&& x)
|
||||
noexcept(is_nothrow_move_constructible<allocator_type>::value);
|
||||
forward_list(forward_list&& x, const allocator_type& a);
|
||||
forward_list(initializer_list<value_type> il);
|
||||
forward_list(initializer_list<value_type> il, const allocator_type& a);
|
||||
@@ -53,7 +55,10 @@ public:
|
||||
~forward_list();
|
||||
|
||||
forward_list& operator=(const forward_list& x);
|
||||
forward_list& operator=(forward_list&& x);
|
||||
forward_list& operator=(forward_list&& x)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
forward_list& operator=(initializer_list<value_type> il);
|
||||
|
||||
template <class InputIterator>
|
||||
@@ -61,22 +66,22 @@ public:
|
||||
void assign(size_type n, const value_type& v);
|
||||
void assign(initializer_list<value_type> il);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
iterator before_begin();
|
||||
const_iterator before_begin() const;
|
||||
const_iterator cbefore_begin() const;
|
||||
iterator before_begin() noexcept;
|
||||
const_iterator before_begin() const noexcept;
|
||||
const_iterator cbefore_begin() const noexcept;
|
||||
|
||||
bool empty() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
reference front();
|
||||
const_reference front() const;
|
||||
@@ -100,11 +105,13 @@ public:
|
||||
iterator erase_after(const_iterator p);
|
||||
iterator erase_after(const_iterator first, const_iterator last);
|
||||
|
||||
void swap(forward_list& x);
|
||||
void swap(forward_list& x)
|
||||
noexcept(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
|
||||
void resize(size_type n);
|
||||
void resize(size_type n, const value_type& v);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void splice_after(const_iterator p, forward_list& x);
|
||||
void splice_after(const_iterator p, forward_list&& x);
|
||||
@@ -124,7 +131,7 @@ public:
|
||||
template <class Compare> void merge(forward_list&& x, Compare comp);
|
||||
void sort();
|
||||
template <class Compare> void sort(Compare comp);
|
||||
void reverse();
|
||||
void reverse() noexcept;
|
||||
};
|
||||
|
||||
template <class T, class Allocator>
|
||||
@@ -152,7 +159,8 @@ template <class T, class Allocator>
|
||||
const forward_list<T, Allocator>& y);
|
||||
|
||||
template <class T, class Allocator>
|
||||
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y);
|
||||
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -211,7 +219,7 @@ class _LIBCPP_VISIBLE __forward_list_iterator
|
||||
__node_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __forward_list_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||
|
||||
template<class, class> friend class forward_list;
|
||||
template<class> friend class __forward_list_const_iterator;
|
||||
@@ -232,7 +240,7 @@ public:
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_iterator() : __ptr_(nullptr) {}
|
||||
__forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
@@ -271,7 +279,7 @@ class _LIBCPP_VISIBLE __forward_list_const_iterator
|
||||
__node_const_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __forward_list_const_iterator(__node_const_pointer __p)
|
||||
explicit __forward_list_const_iterator(__node_const_pointer __p) _NOEXCEPT
|
||||
: __ptr_(__p) {}
|
||||
|
||||
typedef typename remove_const
|
||||
@@ -303,9 +311,9 @@ public:
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_const_iterator() : __ptr_(nullptr) {}
|
||||
__forward_list_const_iterator() _NOEXCEPT : __ptr_(nullptr) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_const_iterator(__forward_list_iterator<__node_pointer> __p)
|
||||
__forward_list_const_iterator(__forward_list_iterator<__node_pointer> __p) _NOEXCEPT
|
||||
: __ptr_(__p.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -361,41 +369,47 @@ protected:
|
||||
__compressed_pair<__begin_node, __node_allocator> __before_begin_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer __before_begin()
|
||||
__node_pointer __before_begin() _NOEXCEPT
|
||||
{return pointer_traits<__node_pointer>::pointer_to(
|
||||
static_cast<__node&>(__before_begin_.first()));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_const_pointer __before_begin() const
|
||||
__node_const_pointer __before_begin() const _NOEXCEPT
|
||||
{return pointer_traits<__node_const_pointer>::pointer_to(
|
||||
static_cast<const __node&>(__before_begin_.first()));}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_allocator& __alloc() {return __before_begin_.second();}
|
||||
__node_allocator& __alloc() _NOEXCEPT
|
||||
{return __before_begin_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __alloc() const {return __before_begin_.second();}
|
||||
const __node_allocator& __alloc() const _NOEXCEPT
|
||||
{return __before_begin_.second();}
|
||||
|
||||
typedef __forward_list_iterator<__node_pointer> iterator;
|
||||
typedef __forward_list_const_iterator<__node_const_pointer> const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_base()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
|
||||
: __before_begin_(__begin_node()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_base(const allocator_type& __a)
|
||||
: __before_begin_(__begin_node(), __node_allocator(__a)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__forward_list_base(__forward_list_base&& __x);
|
||||
public:
|
||||
__forward_list_base(__forward_list_base&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
|
||||
__forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
private:
|
||||
__forward_list_base(const __forward_list_base&);
|
||||
__forward_list_base& operator=(const __forward_list_base&);
|
||||
protected:
|
||||
|
||||
public:
|
||||
~__forward_list_base();
|
||||
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __forward_list_base& __x)
|
||||
{__copy_assign_alloc(__x, integral_constant<bool,
|
||||
@@ -403,11 +417,17 @@ protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x)
|
||||
_NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__move_assign_alloc(__x, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());}
|
||||
|
||||
void swap(__forward_list_base& __x);
|
||||
void clear();
|
||||
public:
|
||||
void swap(__forward_list_base& __x)
|
||||
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value);
|
||||
protected:
|
||||
void clear() _NOEXCEPT;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -421,22 +441,28 @@ private:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x, false_type) {}
|
||||
void __move_assign_alloc(__forward_list_base& __x, false_type) _NOEXCEPT
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__alloc() = _STD::move(__x.__alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
||||
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_swap::value>());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y,
|
||||
false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y,
|
||||
true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
@@ -448,6 +474,7 @@ private:
|
||||
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_(_STD::move(__x.__before_begin_))
|
||||
{
|
||||
__x.__before_begin()->__next_ = nullptr;
|
||||
@@ -478,6 +505,8 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
|
||||
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
__swap_alloc(__alloc(), __x.__alloc());
|
||||
using _STD::swap;
|
||||
@@ -486,7 +515,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
__forward_list_base<_Tp, _Alloc>::clear()
|
||||
__forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
|
||||
{
|
||||
__node_allocator& __a = __alloc();
|
||||
for (__node_pointer __p = __before_begin()->__next_; __p != nullptr;)
|
||||
@@ -504,6 +533,11 @@ class _LIBCPP_VISIBLE forward_list
|
||||
: private __forward_list_base<_Tp, _Alloc>
|
||||
{
|
||||
typedef __forward_list_base<_Tp, _Alloc> base;
|
||||
typedef typename base::__node_allocator __node_allocator;
|
||||
typedef typename base::__node __node;
|
||||
typedef typename base::__node_traits __node_traits;
|
||||
typedef typename base::__node_pointer __node_pointer;
|
||||
|
||||
public:
|
||||
typedef _Tp value_type;
|
||||
typedef _Alloc allocator_type;
|
||||
@@ -518,7 +552,10 @@ public:
|
||||
typedef typename base::iterator iterator;
|
||||
typedef typename base::const_iterator const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY forward_list() {} // = default;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
forward_list()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
|
||||
{} // = default;
|
||||
explicit forward_list(const allocator_type& __a);
|
||||
explicit forward_list(size_type __n);
|
||||
forward_list(size_type __n, const value_type& __v);
|
||||
@@ -538,7 +575,9 @@ public:
|
||||
forward_list(const forward_list& __x, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
forward_list(forward_list&& __x) : base(_STD::move(__x)) {}
|
||||
forward_list(forward_list&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<base>::value)
|
||||
: base(_STD::move(__x)) {}
|
||||
forward_list(forward_list&& __x, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
forward_list(initializer_list<value_type> __il);
|
||||
@@ -548,7 +587,10 @@ public:
|
||||
|
||||
forward_list& operator=(const forward_list& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
forward_list& operator=(forward_list&& __x);
|
||||
forward_list& operator=(forward_list&& __x)
|
||||
_NOEXCEPT_(
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
#endif
|
||||
forward_list& operator=(initializer_list<value_type> __il);
|
||||
|
||||
@@ -563,33 +605,45 @@ public:
|
||||
void assign(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return allocator_type(base::__alloc());}
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(base::__alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return iterator(base::__before_begin()->__next_);}
|
||||
iterator begin() _NOEXCEPT
|
||||
{return iterator(base::__before_begin()->__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return const_iterator(base::__before_begin()->__next_);}
|
||||
const_iterator begin() const _NOEXCEPT
|
||||
{return const_iterator(base::__before_begin()->__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return iterator(nullptr);}
|
||||
iterator end() _NOEXCEPT
|
||||
{return iterator(nullptr);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return const_iterator(nullptr);}
|
||||
const_iterator end() const _NOEXCEPT
|
||||
{return const_iterator(nullptr);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return const_iterator(base::__before_begin()->__next_);}
|
||||
const_iterator cbegin() const _NOEXCEPT
|
||||
{return const_iterator(base::__before_begin()->__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return const_iterator(nullptr);}
|
||||
const_iterator cend() const _NOEXCEPT
|
||||
{return const_iterator(nullptr);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator before_begin() {return iterator(base::__before_begin());}
|
||||
iterator before_begin() _NOEXCEPT
|
||||
{return iterator(base::__before_begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator before_begin() const {return const_iterator(base::__before_begin());}
|
||||
const_iterator before_begin() const _NOEXCEPT
|
||||
{return const_iterator(base::__before_begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbefore_begin() const {return const_iterator(base::__before_begin());}
|
||||
const_iterator cbefore_begin() const _NOEXCEPT
|
||||
{return const_iterator(base::__before_begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return base::__before_begin()->__next_ == nullptr;}
|
||||
bool empty() const _NOEXCEPT
|
||||
{return base::__before_begin()->__next_ == nullptr;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return numeric_limits<size_type>::max();}
|
||||
size_type max_size() const _NOEXCEPT
|
||||
{return numeric_limits<size_type>::max();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference front() {return base::__before_begin()->__next_->__value_;}
|
||||
@@ -630,12 +684,15 @@ public:
|
||||
iterator erase_after(const_iterator __f, const_iterator __l);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(forward_list& __x) {base::swap(__x);}
|
||||
void swap(forward_list& __x)
|
||||
_NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{base::swap(__x);}
|
||||
|
||||
void resize(size_type __n);
|
||||
void resize(size_type __n, const value_type& __v);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {base::clear();}
|
||||
void clear() _NOEXCEPT {base::clear();}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -669,16 +726,13 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void sort() {sort(__less<value_type>());}
|
||||
template <class _Compare> void sort(_Compare __comp);
|
||||
void reverse();
|
||||
void reverse() _NOEXCEPT;
|
||||
|
||||
private:
|
||||
typedef typename base::__node_allocator __node_allocator;
|
||||
typedef typename base::__node __node;
|
||||
typedef typename base::__node_traits __node_traits;
|
||||
typedef typename base::__node_pointer __node_pointer;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void __move_assign(forward_list& __x, true_type);
|
||||
void __move_assign(forward_list& __x, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
||||
void __move_assign(forward_list& __x, false_type);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -820,6 +874,7 @@ forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
clear();
|
||||
base::__move_assign_alloc(__x);
|
||||
@@ -844,6 +899,9 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
forward_list<_Tp, _Alloc>&
|
||||
forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
|
||||
_NOEXCEPT_(
|
||||
__node_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__move_assign(__x, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -1465,7 +1523,7 @@ forward_list<_Tp, _Alloc>::__sort(__node_pointer __f1, difference_type __sz,
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::reverse()
|
||||
forward_list<_Tp, _Alloc>::reverse() _NOEXCEPT
|
||||
{
|
||||
__node_pointer __p = base::__before_begin()->__next_;
|
||||
if (__p != nullptr)
|
||||
@@ -1544,6 +1602,7 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -43,16 +43,16 @@ public:
|
||||
typedef see below result_type; // Not always defined
|
||||
|
||||
// construct/copy/destroy
|
||||
reference_wrapper(T&);
|
||||
reference_wrapper(T&) noexcept;
|
||||
reference_wrapper(T&&) = delete; // do not bind to temps
|
||||
reference_wrapper(const reference_wrapper<T>& x);
|
||||
reference_wrapper(const reference_wrapper<T>& x) noexcept;
|
||||
|
||||
// assignment
|
||||
reference_wrapper& operator=(const reference_wrapper<T>& x);
|
||||
reference_wrapper& operator=(const reference_wrapper<T>& x) noexcept;
|
||||
|
||||
// access
|
||||
operator T& () const;
|
||||
T& get() const;
|
||||
operator T& () const noexcept;
|
||||
T& get() const noexcept;
|
||||
|
||||
// invoke
|
||||
template <class... ArgTypes>
|
||||
@@ -60,13 +60,13 @@ public:
|
||||
operator() (ArgTypes&&...) const;
|
||||
};
|
||||
|
||||
template <class T> reference_wrapper<T> ref(T& t);
|
||||
template <class T> reference_wrapper<T> ref(T& t) noexcept;
|
||||
template <class T> void ref(const T&& t) = delete;
|
||||
template <class T> reference_wrapper<T> ref(reference_wrapper<T>t);
|
||||
template <class T> reference_wrapper<T> ref(reference_wrapper<T>t) noexcept;
|
||||
|
||||
template <class T> reference_wrapper<const T> cref(const T& t);
|
||||
template <class T> reference_wrapper<const T> cref(const T& t) noexcept;
|
||||
template <class T> void cref(const T&& t) = delete;
|
||||
template <class T> reference_wrapper<const T> cref(reference_wrapper<T> t);
|
||||
template <class T> reference_wrapper<const T> cref(reference_wrapper<T> t) noexcept;
|
||||
|
||||
template <class T>
|
||||
struct plus : binary_function<T, T, T>
|
||||
@@ -365,16 +365,16 @@ public:
|
||||
typedef R result_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
function();
|
||||
function(nullptr_t);
|
||||
function() noexcept;
|
||||
function(nullptr_t) noexcept;
|
||||
function(const function&);
|
||||
function(function&&);
|
||||
function(function&&) noexcept;
|
||||
template<class F>
|
||||
function(F);
|
||||
template<Allocator Alloc>
|
||||
function(allocator_arg_t, const Alloc&);
|
||||
function(allocator_arg_t, const Alloc&) noexcept;
|
||||
template<Allocator Alloc>
|
||||
function(allocator_arg_t, const Alloc&, nullptr_t);
|
||||
function(allocator_arg_t, const Alloc&, nullptr_t) noexcept;
|
||||
template<Allocator Alloc>
|
||||
function(allocator_arg_t, const Alloc&, const function&);
|
||||
template<Allocator Alloc>
|
||||
@@ -383,54 +383,48 @@ public:
|
||||
function(allocator_arg_t, const Alloc&, F);
|
||||
|
||||
function& operator=(const function&);
|
||||
function& operator=(function&&);
|
||||
function& operator=(nullptr_t);
|
||||
function& operator=(function&&) noexcept;
|
||||
function& operator=(nullptr_t) noexcept;
|
||||
template<class F>
|
||||
function& operator=(F&&);
|
||||
template<class F>
|
||||
function& operator=(reference_wrapper<F>);
|
||||
function& operator=(reference_wrapper<F>) noexcept;
|
||||
|
||||
~function();
|
||||
|
||||
// function modifiers:
|
||||
void swap(function&);
|
||||
void swap(function&) noexcept;
|
||||
template<class F, class Alloc>
|
||||
void assign(F&&, const Alloc&);
|
||||
|
||||
// function capacity:
|
||||
explicit operator bool() const;
|
||||
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class R2, class... ArgTypes2>
|
||||
bool operator==(const function<R2(ArgTypes2...)>&) = delete;
|
||||
template<class R2, class... ArgTypes2>
|
||||
bool operator!=(const function<R2(ArgTypes2...)>&) = delete;
|
||||
explicit operator bool() const noexcept;
|
||||
|
||||
// function invocation:
|
||||
R operator()(ArgTypes...) const;
|
||||
|
||||
// function target access:
|
||||
const std::type_info& target_type() const;
|
||||
template <typename T> T* target();
|
||||
template <typename T> const T* target() const;
|
||||
const std::type_info& target_type() const noexcept;
|
||||
template <typename T> T* target() noexcept;
|
||||
template <typename T> const T* target() const noexcept;
|
||||
};
|
||||
|
||||
// Null pointer comparisons:
|
||||
template <class R, class ... ArgTypes>
|
||||
bool operator==(const function<R(ArgTypes...)>&, nullptr_t);
|
||||
bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
|
||||
|
||||
template <class R, class ... ArgTypes>
|
||||
bool operator==(nullptr_t, const function<R(ArgTypes...)>&);
|
||||
bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
|
||||
|
||||
template <class R, class ... ArgTypes>
|
||||
bool operator!=(const function<R(ArgTypes...)>&, nullptr_t);
|
||||
bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
|
||||
|
||||
template <class R, class ... ArgTypes>
|
||||
bool operator!=(nullptr_t, const function<R(ArgTypes...)>&);
|
||||
bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
|
||||
|
||||
// specialized algorithms:
|
||||
template <class R, class ... ArgTypes>
|
||||
void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&);
|
||||
void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept;
|
||||
|
||||
template <class T> struct hash;
|
||||
|
||||
@@ -980,12 +974,12 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY virtual ~__base() {}
|
||||
virtual __base* __clone() const = 0;
|
||||
virtual void __clone(__base*) const = 0;
|
||||
virtual void destroy() = 0;
|
||||
virtual void destroy_deallocate() = 0;
|
||||
virtual void destroy() _NOEXCEPT = 0;
|
||||
virtual void destroy_deallocate() _NOEXCEPT = 0;
|
||||
virtual _R operator()(_ArgTypes&& ...) = 0;
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
virtual const void* target(const type_info&) const = 0;
|
||||
virtual const std::type_info& target_type() const = 0;
|
||||
virtual const void* target(const type_info&) const _NOEXCEPT = 0;
|
||||
virtual const std::type_info& target_type() const _NOEXCEPT = 0;
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
};
|
||||
|
||||
@@ -1003,12 +997,12 @@ public:
|
||||
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();
|
||||
virtual void destroy_deallocate();
|
||||
virtual void destroy() _NOEXCEPT;
|
||||
virtual void destroy_deallocate() _NOEXCEPT;
|
||||
virtual _R operator()(_ArgTypes&& ... __arg);
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
virtual const void* target(const type_info&) const;
|
||||
virtual const std::type_info& target_type() const;
|
||||
virtual const void* target(const type_info&) const _NOEXCEPT;
|
||||
virtual const std::type_info& target_type() const _NOEXCEPT;
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
};
|
||||
|
||||
@@ -1033,14 +1027,14 @@ __func<_F, _Alloc, _R(_ArgTypes...)>::__clone(__base<_R(_ArgTypes...)>* __p) con
|
||||
|
||||
template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
void
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::destroy()
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::destroy() _NOEXCEPT
|
||||
{
|
||||
__f_.~__compressed_pair<_F, _Alloc>();
|
||||
}
|
||||
|
||||
template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
void
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::destroy_deallocate()
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT
|
||||
{
|
||||
typedef typename _Alloc::template rebind<__func>::other _A;
|
||||
_A __a(__f_.second());
|
||||
@@ -1059,7 +1053,7 @@ __func<_F, _Alloc, _R(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
|
||||
|
||||
template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
const void*
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::target(const type_info& __ti) const
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT
|
||||
{
|
||||
if (__ti == typeid(_F))
|
||||
return &__f_.first();
|
||||
@@ -1068,7 +1062,7 @@ __func<_F, _Alloc, _R(_ArgTypes...)>::target(const type_info& __ti) const
|
||||
|
||||
template<class _F, class _Alloc, class _R, class ..._ArgTypes>
|
||||
const std::type_info&
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::target_type() const
|
||||
__func<_F, _Alloc, _R(_ArgTypes...)>::target_type() const _NOEXCEPT
|
||||
{
|
||||
return typeid(_F);
|
||||
}
|
||||
@@ -1107,41 +1101,56 @@ class _LIBCPP_VISIBLE function<_R(_ArgTypes...)>
|
||||
template <class _R2, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_A...)>& __p) {return __p;}
|
||||
|
||||
template <class _F, bool = __invokable<_F&, _ArgTypes...>::value>
|
||||
struct __callable;
|
||||
template <class _F>
|
||||
struct __callable<_F, true>
|
||||
{
|
||||
static const bool value =
|
||||
is_convertible<typename __invoke_of<_F&, _ArgTypes...>::type,
|
||||
_R>::value;
|
||||
};
|
||||
template <class _F>
|
||||
struct __callable<_F, false>
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function() : __f_(0) {}
|
||||
function() _NOEXCEPT : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(nullptr_t) _NOEXCEPT : __f_(0) {}
|
||||
function(const function&);
|
||||
function(function&&);
|
||||
function(function&&) _NOEXCEPT;
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
typename enable_if<__callable<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
function(allocator_arg_t, const _Alloc&) _NOEXCEPT : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, function&&);
|
||||
template<class _F, class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc& __a, _F __f,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
typename enable_if<__callable<_F>::value>::type* = 0);
|
||||
|
||||
function& operator=(const function&);
|
||||
function& operator=(function&&);
|
||||
function& operator=(nullptr_t);
|
||||
function& operator=(function&&) _NOEXCEPT;
|
||||
function& operator=(nullptr_t) _NOEXCEPT;
|
||||
template<class _F>
|
||||
typename enable_if
|
||||
<
|
||||
!is_integral<typename decay<_F>::type>::value,
|
||||
__callable<typename decay<_F>::type>::value,
|
||||
function&
|
||||
>::type
|
||||
operator=(_F&&);
|
||||
@@ -1149,7 +1158,7 @@ public:
|
||||
~function();
|
||||
|
||||
// function modifiers:
|
||||
void swap(function&);
|
||||
void swap(function&) _NOEXCEPT;
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F&& __f, const _Alloc& __a)
|
||||
@@ -1157,7 +1166,7 @@ public:
|
||||
|
||||
// function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*explicit*/ operator bool() const {return __f_;}
|
||||
/*explicit*/ operator bool() const _NOEXCEPT {return __f_;}
|
||||
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class... _ArgTypes2>
|
||||
@@ -1170,9 +1179,9 @@ public:
|
||||
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
// function target access:
|
||||
const std::type_info& target_type() const;
|
||||
template <typename _T> _T* target();
|
||||
template <typename _T> const _T* target() const;
|
||||
const std::type_info& target_type() const _NOEXCEPT;
|
||||
template <typename _T> _T* target() _NOEXCEPT;
|
||||
template <typename _T> const _T* target() const _NOEXCEPT;
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
};
|
||||
|
||||
@@ -1207,7 +1216,7 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
|
||||
}
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
function<_R(_ArgTypes...)>::function(function&& __f)
|
||||
function<_R(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
|
||||
{
|
||||
if (__f.__f_ == 0)
|
||||
__f_ = 0;
|
||||
@@ -1245,13 +1254,13 @@ function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
|
||||
template<class _R, class ..._ArgTypes>
|
||||
template <class _F>
|
||||
function<_R(_ArgTypes...)>::function(_F __f,
|
||||
typename enable_if<!is_integral<_F>::value>::type*)
|
||||
typename enable_if<__callable<_F>::value>::type*)
|
||||
: __f_(0)
|
||||
{
|
||||
if (__not_null(__f))
|
||||
{
|
||||
typedef __function::__func<_F, allocator<_F>, _R(_ArgTypes...)> _FF;
|
||||
if (sizeof(_FF) <= sizeof(__buf_))
|
||||
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value)
|
||||
{
|
||||
__f_ = (__base*)&__buf_;
|
||||
::new (__f_) _FF(_STD::move(__f));
|
||||
@@ -1271,14 +1280,14 @@ function<_R(_ArgTypes...)>::function(_F __f,
|
||||
template<class _R, class ..._ArgTypes>
|
||||
template <class _F, class _Alloc>
|
||||
function<_R(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _F __f,
|
||||
typename enable_if<!is_integral<_F>::value>::type*)
|
||||
typename enable_if<__callable<_F>::value>::type*)
|
||||
: __f_(0)
|
||||
{
|
||||
typedef allocator_traits<_Alloc> __alloc_traits;
|
||||
if (__not_null(__f))
|
||||
{
|
||||
typedef __function::__func<_F, _Alloc, _R(_ArgTypes...)> _FF;
|
||||
if (sizeof(_FF) <= sizeof(__buf_))
|
||||
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_F>::value)
|
||||
{
|
||||
__f_ = (__base*)&__buf_;
|
||||
::new (__f_) _FF(_STD::move(__f));
|
||||
@@ -1311,7 +1320,7 @@ function<_R(_ArgTypes...)>::operator=(const function& __f)
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
function<_R(_ArgTypes...)>&
|
||||
function<_R(_ArgTypes...)>::operator=(function&& __f)
|
||||
function<_R(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
|
||||
{
|
||||
if (__f_ == (__base*)&__buf_)
|
||||
__f_->destroy();
|
||||
@@ -1334,7 +1343,7 @@ function<_R(_ArgTypes...)>::operator=(function&& __f)
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
function<_R(_ArgTypes...)>&
|
||||
function<_R(_ArgTypes...)>::operator=(nullptr_t)
|
||||
function<_R(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
|
||||
{
|
||||
if (__f_ == (__base*)&__buf_)
|
||||
__f_->destroy();
|
||||
@@ -1347,7 +1356,7 @@ template<class _R, class ..._ArgTypes>
|
||||
template <class _F>
|
||||
typename enable_if
|
||||
<
|
||||
!is_integral<typename decay<_F>::type>::value,
|
||||
function<_R(_ArgTypes...)>::template __callable<typename decay<_F>::type>::value,
|
||||
function<_R(_ArgTypes...)>&
|
||||
>::type
|
||||
function<_R(_ArgTypes...)>::operator=(_F&& __f)
|
||||
@@ -1367,7 +1376,7 @@ function<_R(_ArgTypes...)>::~function()
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
void
|
||||
function<_R(_ArgTypes...)>::swap(function& __f)
|
||||
function<_R(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
|
||||
{
|
||||
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
|
||||
{
|
||||
@@ -1417,7 +1426,7 @@ function<_R(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
const std::type_info&
|
||||
function<_R(_ArgTypes...)>::target_type() const
|
||||
function<_R(_ArgTypes...)>::target_type() const _NOEXCEPT
|
||||
{
|
||||
if (__f_ == 0)
|
||||
return typeid(void);
|
||||
@@ -1427,7 +1436,7 @@ function<_R(_ArgTypes...)>::target_type() const
|
||||
template<class _R, class ..._ArgTypes>
|
||||
template <typename _T>
|
||||
_T*
|
||||
function<_R(_ArgTypes...)>::target()
|
||||
function<_R(_ArgTypes...)>::target() _NOEXCEPT
|
||||
{
|
||||
if (__f_ == 0)
|
||||
return (_T*)0;
|
||||
@@ -1437,7 +1446,7 @@ function<_R(_ArgTypes...)>::target()
|
||||
template<class _R, class ..._ArgTypes>
|
||||
template <typename _T>
|
||||
const _T*
|
||||
function<_R(_ArgTypes...)>::target() const
|
||||
function<_R(_ArgTypes...)>::target() const _NOEXCEPT
|
||||
{
|
||||
if (__f_ == 0)
|
||||
return (const _T*)0;
|
||||
@@ -1449,27 +1458,27 @@ function<_R(_ArgTypes...)>::target() const
|
||||
template <class _R, class... _ArgTypes>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const function<_R(_ArgTypes...)>& __f, nullptr_t) {return !__f;}
|
||||
operator==(const function<_R(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}
|
||||
|
||||
template <class _R, class... _ArgTypes>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(nullptr_t, const function<_R(_ArgTypes...)>& __f) {return !__f;}
|
||||
operator==(nullptr_t, const function<_R(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;}
|
||||
|
||||
template <class _R, class... _ArgTypes>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const function<_R(_ArgTypes...)>& __f, nullptr_t) {return (bool)__f;}
|
||||
operator!=(const function<_R(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;}
|
||||
|
||||
template <class _R, class... _ArgTypes>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(nullptr_t, const function<_R(_ArgTypes...)>& __f) {return (bool)__f;}
|
||||
operator!=(nullptr_t, const function<_R(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
|
||||
|
||||
template <class _R, class... _ArgTypes>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(function<_R(_ArgTypes...)>& __x, function<_R(_ArgTypes...)>& __y)
|
||||
swap(function<_R(_ArgTypes...)>& __x, function<_R(_ArgTypes...)>& __y) _NOEXCEPT
|
||||
{return __x.swap(__y);}
|
||||
|
||||
template<class _Tp> struct __is_bind_expression : public false_type {};
|
||||
@@ -1510,21 +1519,12 @@ __mu(reference_wrapper<_Tp> __t, _Uj&)
|
||||
return __t.get();
|
||||
}
|
||||
|
||||
template <bool _IsBindExpr, class _Ti, class ..._Uj>
|
||||
struct __mu_return1 {};
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
struct __mu_return1<true, _Ti, _Uj...>
|
||||
{
|
||||
typedef typename result_of<_Ti(_Uj...)>::type type;
|
||||
};
|
||||
|
||||
template <class _Ti, class ..._Uj, size_t ..._Indx>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __mu_return1<true, _Ti, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
|
||||
typename __invoke_of<_Ti&, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
|
||||
{
|
||||
return __ti(_STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
return __ti(_STD::forward<_Uj>(get<_Indx>(__uj))...);
|
||||
}
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
@@ -1532,7 +1532,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_bind_expression<_Ti>::value,
|
||||
typename __mu_return1<is_bind_expression<_Ti>::value, _Ti, _Uj...>::type
|
||||
typename __invoke_of<_Ti&, _Uj...>::type
|
||||
>::type
|
||||
__mu(_Ti& __ti, tuple<_Uj...>& __uj)
|
||||
{
|
||||
@@ -1576,24 +1576,31 @@ __mu(_Ti& __ti, _Uj& __uj)
|
||||
return __ti;
|
||||
}
|
||||
|
||||
template <class _Ti, bool IsBindEx, bool IsPh, class _TupleUj>
|
||||
template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
|
||||
class _TupleUj>
|
||||
struct ____mu_return;
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
struct ____mu_return<_Ti, true, false, tuple<_Uj...> >
|
||||
struct ____mu_return<_Ti, false, true, false, tuple<_Uj...> >
|
||||
{
|
||||
typedef typename result_of<_Ti(_Uj...)>::type type;
|
||||
typedef typename __invoke_of<_Ti&, _Uj...>::type type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, true, _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, true, _TupleUj>
|
||||
{
|
||||
typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
|
||||
_TupleUj>::type&& type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, _TupleUj>
|
||||
struct ____mu_return<_Ti, true, false, false, _TupleUj>
|
||||
{
|
||||
typedef typename _Ti::type& type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, false, _TupleUj>
|
||||
{
|
||||
typedef _Ti& type;
|
||||
};
|
||||
@@ -1601,25 +1608,20 @@ struct ____mu_return<_Ti, false, false, _TupleUj>
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct __mu_return
|
||||
: public ____mu_return<_Ti,
|
||||
__is_reference_wrapper<_Ti>::value,
|
||||
is_bind_expression<_Ti>::value,
|
||||
0 < is_placeholder<_Ti>::value,
|
||||
_TupleUj>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct __mu_return<reference_wrapper<_Ti>, _TupleUj>
|
||||
{
|
||||
typedef _Ti& type;
|
||||
};
|
||||
|
||||
template <class _F, class _BoundArgs, class _TupleUj>
|
||||
struct __bind_return;
|
||||
|
||||
template <class _F, class ..._BoundArgs, class _TupleUj>
|
||||
struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj>
|
||||
{
|
||||
typedef typename __invoke_return
|
||||
typedef typename __invoke_of
|
||||
<
|
||||
_F&,
|
||||
typename __mu_return
|
||||
@@ -1633,7 +1635,7 @@ struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj>
|
||||
template <class _F, class ..._BoundArgs, class _TupleUj>
|
||||
struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj>
|
||||
{
|
||||
typedef typename __invoke_return
|
||||
typedef typename __invoke_of
|
||||
<
|
||||
_F&,
|
||||
typename __mu_return
|
||||
@@ -1655,10 +1657,12 @@ __apply_functor(_F& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
|
||||
|
||||
template<class _F, class ..._BoundArgs>
|
||||
class __bind
|
||||
: public __weak_result_type<_F>
|
||||
: public __weak_result_type<typename decay<_F>::type>
|
||||
{
|
||||
_F __f_;
|
||||
tuple<_BoundArgs...> __bound_args_;
|
||||
typedef typename decay<_F>::type _Fd;
|
||||
typedef tuple<typename decay<_BoundArgs>::type...> _Td;
|
||||
_Fd __f_;
|
||||
_Td __bound_args_;
|
||||
|
||||
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
|
||||
public:
|
||||
@@ -1675,17 +1679,16 @@ public:
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
// compiler bug workaround
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
@@ -1704,6 +1707,10 @@ class __bind_r
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r(__bind_r&& __b)
|
||||
: base(_STD::forward<base>(__b)) {}
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
|
||||
@@ -1732,19 +1739,19 @@ struct __is_bind_expression<__bind_r<_R, _F, _BoundArgs...> > : public true_type
|
||||
|
||||
template<class _F, class ..._BoundArgs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
__bind<_F, _BoundArgs...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
typedef __bind<_F, _BoundArgs...> type;
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
template<class _R, class _F, class ..._BoundArgs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
__bind_r<_R, _F, _BoundArgs...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
typedef __bind_r<_R, _F, _BoundArgs...> type;
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
@@ -1755,7 +1762,7 @@ struct _LIBCPP_VISIBLE hash<bool>
|
||||
: public unary_function<bool, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(bool __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1763,7 +1770,7 @@ struct _LIBCPP_VISIBLE hash<char>
|
||||
: public unary_function<char, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(char __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1771,7 +1778,7 @@ struct _LIBCPP_VISIBLE hash<signed char>
|
||||
: public unary_function<signed char, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(signed char __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1779,7 +1786,7 @@ struct _LIBCPP_VISIBLE hash<unsigned char>
|
||||
: public unary_function<unsigned char, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(unsigned char __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
@@ -1789,7 +1796,7 @@ struct _LIBCPP_VISIBLE hash<char16_t>
|
||||
: public unary_function<char16_t, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(char16_t __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1797,7 +1804,7 @@ struct _LIBCPP_VISIBLE hash<char32_t>
|
||||
: public unary_function<char32_t, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(char32_t __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
@@ -1807,7 +1814,7 @@ struct _LIBCPP_VISIBLE hash<wchar_t>
|
||||
: public unary_function<wchar_t, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(wchar_t __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1815,7 +1822,7 @@ struct _LIBCPP_VISIBLE hash<short>
|
||||
: public unary_function<short, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(short __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1823,7 +1830,7 @@ struct _LIBCPP_VISIBLE hash<unsigned short>
|
||||
: public unary_function<unsigned short, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(unsigned short __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1831,7 +1838,7 @@ struct _LIBCPP_VISIBLE hash<int>
|
||||
: public unary_function<int, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(int __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1839,7 +1846,7 @@ struct _LIBCPP_VISIBLE hash<unsigned int>
|
||||
: public unary_function<unsigned int, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(unsigned int __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1847,7 +1854,7 @@ struct _LIBCPP_VISIBLE hash<long>
|
||||
: public unary_function<long, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(long __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1855,7 +1862,7 @@ struct _LIBCPP_VISIBLE hash<unsigned long>
|
||||
: public unary_function<unsigned long, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(unsigned long __v) const {return static_cast<size_t>(__v);}
|
||||
size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -1863,7 +1870,7 @@ struct _LIBCPP_VISIBLE hash<long long>
|
||||
: public unary_function<long long, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(long long __v) const
|
||||
size_t operator()(long long __v) const _NOEXCEPT
|
||||
{
|
||||
size_t __r = 0;
|
||||
const size_t* const __p = reinterpret_cast<const size_t*>(&__v);
|
||||
@@ -1878,7 +1885,7 @@ struct _LIBCPP_VISIBLE hash<unsigned long long>
|
||||
: public unary_function<unsigned long long, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(unsigned long long __v) const
|
||||
size_t operator()(unsigned long long __v) const _NOEXCEPT
|
||||
{
|
||||
size_t __r = 0;
|
||||
const size_t* const __p = reinterpret_cast<const size_t*>(&__v);
|
||||
@@ -1893,7 +1900,7 @@ struct _LIBCPP_VISIBLE hash<float>
|
||||
: public unary_function<float, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(float __v) const
|
||||
size_t operator()(float __v) const _NOEXCEPT
|
||||
{
|
||||
if (__v == 0)
|
||||
return 0;
|
||||
@@ -1907,7 +1914,7 @@ struct _LIBCPP_VISIBLE hash<double>
|
||||
: public unary_function<double, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(double __v) const
|
||||
size_t operator()(double __v) const _NOEXCEPT
|
||||
{
|
||||
if (__v == 0)
|
||||
return 0;
|
||||
@@ -1924,7 +1931,7 @@ struct _LIBCPP_VISIBLE hash<long double>
|
||||
: public unary_function<long double, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(long double __v) const
|
||||
size_t operator()(long double __v) const _NOEXCEPT
|
||||
{
|
||||
if (__v == 0)
|
||||
return 0;
|
||||
|
230
include/future
230
include/future
@@ -463,7 +463,7 @@ protected:
|
||||
mutable condition_variable __cv_;
|
||||
unsigned __state_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
void __sub_wait(unique_lock<mutex>& __lk);
|
||||
public:
|
||||
enum
|
||||
@@ -543,7 +543,7 @@ class __assoc_state
|
||||
protected:
|
||||
_U __value_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
|
||||
template <class _Arg>
|
||||
@@ -566,7 +566,7 @@ public:
|
||||
|
||||
template <class _R>
|
||||
void
|
||||
__assoc_state<_R>::__on_zero_shared()
|
||||
__assoc_state<_R>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
if (this->__state_ & base::__constructed)
|
||||
reinterpret_cast<_R*>(&__value_)->~_R();
|
||||
@@ -640,7 +640,7 @@ class __assoc_state<_R&>
|
||||
protected:
|
||||
_U __value_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
|
||||
void set_value(_R& __arg);
|
||||
@@ -651,7 +651,7 @@ public:
|
||||
|
||||
template <class _R>
|
||||
void
|
||||
__assoc_state<_R&>::__on_zero_shared()
|
||||
__assoc_state<_R&>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
@@ -700,7 +700,7 @@ class __assoc_state_alloc
|
||||
typedef __assoc_state<_R> base;
|
||||
_Alloc __alloc_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __assoc_state_alloc(const _Alloc& __a)
|
||||
@@ -709,7 +709,7 @@ public:
|
||||
|
||||
template <class _R, class _Alloc>
|
||||
void
|
||||
__assoc_state_alloc<_R, _Alloc>::__on_zero_shared()
|
||||
__assoc_state_alloc<_R, _Alloc>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
if (this->__state_ & base::__constructed)
|
||||
reinterpret_cast<_R*>(&this->__value_)->~_R();
|
||||
@@ -725,7 +725,7 @@ class __assoc_state_alloc<_R&, _Alloc>
|
||||
typedef __assoc_state<_R&> base;
|
||||
_Alloc __alloc_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __assoc_state_alloc(const _Alloc& __a)
|
||||
@@ -734,7 +734,7 @@ public:
|
||||
|
||||
template <class _R, class _Alloc>
|
||||
void
|
||||
__assoc_state_alloc<_R&, _Alloc>::__on_zero_shared()
|
||||
__assoc_state_alloc<_R&, _Alloc>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
typename _Alloc::template rebind<__assoc_state_alloc>::other __a(__alloc_);
|
||||
this->~__assoc_state_alloc();
|
||||
@@ -748,7 +748,7 @@ class __assoc_sub_state_alloc
|
||||
typedef __assoc_sub_state base;
|
||||
_Alloc __alloc_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __assoc_sub_state_alloc(const _Alloc& __a)
|
||||
@@ -757,7 +757,7 @@ public:
|
||||
|
||||
template <class _Alloc>
|
||||
void
|
||||
__assoc_sub_state_alloc<_Alloc>::__on_zero_shared()
|
||||
__assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
this->~base();
|
||||
typename _Alloc::template rebind<__assoc_sub_state_alloc>::other __a(__alloc_);
|
||||
@@ -858,6 +858,115 @@ __deferred_assoc_state<void, _F>::__execute()
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
template <class _R, class _F>
|
||||
class __async_assoc_state
|
||||
: public __assoc_state<_R>
|
||||
{
|
||||
typedef __assoc_state<_R> base;
|
||||
|
||||
_F __func_;
|
||||
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
explicit __async_assoc_state(_F&& __f);
|
||||
#endif
|
||||
|
||||
virtual void __execute();
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _R, class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__async_assoc_state<_R, _F>::__async_assoc_state(_F&& __f)
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _R, class _F>
|
||||
void
|
||||
__async_assoc_state<_R, _F>::__execute()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
this->set_value(__func_());
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
this->set_exception(current_exception());
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
template <class _R, class _F>
|
||||
void
|
||||
__async_assoc_state<_R, _F>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
this->wait();
|
||||
base::__on_zero_shared();
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
class __async_assoc_state<void, _F>
|
||||
: public __assoc_sub_state
|
||||
{
|
||||
typedef __assoc_sub_state base;
|
||||
|
||||
_F __func_;
|
||||
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
explicit __async_assoc_state(_F&& __f);
|
||||
#endif
|
||||
|
||||
virtual void __execute();
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__async_assoc_state<void, _F>::__async_assoc_state(_F&& __f)
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__async_assoc_state<void, _F>::__execute()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__func_();
|
||||
this->set_value();
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
this->set_exception(current_exception());
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__async_assoc_state<void, _F>::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
this->wait();
|
||||
base::__on_zero_shared();
|
||||
}
|
||||
|
||||
template <class> class promise;
|
||||
template <class> class shared_future;
|
||||
template <class> class atomic_future;
|
||||
@@ -874,6 +983,14 @@ __make_deferred_assoc_state(_F&& __f);
|
||||
__make_deferred_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
template <class _R, class _F>
|
||||
future<_R>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
__make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
template <class _R>
|
||||
class _LIBCPP_VISIBLE future
|
||||
{
|
||||
@@ -885,11 +1002,16 @@ class _LIBCPP_VISIBLE future
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
template <class _R1, class _F>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F&& __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -983,11 +1105,16 @@ class _LIBCPP_VISIBLE future<_R&>
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
template <class _R1, class _F>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F&& __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -1076,11 +1203,16 @@ class _LIBCPP_VISIBLE future<void>
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
template <class _R1, class _F>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F&& __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -2034,36 +2166,72 @@ __make_deferred_assoc_state(_F __f)
|
||||
return future<_R>(__h.get());
|
||||
}
|
||||
|
||||
template <class _R, class _F>
|
||||
future<_R>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__make_async_assoc_state(_F&& __f)
|
||||
#else
|
||||
__make_async_assoc_state(_F __f)
|
||||
#endif
|
||||
{
|
||||
unique_ptr<__async_assoc_state<_R, _F>, __release_shared_count>
|
||||
__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());
|
||||
}
|
||||
|
||||
template <class _F, class... _Args>
|
||||
future<typename result_of<_F(_Args...)>::type>
|
||||
class __async_func
|
||||
{
|
||||
tuple<_F, _Args...> __f_;
|
||||
|
||||
public:
|
||||
typedef typename __invoke_of<_F, _Args...>::type _R;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __async_func(_F&& __f, _Args&&... __args)
|
||||
: __f_(_STD::move(__f), _STD::move(__args)...) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__async_func(__async_func&& __f) : __f_(_STD::move(__f.__f_)) {}
|
||||
|
||||
_R operator()()
|
||||
{
|
||||
typedef typename __make_tuple_indices<1+sizeof...(_Args), 1>::type _Index;
|
||||
return __execute(_Index());
|
||||
}
|
||||
private:
|
||||
template <size_t ..._Indices>
|
||||
_R
|
||||
__execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
return __invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _F, class... _Args>
|
||||
future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
|
||||
async(launch __policy, _F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef typename result_of<_F(_Args...)>::type _R;
|
||||
typedef __async_func<typename decay<_F>::type, typename decay<_Args>::type...> _BF;
|
||||
typedef typename _BF::_R _R;
|
||||
future<_R> __r;
|
||||
if (__policy & launch::async)
|
||||
{
|
||||
packaged_task<_R()> __pk(bind(_STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...));
|
||||
__r = __pk.get_future();
|
||||
thread(_STD::move(__pk)).detach();
|
||||
}
|
||||
__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 = _STD::__make_deferred_assoc_state<_R>(bind(_STD::forward<_F>(__f),
|
||||
_STD::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;
|
||||
}
|
||||
|
||||
template <class _F, class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_same<typename decay<_F>::type, launch>::value,
|
||||
future<typename result_of<_F(_Args...)>::type>
|
||||
>::type
|
||||
future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
|
||||
async(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
return async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
return _STD::async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
@@ -29,15 +29,15 @@ public:
|
||||
typedef const E* iterator;
|
||||
typedef const E* const_iterator;
|
||||
|
||||
initializer_list();
|
||||
initializer_list() noexcept;
|
||||
|
||||
size_t size() const;
|
||||
const E* begin() const;
|
||||
const E* end() const;
|
||||
size_t size() const noexcept;
|
||||
const E* begin() const noexcept;
|
||||
const E* end() const noexcept;
|
||||
};
|
||||
|
||||
template<class E> const E* begin(initializer_list<E> il);
|
||||
template<class E> const E* end(initializer_list<E> il);
|
||||
template<class E> const E* begin(initializer_list<E> il) noexcept;
|
||||
template<class E> const E* end(initializer_list<E> il) noexcept;
|
||||
|
||||
} // std
|
||||
|
||||
@@ -58,7 +58,7 @@ class _LIBCPP_VISIBLE initializer_list
|
||||
size_t __size_;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
initializer_list(const _E* __b, size_t __s)
|
||||
initializer_list(const _E* __b, size_t __s) _NOEXCEPT
|
||||
: __begin_(__b),
|
||||
__size_(__s)
|
||||
{}
|
||||
@@ -71,17 +71,17 @@ public:
|
||||
typedef const _E* iterator;
|
||||
typedef const _E* const_iterator;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE initializer_list() : __begin_(nullptr), __size_(0) {}
|
||||
_LIBCPP_ALWAYS_INLINE initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE size_t size() const {return __size_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* begin() const {return __begin_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* end() const {return __begin_ + __size_;}
|
||||
_LIBCPP_ALWAYS_INLINE size_t size() const _NOEXCEPT {return __size_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* begin() const _NOEXCEPT {return __begin_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* end() const _NOEXCEPT {return __begin_ + __size_;}
|
||||
};
|
||||
|
||||
template<class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
const _E*
|
||||
begin(initializer_list<_E> __il)
|
||||
begin(initializer_list<_E> __il) _NOEXCEPT
|
||||
{
|
||||
return __il.begin();
|
||||
}
|
||||
@@ -89,7 +89,7 @@ begin(initializer_list<_E> __il)
|
||||
template<class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
const _E*
|
||||
end(initializer_list<_E> __il)
|
||||
end(initializer_list<_E> __il) _NOEXCEPT
|
||||
{
|
||||
return __il.end();
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ namespace std
|
||||
template<class charT> struct char_traits;
|
||||
template<class T> class allocator;
|
||||
|
||||
class ios_base;
|
||||
template <class charT, class traits = char_traits<charT> > class basic_ios;
|
||||
|
||||
template <class charT, class traits = char_traits<charT> > class basic_streambuf;
|
||||
|
@@ -1007,35 +1007,35 @@ template <class _Iter> class __wrap_iter;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter>
|
||||
__wrap_iter<_Iter>
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type, const __wrap_iter<_Iter>&);
|
||||
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,33 +1063,33 @@ public:
|
||||
private:
|
||||
iterator_type __i;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter() {}
|
||||
_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)
|
||||
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
|
||||
: __i(__u.base()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__i;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &(operator*());}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() {++__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int)
|
||||
_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 {++__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT
|
||||
{__wrap_iter __tmp(*this); ++__i; return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() {--__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int)
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT {--__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT
|
||||
{__wrap_iter __tmp(*this); --__i; return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
|
||||
{return __wrap_iter(__i + __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n)
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
|
||||
{__i += __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT
|
||||
{return __wrap_iter(__i - __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n)
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
|
||||
{__i -= __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT
|
||||
{return __i[__n];}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator_type base() const {return __i;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT {return __i;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) : __i(__x) {}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
|
||||
|
||||
template <class _Up> friend class __wrap_iter;
|
||||
template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
|
||||
@@ -1098,42 +1098,42 @@ private:
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
|
||||
template <class _Iter1>
|
||||
friend
|
||||
__wrap_iter<_Iter1>
|
||||
operator+(typename __wrap_iter<_Iter1>::difference_type, const __wrap_iter<_Iter1>&);
|
||||
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);
|
||||
@@ -1153,7 +1153,7 @@ private:
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() == __y.base();
|
||||
}
|
||||
@@ -1161,7 +1161,7 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() < __y.base();
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() != __y.base();
|
||||
}
|
||||
@@ -1177,7 +1177,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() > __y.base();
|
||||
}
|
||||
@@ -1185,7 +1185,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() >= __y.base();
|
||||
}
|
||||
@@ -1193,7 +1193,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() <= __y.base();
|
||||
}
|
||||
@@ -1201,7 +1201,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.base() - __y.base();
|
||||
}
|
||||
@@ -1210,7 +1210,7 @@ template <class _Iter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter<_Iter>
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type __n,
|
||||
const __wrap_iter<_Iter>& __x)
|
||||
const __wrap_iter<_Iter>& __x) _NOEXCEPT
|
||||
{
|
||||
return __wrap_iter<_Iter>(__x.base() + __n);
|
||||
}
|
||||
|
198
include/limits
198
include/limits
@@ -22,9 +22,9 @@ class numeric_limits
|
||||
{
|
||||
public:
|
||||
static const bool is_specialized = false;
|
||||
static T min() throw();
|
||||
static T max() throw();
|
||||
static T lowest() throw();
|
||||
static T min() noexcept;
|
||||
static T max() noexcept;
|
||||
static T lowest() noexcept;
|
||||
|
||||
static const int digits = 0;
|
||||
static const int digits10 = 0;
|
||||
@@ -33,8 +33,8 @@ public:
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = 0;
|
||||
static T epsilon() throw();
|
||||
static T round_error() throw();
|
||||
static T epsilon() noexcept;
|
||||
static T round_error() noexcept;
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -46,10 +46,10 @@ public:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
static T infinity() throw();
|
||||
static T quiet_NaN() throw();
|
||||
static T signaling_NaN() throw();
|
||||
static T denorm_min() throw();
|
||||
static T infinity() noexcept;
|
||||
static T quiet_NaN() noexcept;
|
||||
static T signaling_NaN() noexcept;
|
||||
static T denorm_min() noexcept;
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = false;
|
||||
@@ -132,9 +132,9 @@ protected:
|
||||
typedef _Tp type;
|
||||
|
||||
static const bool is_specialized = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return type();}
|
||||
|
||||
static const int digits = 0;
|
||||
static const int digits10 = 0;
|
||||
@@ -143,8 +143,8 @@ protected:
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = 0;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type();}
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -156,10 +156,10 @@ protected:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type();}
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = false;
|
||||
@@ -196,15 +196,15 @@ protected:
|
||||
static const int max_digits10 = 0;
|
||||
static const type __min = __libcpp_compute_min<type, digits, is_signed>::value;
|
||||
static const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();}
|
||||
|
||||
static const bool is_integer = true;
|
||||
static const bool is_exact = true;
|
||||
static const int radix = 2;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);}
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -216,10 +216,10 @@ protected:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);}
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = true;
|
||||
@@ -248,15 +248,15 @@ protected:
|
||||
static const int max_digits10 = 0;
|
||||
static const type __min = false;
|
||||
static const type __max = true;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();}
|
||||
|
||||
static const bool is_integer = true;
|
||||
static const bool is_exact = true;
|
||||
static const int radix = 2;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);}
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -268,10 +268,10 @@ protected:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);}
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = true;
|
||||
@@ -294,15 +294,15 @@ protected:
|
||||
static const int digits = __FLT_MANT_DIG__;
|
||||
static const int digits10 = __FLT_DIG__;
|
||||
static const int max_digits10 = 2+(digits * 30103)/100000;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __FLT_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __FLT_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __FLT_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __FLT_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
|
||||
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = __FLT_RADIX__;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __FLT_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5F;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __FLT_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5F;}
|
||||
|
||||
static const int min_exponent = __FLT_MIN_EXP__;
|
||||
static const int min_exponent10 = __FLT_MIN_10_EXP__;
|
||||
@@ -314,10 +314,10 @@ protected:
|
||||
static const bool has_signaling_NaN = true;
|
||||
static const float_denorm_style has_denorm = denorm_present;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_valf();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nanf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nansf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __FLT_DENORM_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_valf();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;}
|
||||
|
||||
static const bool is_iec559 = true;
|
||||
static const bool is_bounded = true;
|
||||
@@ -340,15 +340,15 @@ protected:
|
||||
static const int digits = __DBL_MANT_DIG__;
|
||||
static const int digits10 = __DBL_DIG__;
|
||||
static const int max_digits10 = 2+(digits * 30103)/100000;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __DBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __DBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __DBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __DBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
|
||||
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = __FLT_RADIX__;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __DBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __DBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;}
|
||||
|
||||
static const int min_exponent = __DBL_MIN_EXP__;
|
||||
static const int min_exponent10 = __DBL_MIN_10_EXP__;
|
||||
@@ -360,10 +360,10 @@ protected:
|
||||
static const bool has_signaling_NaN = true;
|
||||
static const float_denorm_style has_denorm = denorm_present;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_val();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nan("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nans("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __DBL_DENORM_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_val();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nan("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nans("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;}
|
||||
|
||||
static const bool is_iec559 = true;
|
||||
static const bool is_bounded = true;
|
||||
@@ -386,15 +386,15 @@ protected:
|
||||
static const int digits = __LDBL_MANT_DIG__;
|
||||
static const int digits10 = __LDBL_DIG__;
|
||||
static const int max_digits10 = 2+(digits * 30103)/100000;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __LDBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __LDBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __LDBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __LDBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
|
||||
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = __FLT_RADIX__;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __LDBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;}
|
||||
|
||||
static const int min_exponent = __LDBL_MIN_EXP__;
|
||||
static const int min_exponent10 = __LDBL_MIN_10_EXP__;
|
||||
@@ -406,10 +406,10 @@ protected:
|
||||
static const bool has_signaling_NaN = true;
|
||||
static const float_denorm_style has_denorm = denorm_present;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_vall();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nanl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nansl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __LDBL_DENORM_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_vall();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
|
||||
|
||||
#if (defined(__ppc__) || defined(__ppc64__))
|
||||
static const bool is_iec559 = false;
|
||||
@@ -432,9 +432,9 @@ class _LIBCPP_VISIBLE numeric_limits
|
||||
typedef typename __base::type type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -443,8 +443,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -456,10 +456,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
@@ -478,9 +478,9 @@ class _LIBCPP_VISIBLE numeric_limits<const _Tp>
|
||||
typedef _Tp type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -489,8 +489,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -502,10 +502,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
@@ -524,9 +524,9 @@ class _LIBCPP_VISIBLE numeric_limits<volatile _Tp>
|
||||
typedef _Tp type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -535,8 +535,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -548,10 +548,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
@@ -570,9 +570,9 @@ class _LIBCPP_VISIBLE numeric_limits<const volatile _Tp>
|
||||
typedef _Tp type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -581,8 +581,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -594,10 +594,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
|
189
include/list
189
include/list
@@ -36,7 +36,8 @@ public:
|
||||
typedef reverse_iterator<iterator> reverse_iterator;
|
||||
typedef reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
list();
|
||||
list()
|
||||
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit list(const allocator_type& a);
|
||||
explicit list(size_type n);
|
||||
list(size_type n, const value_type& value);
|
||||
@@ -47,7 +48,8 @@ public:
|
||||
list(Iter first, Iter last, const allocator_type& a);
|
||||
list(const list& x);
|
||||
list(const list&, const allocator_type& a);
|
||||
list(list&& x);
|
||||
list(list&& x)
|
||||
noexcept(is_nothrow_move_constructible<allocator_type>::value);
|
||||
list(list&&, const allocator_type& a);
|
||||
list(initializer_list<value_type>);
|
||||
list(initializer_list<value_type>, const allocator_type& a);
|
||||
@@ -55,36 +57,39 @@ public:
|
||||
~list();
|
||||
|
||||
list& operator=(const list& x);
|
||||
list& operator=(list&& x);
|
||||
list& operator=(list&& x)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
list& operator=(initializer_list<value_type>);
|
||||
template <class Iter>
|
||||
void assign(Iter first, Iter last);
|
||||
void assign(size_type n, const value_type& t);
|
||||
void assign(initializer_list<value_type>);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
reference front();
|
||||
const_reference front() const;
|
||||
reference back();
|
||||
const_reference back() const;
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
template <class... Args>
|
||||
void emplace_front(Args&&... args);
|
||||
@@ -111,8 +116,10 @@ public:
|
||||
void resize(size_type sz);
|
||||
void resize(size_type sz, const value_type& c);
|
||||
|
||||
void swap(list<value_type,allocator_type>&);
|
||||
void clear();
|
||||
void swap(list&)
|
||||
noexcept(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
void clear() noexcept;
|
||||
|
||||
void splice(const_iterator position, list& x);
|
||||
void splice(const_iterator position, list&& x);
|
||||
@@ -137,7 +144,7 @@ public:
|
||||
void sort();
|
||||
template <class Compare>
|
||||
void sort(Compare comp);
|
||||
void reverse();
|
||||
void reverse() noexcept;
|
||||
};
|
||||
|
||||
template <class T, class Alloc>
|
||||
@@ -154,7 +161,8 @@ template <class T, class Alloc>
|
||||
bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y);
|
||||
|
||||
template <class T, class Alloc>
|
||||
void swap(list<T,Alloc>& x, list<T,Alloc>& y);
|
||||
void swap(list<T,Alloc>& x, list<T,Alloc>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -218,7 +226,7 @@ class _LIBCPP_VISIBLE __list_iterator
|
||||
__node_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __list_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
explicit __list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||
|
||||
template<class, class> friend class list;
|
||||
template<class, class> friend class __list_imp;
|
||||
@@ -237,7 +245,7 @@ public:
|
||||
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_iterator() {}
|
||||
__list_iterator() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -274,7 +282,7 @@ class _LIBCPP_VISIBLE __list_const_iterator
|
||||
__node_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __list_const_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
explicit __list_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||
|
||||
template<class, class> friend class list;
|
||||
template<class, class> friend class __list_imp;
|
||||
@@ -292,9 +300,10 @@ public:
|
||||
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator() {}
|
||||
__list_const_iterator() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator(__list_iterator<_Tp, _VoidPtr> __p) : __ptr_(__p.__ptr_) {}
|
||||
__list_const_iterator(__list_iterator<_Tp, _VoidPtr> __p) _NOEXCEPT
|
||||
: __ptr_(__p.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
@@ -352,33 +361,43 @@ protected:
|
||||
__compressed_pair<size_type, __node_allocator> __size_alloc_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& __sz() {return __size_alloc_.first();}
|
||||
size_type& __sz() _NOEXCEPT {return __size_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const size_type& __sz() const {return __size_alloc_.first();}
|
||||
const size_type& __sz() const _NOEXCEPT
|
||||
{return __size_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_allocator& __node_alloc() {return __size_alloc_.second();}
|
||||
__node_allocator& __node_alloc() _NOEXCEPT
|
||||
{return __size_alloc_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __node_alloc() const {return __size_alloc_.second();}
|
||||
const __node_allocator& __node_alloc() const _NOEXCEPT
|
||||
{return __size_alloc_.second();}
|
||||
|
||||
static void __unlink_nodes(__node_base& __f, __node_base& __l);
|
||||
static void __unlink_nodes(__node_base& __f, __node_base& __l) _NOEXCEPT;
|
||||
|
||||
__list_imp();
|
||||
__list_imp()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value);
|
||||
__list_imp(const allocator_type& __a);
|
||||
~__list_imp();
|
||||
void clear();
|
||||
void clear() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __sz() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __sz() == 0;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return iterator(__end_.__next_);}
|
||||
iterator begin() _NOEXCEPT
|
||||
{return iterator(__end_.__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return const_iterator(__end_.__next_);}
|
||||
const_iterator begin() const _NOEXCEPT
|
||||
{return const_iterator(__end_.__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return iterator(static_cast<__node_pointer> (&__end_));}
|
||||
iterator end() _NOEXCEPT
|
||||
{return iterator(static_cast<__node_pointer> (&__end_));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return const_iterator(static_cast<__node_const_pointer>(&__end_));}
|
||||
const_iterator end() const _NOEXCEPT
|
||||
{return const_iterator(static_cast<__node_const_pointer>(&__end_));}
|
||||
|
||||
void swap(__list_imp& __c);
|
||||
void swap(__list_imp& __c)
|
||||
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __list_imp& __c)
|
||||
@@ -387,22 +406,29 @@ protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__list_imp& __c)
|
||||
_NOEXCEPT_(
|
||||
!__node_alloc_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{__move_assign_alloc(__c, integral_constant<bool,
|
||||
__node_alloc_traits::propagate_on_container_move_assignment::value>());}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
||||
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__node_alloc_traits::propagate_on_container_swap::value>());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -419,12 +445,14 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __list_imp& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{
|
||||
__node_alloc() = _STD::move(__c.__node_alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __list_imp& __c, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -433,6 +461,7 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__list_imp<_Tp, _Alloc>::__unlink_nodes(__node_base& __f, __node_base& __l)
|
||||
_NOEXCEPT
|
||||
{
|
||||
__f.__prev_->__next_ = __l.__next_;
|
||||
__l.__next_->__prev_ = __f.__prev_;
|
||||
@@ -441,6 +470,7 @@ __list_imp<_Tp, _Alloc>::__unlink_nodes(__node_base& __f, __node_base& __l)
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__list_imp<_Tp, _Alloc>::__list_imp()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
|
||||
: __size_alloc_(0)
|
||||
{
|
||||
}
|
||||
@@ -460,7 +490,7 @@ __list_imp<_Tp, _Alloc>::~__list_imp()
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
__list_imp<_Tp, _Alloc>::clear()
|
||||
__list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
|
||||
{
|
||||
if (!empty())
|
||||
{
|
||||
@@ -482,6 +512,8 @@ __list_imp<_Tp, _Alloc>::clear()
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
__list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
|
||||
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
__swap_alloc(__node_alloc(), __c.__node_alloc());
|
||||
@@ -527,7 +559,9 @@ public:
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
list() {}
|
||||
list()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
list(const allocator_type& __a) : base(__a) {}
|
||||
list(size_type __n);
|
||||
@@ -546,9 +580,13 @@ public:
|
||||
list(initializer_list<value_type> __il);
|
||||
list(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
list(list&& __c);
|
||||
list(list&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
|
||||
list(list&& __c, const allocator_type& __a);
|
||||
list& operator=(list&& __c);
|
||||
list& operator=(list&& __c)
|
||||
_NOEXCEPT_(
|
||||
__node_alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
list& operator=(initializer_list<value_type> __il)
|
||||
@@ -562,40 +600,47 @@ public:
|
||||
void assign(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end());}
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return base::__sz();}
|
||||
size_type size() const _NOEXCEPT {return base::__sz();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return base::empty();}
|
||||
bool empty() const _NOEXCEPT {return base::empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return numeric_limits<difference_type>::max();}
|
||||
size_type max_size() const _NOEXCEPT
|
||||
{return numeric_limits<difference_type>::max();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return base::begin();}
|
||||
iterator begin() _NOEXCEPT {return base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return base::begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return base::end();}
|
||||
iterator end() _NOEXCEPT {return base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return base::end();}
|
||||
const_iterator end() const _NOEXCEPT {return base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return base::begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return base::end();}
|
||||
const_iterator cend() const _NOEXCEPT {return base::end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return const_reverse_iterator(end());}
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return const_reverse_iterator(begin());}
|
||||
const_reverse_iterator crend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference front() {return base::__end_.__next_->__value_;}
|
||||
@@ -633,9 +678,12 @@ public:
|
||||
{return insert(__p, __il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(list& __c) {base::swap(__c);}
|
||||
void swap(list& __c)
|
||||
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<__node_allocator>::value)
|
||||
{base::swap(__c);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {base::clear();}
|
||||
void clear() _NOEXCEPT {base::clear();}
|
||||
|
||||
void pop_front();
|
||||
void pop_back();
|
||||
@@ -685,7 +733,7 @@ public:
|
||||
template <class _Comp>
|
||||
void sort(_Comp __comp);
|
||||
|
||||
void reverse();
|
||||
void reverse() _NOEXCEPT;
|
||||
|
||||
private:
|
||||
static void __link_nodes(__node& __p, __node& __f, __node& __l);
|
||||
@@ -693,7 +741,8 @@ private:
|
||||
template <class _Comp>
|
||||
static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp);
|
||||
|
||||
void __move_assign(list& __c, true_type);
|
||||
void __move_assign(list& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value);
|
||||
void __move_assign(list& __c, false_type);
|
||||
};
|
||||
|
||||
@@ -816,6 +865,7 @@ list<_Tp, _Alloc>::operator=(const list& __c)
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
list<_Tp, _Alloc>::list(list&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
|
||||
: base(allocator_type(_STD::move(__c.__node_alloc())))
|
||||
{
|
||||
splice(end(), __c);
|
||||
@@ -839,6 +889,9 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
list<_Tp, _Alloc>&
|
||||
list<_Tp, _Alloc>::operator=(list&& __c)
|
||||
_NOEXCEPT_(
|
||||
__node_alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{
|
||||
__move_assign(__c, integral_constant<bool,
|
||||
__node_alloc_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -861,6 +914,7 @@ list<_Tp, _Alloc>::__move_assign(list& __c, false_type)
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
||||
{
|
||||
clear();
|
||||
base::__move_assign_alloc(__c);
|
||||
@@ -902,7 +956,7 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_Alloc
|
||||
list<_Tp, _Alloc>::get_allocator() const
|
||||
list<_Tp, _Alloc>::get_allocator() const _NOEXCEPT
|
||||
{
|
||||
return allocator_type(base::__node_alloc());
|
||||
}
|
||||
@@ -1537,7 +1591,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
list<_Tp, _Alloc>::reverse()
|
||||
list<_Tp, _Alloc>::reverse() _NOEXCEPT
|
||||
{
|
||||
if (base::__sz() > 1)
|
||||
{
|
||||
@@ -1600,6 +1654,7 @@ template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -36,8 +36,8 @@ public:
|
||||
all = collate | ctype | monetary | numeric | time | messages;
|
||||
|
||||
// construct/copy/destroy:
|
||||
locale() throw();
|
||||
locale(const locale& other) throw();
|
||||
locale() noexcept;
|
||||
locale(const locale& other) noexcept;
|
||||
explicit locale(const char* std_name);
|
||||
explicit locale(const string& std_name);
|
||||
locale(const locale& other, const char* std_name, category);
|
||||
@@ -45,9 +45,9 @@ public:
|
||||
template <class Facet> locale(const locale& other, Facet* f);
|
||||
locale(const locale& other, const locale& one, category);
|
||||
|
||||
~locale() throw(); // not virtual
|
||||
~locale(); // not virtual
|
||||
|
||||
const locale& operator=(const locale& other) throw();
|
||||
const locale& operator=(const locale& other) noexcept;
|
||||
|
||||
template <class Facet> locale combine(const locale& other) const;
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
};
|
||||
|
||||
template <class Facet> const Facet& use_facet(const locale&);
|
||||
template <class Facet> bool has_facet(const locale&) throw();
|
||||
template <class Facet> bool has_facet(const locale&) noexcept;
|
||||
|
||||
// 22.3.3, convenience interfaces:
|
||||
template <class charT> bool isspace (charT c, const locale& loc);
|
||||
|
254
include/map
254
include/map
@@ -54,7 +54,11 @@ public:
|
||||
};
|
||||
|
||||
// construct/copy/destroy:
|
||||
map();
|
||||
map()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value);
|
||||
explicit map(const key_compare& comp);
|
||||
map(const key_compare& comp, const allocator_type& a);
|
||||
template <class InputIterator>
|
||||
@@ -64,7 +68,10 @@ public:
|
||||
map(InputIterator first, InputIterator last,
|
||||
const key_compare& comp, const allocator_type& a);
|
||||
map(const map& m);
|
||||
map(map&& m);
|
||||
map(map&& m)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<allocator_type>::value &&
|
||||
is_nothrow_move_constructible<key_compare>::value);
|
||||
explicit map(const allocator_type& a);
|
||||
map(const map& m, const allocator_type& a);
|
||||
map(map&& m, const allocator_type& a);
|
||||
@@ -73,29 +80,33 @@ public:
|
||||
~map();
|
||||
|
||||
map& operator=(const map& m);
|
||||
map& operator=(map&& m);
|
||||
map& operator=(map&& m)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<key_compare>::value);
|
||||
map& operator=(initializer_list<value_type> il);
|
||||
|
||||
// iterators:
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
// capacity:
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
// element access:
|
||||
mapped_type& operator[](const key_type& k);
|
||||
@@ -122,12 +133,16 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(map& m);
|
||||
void swap(map& m)
|
||||
noexcept(
|
||||
__is_nothrow_swappable<key_compare>::value &&
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value));
|
||||
|
||||
// observers:
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
key_compare key_comp() const;
|
||||
value_compare value_comp() const;
|
||||
|
||||
@@ -176,7 +191,8 @@ operator<=(const map<Key, T, Compare, Allocator>& x,
|
||||
// specialized algorithms:
|
||||
template <class Key, class T, class Compare, class Allocator>
|
||||
void
|
||||
swap(map<Key, T, Compare, Allocator>& x, map<Key, T, Compare, Allocator>& y);
|
||||
swap(map<Key, T, Compare, Allocator>& x, map<Key, T, Compare, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class Key, class T, class Compare = less<Key>,
|
||||
class Allocator = allocator<pair<const Key, T>>>
|
||||
@@ -213,7 +229,12 @@ public:
|
||||
};
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit multimap(const key_compare& comp = key_compare());
|
||||
multimap()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value);
|
||||
explicit multimap(const key_compare& comp);
|
||||
multimap(const key_compare& comp, const allocator_type& a);
|
||||
template <class InputIterator>
|
||||
multimap(InputIterator first, InputIterator last, const key_compare& comp);
|
||||
@@ -221,7 +242,10 @@ public:
|
||||
multimap(InputIterator first, InputIterator last, const key_compare& comp,
|
||||
const allocator_type& a);
|
||||
multimap(const multimap& m);
|
||||
multimap(multimap&& m);
|
||||
multimap(multimap&& m)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<allocator_type>::value &&
|
||||
is_nothrow_move_constructible<key_compare>::value);
|
||||
explicit multimap(const allocator_type& a);
|
||||
multimap(const multimap& m, const allocator_type& a);
|
||||
multimap(multimap&& m, const allocator_type& a);
|
||||
@@ -231,29 +255,33 @@ public:
|
||||
~multimap();
|
||||
|
||||
multimap& operator=(const multimap& m);
|
||||
multimap& operator=(multimap&& m);
|
||||
multimap& operator=(multimap&& m)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<key_compare>::value);
|
||||
multimap& operator=(initializer_list<value_type> il);
|
||||
|
||||
// iterators:
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
// capacity:
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
// modifiers:
|
||||
template <class... Args>
|
||||
@@ -273,12 +301,16 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(multimap& m);
|
||||
void swap(multimap& m)
|
||||
noexcept(
|
||||
__is_nothrow_swappable<key_compare>::value &&
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value));
|
||||
|
||||
// observers:
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
key_compare key_comp() const;
|
||||
value_compare value_comp() const;
|
||||
|
||||
@@ -328,7 +360,8 @@ operator<=(const multimap<Key, T, Compare, Allocator>& x,
|
||||
template <class Key, class T, class Compare, class Allocator>
|
||||
void
|
||||
swap(multimap<Key, T, Compare, Allocator>& x,
|
||||
multimap<Key, T, Compare, Allocator>& y);
|
||||
multimap<Key, T, Compare, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -354,11 +387,15 @@ class __map_value_compare
|
||||
typedef pair<const _Key, _Tp> _CP;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_value_compare() : _Compare() {}
|
||||
__map_value_compare()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
|
||||
: _Compare() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_value_compare(_Compare c) : _Compare(c) {}
|
||||
__map_value_compare(_Compare c)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: _Compare(c) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Compare& key_comp() const {return *this;}
|
||||
const _Compare& key_comp() const _NOEXCEPT {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _CP& __x, const _CP& __y) const
|
||||
{return static_cast<const _Compare&>(*this)(__x.first, __y.first);}
|
||||
@@ -398,11 +435,15 @@ class __map_value_compare<_Key, _Tp, _Compare, false>
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_value_compare() : comp() {}
|
||||
__map_value_compare()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
|
||||
: comp() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_value_compare(_Compare c) : comp(c) {}
|
||||
__map_value_compare(_Compare c)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: comp(c) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Compare& key_comp() const {return comp;}
|
||||
const _Compare& key_comp() const _NOEXCEPT {return comp;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _CP& __x, const _CP& __y) const
|
||||
@@ -454,7 +495,7 @@ public:
|
||||
bool __second_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __map_node_destructor(allocator_type& __na)
|
||||
explicit __map_node_destructor(allocator_type& __na) _NOEXCEPT
|
||||
: __na_(__na),
|
||||
__first_constructed(false),
|
||||
__second_constructed(false)
|
||||
@@ -462,7 +503,7 @@ public:
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_node_destructor(__tree_node_destructor<allocator_type>&& __x)
|
||||
__map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
__second_constructed(__x.__value_constructed)
|
||||
@@ -472,7 +513,7 @@ public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__second_constructed)
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
|
||||
@@ -509,10 +550,10 @@ public:
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_iterator() {}
|
||||
__map_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_iterator(_TreeIterator __i) : __i_(__i) {}
|
||||
__map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return *operator->();}
|
||||
@@ -574,13 +615,14 @@ public:
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_const_iterator() {}
|
||||
__map_const_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_const_iterator(_TreeIterator __i) : __i_(__i) {}
|
||||
__map_const_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_const_iterator(
|
||||
__map_iterator<typename _TreeIterator::__non_const_iterator> __i)
|
||||
_NOEXCEPT
|
||||
: __i_(__i.__i_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -676,6 +718,10 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit map(const key_compare& __comp = key_compare())
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value)
|
||||
: __tree_(__vc(__comp)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -711,6 +757,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map(map&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_STD::move(__m.__tree_))
|
||||
{
|
||||
}
|
||||
@@ -733,6 +780,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
map& operator=(map&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _STD::move(__m.__tree_);
|
||||
return *this;
|
||||
@@ -761,38 +809,41 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __tree_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __tree_.end();}
|
||||
iterator end() _NOEXCEPT {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __tree_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return end();}
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return rbegin();}
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return rend();}
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __tree_.size();}
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
|
||||
|
||||
mapped_type& operator[](const key_type& __k);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -803,7 +854,7 @@ public:
|
||||
const mapped_type& at(const key_type& __k) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_compare key_comp() const {return __tree_.value_comp().key_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -896,10 +947,12 @@ public:
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f.__i_, __l.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__tree_.clear();}
|
||||
void clear() _NOEXCEPT {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(map& __m) {__tree_.swap(__m.__tree_);}
|
||||
void swap(map& __m)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__base>::value)
|
||||
{__tree_.swap(__m.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __tree_.find(__k);}
|
||||
@@ -1344,6 +1397,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
|
||||
map<_Key, _Tp, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
@@ -1405,6 +1459,10 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multimap(const key_compare& __comp = key_compare())
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value)
|
||||
: __tree_(__vc(__comp)) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1441,6 +1499,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap(multimap&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_STD::move(__m.__tree_))
|
||||
{
|
||||
}
|
||||
@@ -1463,6 +1522,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multimap& operator=(multimap&& __m)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _STD::move(__m.__tree_);
|
||||
return *this;
|
||||
@@ -1490,45 +1550,48 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __tree_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __tree_.end();}
|
||||
iterator end() _NOEXCEPT {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __tree_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return end();}
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return rbegin();}
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return rend();}
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __tree_.size();}
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_compare key_comp() const {return __tree_.value_comp().key_comp();}
|
||||
key_compare key_comp() const {return __tree_.value_comp().key_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare value_comp() const {return value_compare(__tree_.value_comp().key_comp());}
|
||||
value_compare value_comp() const
|
||||
{return value_compare(__tree_.value_comp().key_comp());}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -1615,7 +1678,9 @@ public:
|
||||
void clear() {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(multimap& __m) {__tree_.swap(__m.__tree_);}
|
||||
void swap(multimap& __m)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__base>::value)
|
||||
{__tree_.swap(__m.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __tree_.find(__k);}
|
||||
@@ -1821,6 +1886,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x,
|
||||
multimap<_Key, _Tp, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
710
include/memory
710
include/memory
File diff suppressed because it is too large
Load Diff
@@ -175,6 +175,9 @@ template<class Callable, class ...Args>
|
||||
#include <__config>
|
||||
#include <__mutex_base>
|
||||
#include <functional>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -455,6 +458,39 @@ private:
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
class __call_once_param
|
||||
{
|
||||
_F __f_;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(const _F& __f) : __f_(__f) {}
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()()
|
||||
{
|
||||
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
|
||||
__execute(_Index());
|
||||
}
|
||||
|
||||
private:
|
||||
template <size_t ..._Indices>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <class _F>
|
||||
class __call_once_param
|
||||
{
|
||||
@@ -475,6 +511,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__call_once_proxy(void* __vp)
|
||||
@@ -494,10 +532,9 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
|
||||
{
|
||||
if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
|
||||
{
|
||||
typedef decltype(std::bind(std::forward<_Callable>(__func),
|
||||
std::forward<_Args>(__args)...)) _G;
|
||||
__call_once_param<_G> __p(std::bind(std::forward<_Callable>(__func),
|
||||
std::forward<_Args>(__args)...));
|
||||
typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G;
|
||||
__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>);
|
||||
}
|
||||
}
|
||||
|
85
include/new
85
include/new
@@ -21,35 +21,34 @@ class bad_alloc
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_alloc() throw();
|
||||
bad_alloc(const bad_alloc&) throw();
|
||||
bad_alloc& operator=(const bad_alloc&) throw();
|
||||
virtual ~bad_alloc() throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_alloc() noexcept;
|
||||
bad_alloc(const bad_alloc&) noexcept;
|
||||
bad_alloc& operator=(const bad_alloc&) noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
};
|
||||
|
||||
struct nothrow_t {};
|
||||
extern const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
new_handler set_new_handler(new_handler new_p) throw();
|
||||
new_handler get_new_handler() throw();
|
||||
new_handler set_new_handler(new_handler new_p) noexcept;
|
||||
new_handler get_new_handler() noexcept;
|
||||
|
||||
} // std
|
||||
|
||||
void* operator new(std::size_t size) throw(std::bad_alloc); // replaceable
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) throw(); // replaceable
|
||||
void operator delete(void* ptr) throw(); // replaceable
|
||||
void operator delete(void* ptr, const std::nothrow_t&) throw(); // replaceable
|
||||
void* operator new(std::size_t size); // replaceable
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable
|
||||
void operator delete(void* ptr) noexcept; // replaceable
|
||||
void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable
|
||||
|
||||
void* operator new[](std::size_t size) throw(std::bad_alloc); // replaceable
|
||||
void* operator new[](std::size_t size, const std::nothrow_t&) throw(); // replaceable
|
||||
void operator delete[](void* ptr) throw(); // replaceable
|
||||
void operator delete[](void* ptr, const std::nothrow_t&) throw(); // replaceable
|
||||
void* operator new[](std::size_t size); // replaceable
|
||||
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable
|
||||
void operator delete[](void* ptr) noexcept; // replaceable
|
||||
void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable
|
||||
|
||||
void* operator new (std::size_t size, void* ptr) throw();
|
||||
void* operator new[](std::size_t size, void* ptr) throw();
|
||||
void operator delete (void* ptr, void*) throw();
|
||||
void operator delete[](void* ptr, void*) throw();
|
||||
void* operator new (std::size_t size, void* ptr) noexcept;
|
||||
void* operator new[](std::size_t size, void* ptr) noexcept;
|
||||
void operator delete (void* ptr, void*) noexcept;
|
||||
void operator delete[](void* ptr, void*) noexcept;
|
||||
|
||||
*/
|
||||
|
||||
@@ -66,18 +65,18 @@ class _LIBCPP_EXCEPTION_ABI bad_alloc
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_alloc() throw();
|
||||
virtual ~bad_alloc() throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_alloc() _NOEXCEPT;
|
||||
virtual ~bad_alloc() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_array_new_length
|
||||
: public bad_alloc
|
||||
{
|
||||
public:
|
||||
bad_array_new_length() throw();
|
||||
virtual ~bad_array_new_length() throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_array_new_length() _NOEXCEPT;
|
||||
virtual ~bad_array_new_length() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
void __throw_bad_alloc(); // not in C++ spec
|
||||
@@ -85,24 +84,32 @@ void __throw_bad_alloc(); // not in C++ spec
|
||||
struct _LIBCPP_VISIBLE nothrow_t {};
|
||||
extern _LIBCPP_VISIBLE const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) throw();
|
||||
_LIBCPP_VISIBLE new_handler get_new_handler() throw();
|
||||
_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE new_handler get_new_handler() _NOEXCEPT;
|
||||
|
||||
} // std
|
||||
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t) throw(std::bad_alloc);
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t, const std::nothrow_t&) throw();
|
||||
_LIBCPP_VISIBLE void operator delete(void*) throw();
|
||||
_LIBCPP_VISIBLE void operator delete(void*, const std::nothrow_t&) throw();
|
||||
_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, 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) throw(std::bad_alloc);
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t, const std::nothrow_t&) throw();
|
||||
_LIBCPP_VISIBLE void operator delete[](void*) throw();
|
||||
_LIBCPP_VISIBLE void operator delete[](void*, const std::nothrow_t&) throw();
|
||||
_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, 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) throw() {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) throw() {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete (void*, void*) throw() {}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete[](void*, void*) throw() {}
|
||||
_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;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete (void*, void*) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete[](void*, void*) _NOEXCEPT {}
|
||||
|
||||
#endif // _LIBCPP_NEW
|
||||
|
135
include/queue
135
include/queue
@@ -31,21 +31,28 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
queue();
|
||||
queue() = default;
|
||||
~queue() = default;
|
||||
|
||||
queue(const queue& q) = default;
|
||||
queue(queue&& q) = default;
|
||||
|
||||
queue& operator=(const queue& q) = default;
|
||||
queue& operator=(queue&& q) = default;
|
||||
|
||||
explicit queue(const container_type& c);
|
||||
explicit queue(container_type&& c);
|
||||
queue(queue&& q);
|
||||
explicit queue(container_type&& c)
|
||||
template <class Alloc>
|
||||
explicit queue(const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(const container_type& c, const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(container_type&& c, const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(const queue& q, const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(queue&& q, const Alloc& a);
|
||||
|
||||
queue& operator=(queue&& q);
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
|
||||
@@ -59,7 +66,7 @@ public:
|
||||
template <class... Args> void emplace(Args&&... args);
|
||||
void pop();
|
||||
|
||||
void swap(queue& q);
|
||||
void swap(queue& q) noexcept(noexcept(swap(c, q.c)));
|
||||
};
|
||||
|
||||
template <class T, class Container>
|
||||
@@ -81,7 +88,8 @@ template <class T, class Container>
|
||||
bool operator<=(const queue<T, Container>& x,const queue<T, Container>& y);
|
||||
|
||||
template <class T, class Container>
|
||||
void swap(queue<T, Container>& x, queue<T, Container>& y);
|
||||
void swap(queue<T, Container>& x, queue<T, Container>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class T, class Container = vector<T>,
|
||||
class Compare = less<typename Container::value_type>>
|
||||
@@ -99,7 +107,16 @@ protected:
|
||||
Compare comp;
|
||||
|
||||
public:
|
||||
explicit priority_queue(const Compare& comp = Compare());
|
||||
priority_queue() = default;
|
||||
~priority_queue() = default;
|
||||
|
||||
priority_queue(const priority_queue& q) = default;
|
||||
priority_queue(priority_queue&& q) = default;
|
||||
|
||||
priority_queue& operator=(const priority_queue& q) = default;
|
||||
priority_queue& operator=(priority_queue&& q) = default;
|
||||
|
||||
explicit priority_queue(const Compare& comp);
|
||||
priority_queue(const Compare& comp, const container_type& c);
|
||||
explicit priority_queue(const Compare& comp, container_type&& c);
|
||||
template <class InputIterator>
|
||||
@@ -111,8 +128,6 @@ public:
|
||||
template <class InputIterator>
|
||||
priority_queue(InputIterator first, InputIterator last,
|
||||
const Compare& comp, container_type&& c);
|
||||
priority_queue(priority_queue&& q);
|
||||
priority_queue& operator=(priority_queue&& q);
|
||||
template <class Alloc>
|
||||
explicit priority_queue(const Alloc& a);
|
||||
template <class Alloc>
|
||||
@@ -123,6 +138,8 @@ public:
|
||||
template <class Alloc>
|
||||
priority_queue(const Compare& comp, container_type&& c,
|
||||
const Alloc& a);
|
||||
template <class Alloc>
|
||||
priority_queue(const priority_queue& q, const Alloc& a);
|
||||
template <class Alloc>
|
||||
priority_queue(priority_queue&& q, const Alloc& a);
|
||||
|
||||
@@ -135,12 +152,14 @@ public:
|
||||
template <class... Args> void emplace(Args&&... args);
|
||||
void pop();
|
||||
|
||||
void swap(priority_queue& q);
|
||||
void swap(priority_queue& q)
|
||||
noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp.q.comp)));
|
||||
};
|
||||
|
||||
template <class T, class Container, class Compare>
|
||||
void swap(priority_queue<T, Container, Compare>& x,
|
||||
priority_queue<T, Container, Compare>& y);
|
||||
priority_queue<T, Container, Compare>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -181,14 +200,35 @@ protected:
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue() : c() {}
|
||||
queue()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
|
||||
: c() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(const queue& __q) : c(__q.c) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
|
||||
: c(_STD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue& operator=(const queue& __q) {c = __q.c; return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue& operator=(queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
|
||||
{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(_STD::move(__c)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q) : c(_STD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -222,12 +262,6 @@ public:
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_STD::move(__q.c), __a) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue& operator=(queue&& __q)
|
||||
{
|
||||
c = _STD::move(__q.c);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -261,6 +295,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(c, __q.c);
|
||||
@@ -331,6 +366,7 @@ template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
@@ -359,7 +395,36 @@ protected:
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit priority_queue(const value_compare& __comp = value_compare())
|
||||
priority_queue()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<container_type>::value &&
|
||||
is_nothrow_default_constructible<value_compare>::value)
|
||||
: c(), comp() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue(priority_queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
|
||||
is_nothrow_move_constructible<value_compare>::value)
|
||||
: c(_STD::move(__q.c)), comp(_STD::move(__q.comp)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue& operator=(const priority_queue& __q)
|
||||
{c = __q.c; comp = __q.comp; return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue& operator=(priority_queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
|
||||
is_nothrow_move_assignable<value_compare>::value)
|
||||
{c = _STD::move(__q.c); comp = _STD::move(__q.comp); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit priority_queue(const value_compare& __comp)
|
||||
: c(), comp(__comp) {}
|
||||
priority_queue(const value_compare& __comp, const container_type& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -375,8 +440,6 @@ public:
|
||||
template <class _InputIter>
|
||||
priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp, container_type&& __c);
|
||||
priority_queue(priority_queue&& __q);
|
||||
priority_queue& operator=(priority_queue&& __q);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _Alloc>
|
||||
explicit priority_queue(const _Alloc& __a,
|
||||
@@ -423,7 +486,9 @@ public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void pop();
|
||||
|
||||
void swap(priority_queue& __q);
|
||||
void swap(priority_queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
|
||||
__is_nothrow_swappable<value_compare>::value);
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
@@ -489,23 +554,6 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q)
|
||||
: c(_STD::move(__q.c)),
|
||||
comp(_STD::move(__q.comp))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
priority_queue<_Tp, _Container, _Compare>&
|
||||
priority_queue<_Tp, _Container, _Compare>::operator=(priority_queue&& __q)
|
||||
{
|
||||
c = _STD::move(__q.c);
|
||||
comp = _STD::move(__q.comp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
@@ -636,6 +684,8 @@ template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
|
||||
__is_nothrow_swappable<value_compare>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(c, __q.c);
|
||||
@@ -647,6 +697,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(priority_queue<_Tp, _Container, _Compare>& __x,
|
||||
priority_queue<_Tp, _Container, _Compare>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -274,10 +274,19 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_multiply
|
||||
= typename __ratio_multiply<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_multiply
|
||||
: public __ratio_multiply<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_divide
|
||||
{
|
||||
@@ -292,10 +301,19 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_divide
|
||||
= typename __ratio_divide<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_divide
|
||||
: public __ratio_divide<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_add
|
||||
{
|
||||
@@ -318,10 +336,19 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_add
|
||||
= typename __ratio_add<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_add
|
||||
: public __ratio_add<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_subtract
|
||||
{
|
||||
@@ -344,10 +371,19 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_subtract
|
||||
= typename __ratio_subtract<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_subtract
|
||||
: public __ratio_subtract<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
// ratio_equal
|
||||
|
||||
template <class _R1, class _R2>
|
||||
|
@@ -49,24 +49,25 @@ public:
|
||||
scoped_allocator_adaptor();
|
||||
template <class OuterA2>
|
||||
scoped_allocator_adaptor(OuterA2&& outerAlloc,
|
||||
const InnerAllocs&... innerAllocs);
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor& other);
|
||||
const InnerAllocs&... innerAllocs) noexcept;
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor& other) noexcept;
|
||||
scoped_allocator_adaptor(scoped_allocator_adaptor&& other) noexcept;
|
||||
template <class OuterA2>
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other);
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other) noexcept;
|
||||
template <class OuterA2>
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other);
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept;
|
||||
|
||||
~scoped_allocator_adaptor();
|
||||
|
||||
inner_allocator_type& inner_allocator();
|
||||
const inner_allocator_type& inner_allocator() const;
|
||||
inner_allocator_type& inner_allocator() noexcept;
|
||||
const inner_allocator_type& inner_allocator() const noexcept;
|
||||
|
||||
outer_allocator_type& outer_allocator();
|
||||
const outer_allocator_type& outer_allocator() const;
|
||||
outer_allocator_type& outer_allocator() noexcept;
|
||||
const outer_allocator_type& outer_allocator() const noexcept;
|
||||
|
||||
pointer allocate(size_type n);
|
||||
pointer allocate(size_type n, const_void_pointer hint);
|
||||
void deallocate(pointer p, size_type n);
|
||||
void deallocate(pointer p, size_type n) noexcept;
|
||||
|
||||
size_type max_size() const;
|
||||
template <class T, class... Args> void construct(T* p, Args&& args);
|
||||
@@ -83,18 +84,20 @@ public:
|
||||
void construct(pair<T1, T2>* p, pair<U, V>&& x);
|
||||
template <class T> void destroy(T* p);
|
||||
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const;
|
||||
template <class T> void destroy(T* p) noexcept;
|
||||
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const noexcept;
|
||||
};
|
||||
|
||||
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
|
||||
|
||||
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
||||
bool
|
||||
operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
|
||||
|
||||
} // std
|
||||
|
||||
@@ -182,7 +185,7 @@ private:
|
||||
protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage() {}
|
||||
__scoped_allocator_storage() _NOEXCEPT {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
@@ -190,7 +193,7 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs)
|
||||
const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)),
|
||||
__inner_(__innerAllocs...) {}
|
||||
|
||||
@@ -200,7 +203,7 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other)
|
||||
const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT
|
||||
: outer_allocator_type(__other.outer_allocator()),
|
||||
__inner_(__other.inner_allocator()) {}
|
||||
|
||||
@@ -210,7 +213,7 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other)
|
||||
__scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())),
|
||||
__inner_(_STD::move(__other.inner_allocator())) {}
|
||||
|
||||
@@ -220,27 +223,27 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i)
|
||||
const inner_allocator_type& __i) _NOEXCEPT
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__o)),
|
||||
__inner_(__i)
|
||||
{
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator() {return __inner_;}
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT {return __inner_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const {return __inner_;}
|
||||
const inner_allocator_type& inner_allocator() const _NOEXCEPT {return __inner_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator()
|
||||
outer_allocator_type& outer_allocator() _NOEXCEPT
|
||||
{return static_cast<outer_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
{return static_cast<const outer_allocator_type&>(*this);}
|
||||
|
||||
scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
select_on_container_copy_construction() const
|
||||
select_on_container_copy_construction() const _NOEXCEPT
|
||||
{
|
||||
return scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
|
||||
(
|
||||
@@ -263,14 +266,14 @@ protected:
|
||||
typedef scoped_allocator_adaptor<_OuterAlloc> inner_allocator_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage() {}
|
||||
__scoped_allocator_storage() _NOEXCEPT {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc)
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc) _NOEXCEPT
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
@@ -279,7 +282,7 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
const __scoped_allocator_storage<_OuterA2>& __other)
|
||||
const __scoped_allocator_storage<_OuterA2>& __other) _NOEXCEPT
|
||||
: outer_allocator_type(__other.outer_allocator()) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
@@ -288,33 +291,33 @@ protected:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2>&& __other)
|
||||
__scoped_allocator_storage<_OuterA2>&& __other) _NOEXCEPT
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator()
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT
|
||||
{return static_cast<inner_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const
|
||||
const inner_allocator_type& inner_allocator() const _NOEXCEPT
|
||||
{return static_cast<const inner_allocator_type&>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator()
|
||||
outer_allocator_type& outer_allocator() _NOEXCEPT
|
||||
{return static_cast<outer_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
{return static_cast<const outer_allocator_type&>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor<outer_allocator_type>
|
||||
select_on_container_copy_construction() const
|
||||
select_on_container_copy_construction() const _NOEXCEPT
|
||||
{return scoped_allocator_adaptor<outer_allocator_type>(
|
||||
allocator_traits<outer_allocator_type>::
|
||||
select_on_container_copy_construction(outer_allocator())
|
||||
);}
|
||||
|
||||
__scoped_allocator_storage(const outer_allocator_type& __o,
|
||||
const inner_allocator_type& __i);
|
||||
const inner_allocator_type& __i) _NOEXCEPT;
|
||||
|
||||
template <class...> friend class __scoped_allocator_storage;
|
||||
};
|
||||
@@ -343,7 +346,7 @@ struct __outermost
|
||||
{
|
||||
typedef _Alloc type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type& operator()(type& __a) const {return __a;}
|
||||
type& operator()(type& __a) const _NOEXCEPT {return __a;}
|
||||
};
|
||||
|
||||
template <class _Alloc>
|
||||
@@ -355,7 +358,7 @@ struct __outermost<_Alloc, true>
|
||||
>::type _OuterAlloc;
|
||||
typedef typename __outermost<_OuterAlloc>::type type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type& operator()(_Alloc& __a) const
|
||||
type& operator()(_Alloc& __a) const _NOEXCEPT
|
||||
{return __outermost<_OuterAlloc>()(__a.outer_allocator());}
|
||||
};
|
||||
|
||||
@@ -403,14 +406,14 @@ public:
|
||||
};
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor() {}
|
||||
scoped_allocator_adaptor() _NOEXCEPT {}
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs)
|
||||
const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
|
||||
: base(_STD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
|
||||
// scoped_allocator_adaptor(const scoped_allocator_adaptor& __other) = default;
|
||||
template <class _OuterA2,
|
||||
@@ -419,7 +422,7 @@ public:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other)
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT
|
||||
: base(__other) {}
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
@@ -427,23 +430,23 @@ public:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other)
|
||||
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
|
||||
: base(_STD::move(__other)) {}
|
||||
|
||||
// ~scoped_allocator_adaptor() = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator()
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT
|
||||
{return base::inner_allocator();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const
|
||||
const inner_allocator_type& inner_allocator() const _NOEXCEPT
|
||||
{return base::inner_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator()
|
||||
outer_allocator_type& outer_allocator() _NOEXCEPT
|
||||
{return base::outer_allocator();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
{return base::outer_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -456,7 +459,7 @@ public:
|
||||
allocate(outer_allocator(), __n, __hint);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void deallocate(pointer __p, size_type __n)
|
||||
void deallocate(pointer __p, size_type __n) _NOEXCEPT
|
||||
{allocator_traits<outer_allocator_type>::
|
||||
deallocate(outer_allocator(), __p, __n);}
|
||||
|
||||
@@ -479,7 +482,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const _NOEXCEPT
|
||||
{return base::select_on_container_copy_construction();}
|
||||
|
||||
private:
|
||||
@@ -490,7 +493,7 @@ private:
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i)
|
||||
const inner_allocator_type& __i) _NOEXCEPT
|
||||
: base(_STD::forward<_OuterA2>(__o), __i) {}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
@@ -542,16 +545,16 @@ template <class _OuterA1, class _OuterA2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2>& __b)
|
||||
const scoped_allocator_adaptor<_OuterA2>& __b) _NOEXCEPT
|
||||
{
|
||||
return __a.outer_allocator() == __b.outer_allocator();
|
||||
}
|
||||
|
||||
template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
|
||||
template <class _OuterA1, class _OuterA2, class _InnerA0, class... _InnerAllocs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b)
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerA0, _InnerAllocs...>& __b) _NOEXCEPT
|
||||
{
|
||||
return __a.outer_allocator() == __b.outer_allocator() &&
|
||||
__a.inner_allocator() == __b.inner_allocator();
|
||||
@@ -561,7 +564,7 @@ template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b)
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b) _NOEXCEPT
|
||||
{
|
||||
return !(__a == __b);
|
||||
}
|
||||
|
219
include/set
219
include/set
@@ -42,7 +42,12 @@ public:
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit set(const value_compare& comp = value_compare());
|
||||
set()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value);
|
||||
explicit set(const value_compare& comp);
|
||||
set(const value_compare& comp, const allocator_type& a);
|
||||
template <class InputIterator>
|
||||
set(InputIterator first, InputIterator last,
|
||||
@@ -51,7 +56,10 @@ public:
|
||||
set(InputIterator first, InputIterator last, const value_compare& comp,
|
||||
const allocator_type& a);
|
||||
set(const set& s);
|
||||
set(set&& s);
|
||||
set(set&& s)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<allocator_type>::value &&
|
||||
is_nothrow_move_constructible<key_compare>::value);
|
||||
explicit set(const allocator_type& a);
|
||||
set(const set& s, const allocator_type& a);
|
||||
set(set&& s, const allocator_type& a);
|
||||
@@ -61,29 +69,33 @@ public:
|
||||
~set();
|
||||
|
||||
set& operator=(const set& s);
|
||||
set& operator=(set&& s);
|
||||
set& operator=(set&& s)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<key_compare>::value);
|
||||
set& operator=(initializer_list<value_type> il);
|
||||
|
||||
// iterators:
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
// capacity:
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
// modifiers:
|
||||
template <class... Args>
|
||||
@@ -101,12 +113,16 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(set& s);
|
||||
void swap(set& s)
|
||||
noexcept(
|
||||
__is_nothrow_swappable<key_compare>::value &&
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value));
|
||||
|
||||
// observers:
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
key_compare key_comp() const;
|
||||
value_compare value_comp() const;
|
||||
|
||||
@@ -155,7 +171,8 @@ operator<=(const set<Key, Compare, Allocator>& x,
|
||||
// specialized algorithms:
|
||||
template <class Key, class Compare, class Allocator>
|
||||
void
|
||||
swap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y);
|
||||
swap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class Key, class Compare = less<Key>,
|
||||
class Allocator = allocator<Key>>
|
||||
@@ -181,7 +198,12 @@ public:
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit multiset(const value_compare& comp = value_compare());
|
||||
multiset()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value);
|
||||
explicit multiset(const value_compare& comp);
|
||||
multiset(const value_compare& comp, const allocator_type& a);
|
||||
template <class InputIterator>
|
||||
multiset(InputIterator first, InputIterator last,
|
||||
@@ -190,7 +212,10 @@ public:
|
||||
multiset(InputIterator first, InputIterator last,
|
||||
const value_compare& comp, const allocator_type& a);
|
||||
multiset(const multiset& s);
|
||||
multiset(multiset&& s);
|
||||
multiset(multiset&& s)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<allocator_type>::value &&
|
||||
is_nothrow_move_constructible<key_compare>::value);
|
||||
explicit multiset(const allocator_type& a);
|
||||
multiset(const multiset& s, const allocator_type& a);
|
||||
multiset(multiset&& s, const allocator_type& a);
|
||||
@@ -200,29 +225,33 @@ public:
|
||||
~multiset();
|
||||
|
||||
multiset& operator=(const multiset& s);
|
||||
multiset& operator=(multiset&& s);
|
||||
multiset& operator=(multiset&& s)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<key_compare>::value);
|
||||
multiset& operator=(initializer_list<value_type> il);
|
||||
|
||||
// iterators:
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
// capacity:
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
// modifiers:
|
||||
template <class... Args>
|
||||
@@ -240,12 +269,16 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(multiset& s);
|
||||
void swap(multiset& s)
|
||||
noexcept(
|
||||
__is_nothrow_swappable<key_compare>::value &&
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value));
|
||||
|
||||
// observers:
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
key_compare key_comp() const;
|
||||
value_compare value_comp() const;
|
||||
|
||||
@@ -294,7 +327,8 @@ operator<=(const multiset<Key, Compare, Allocator>& x,
|
||||
// specialized algorithms:
|
||||
template <class Key, class Compare, class Allocator>
|
||||
void
|
||||
swap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y);
|
||||
swap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -341,6 +375,10 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit set(const value_compare& __comp = value_compare())
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value)
|
||||
: __tree_(__comp) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const value_compare& __comp, const allocator_type& __a)
|
||||
@@ -373,6 +411,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(set&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -416,6 +455,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set& operator=(set&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
@@ -423,38 +463,42 @@ public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __tree_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __tree_.end();}
|
||||
iterator end() _NOEXCEPT {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __tree_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return end();}
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return rbegin();}
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return rend();}
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __tree_.size();}
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
|
||||
|
||||
// modifiers:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
@@ -504,13 +548,14 @@ public:
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f, __l);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__tree_.clear();}
|
||||
void clear() _NOEXCEPT {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(set& __s) {__tree_.swap(__s.__tree_);}
|
||||
void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
|
||||
{__tree_.swap(__s.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_compare key_comp() const {return __tree_.value_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -620,6 +665,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(set<_Key, _Compare, _Allocator>& __x,
|
||||
set<_Key, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
@@ -658,6 +704,10 @@ public:
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multiset(const value_compare& __comp = value_compare())
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value)
|
||||
: __tree_(__comp) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const value_compare& __comp, const allocator_type& __a)
|
||||
@@ -691,6 +741,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(multiset&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -731,6 +782,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset& operator=(multiset&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
@@ -738,38 +790,42 @@ public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __tree_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __tree_.end();}
|
||||
iterator end() _NOEXCEPT {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __tree_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return end();}
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return rbegin();}
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return rend();}
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __tree_.size();}
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
|
||||
|
||||
// modifiers:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
@@ -818,13 +874,15 @@ public:
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f, __l);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__tree_.clear();}
|
||||
void clear() _NOEXCEPT {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(multiset& __s) {__tree_.swap(__s.__tree_);}
|
||||
void swap(multiset& __s)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__base>::value)
|
||||
{__tree_.swap(__s.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_compare key_comp() const {return __tree_.value_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -933,6 +991,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(multiset<_Key, _Compare, _Allocator>& __x,
|
||||
multiset<_Key, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -31,14 +31,21 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
explicit stack();
|
||||
stack() = default;
|
||||
~stack() = default;
|
||||
|
||||
stack(const stack& q) = default;
|
||||
stack(stack&& q) = default;
|
||||
|
||||
stack& operator=(const stack& q) = default;
|
||||
stack& operator=(stack&& q) = default;
|
||||
|
||||
explicit stack(const container_type& c);
|
||||
explicit stack(container_type&& c);
|
||||
stack(stack&& s);
|
||||
stack& operator=(stack&& s);
|
||||
template <class Alloc> explicit stack(const Alloc& a);
|
||||
template <class Alloc> stack(const container_type& c, const Alloc& a);
|
||||
template <class Alloc> stack(container_type&& c, const Alloc& a);
|
||||
template <class Alloc> stack(const stack& c, const Alloc& a);
|
||||
template <class Alloc> stack(stack&& c, const Alloc& a);
|
||||
|
||||
bool empty() const;
|
||||
@@ -51,7 +58,7 @@ public:
|
||||
template <class... Args> void emplace(Args&&... args);
|
||||
void pop();
|
||||
|
||||
void swap(stack& c);
|
||||
void swap(stack& c) noexcept(noexcept(swap(c, q.c)));
|
||||
};
|
||||
|
||||
template <class T, class Container>
|
||||
@@ -68,7 +75,8 @@ template <class T, class Container>
|
||||
bool operator<=(const stack<T, Container>& x, const stack<T, Container>& y);
|
||||
|
||||
template <class T, class Container>
|
||||
void swap(stack<T, Container>& x, stack<T, Container>& y);
|
||||
void swap(stack<T, Container>& x, stack<T, Container>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -106,16 +114,35 @@ protected:
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack() : c() {}
|
||||
stack()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
|
||||
: c() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(const stack& __q) : c(__q.c) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
|
||||
: c(_STD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack& operator=(const stack& __q) {c = __q.c; return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack& operator=(stack&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
|
||||
{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(_STD::move(__c)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __s) : c(_STD::move(__s.c)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack& operator=(stack&& __s) {c = _STD::move(__s.c); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -176,6 +203,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(stack& __s)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(c, __s.c);
|
||||
@@ -244,6 +272,7 @@ template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -33,9 +33,9 @@ class xxx_error : public exception // at least indirectly
|
||||
{
|
||||
public:
|
||||
explicit xxx_error(const string& what_arg);
|
||||
explicit xxx_error(const char* what_arg); // extension
|
||||
explicit xxx_error(const char* what_arg);
|
||||
|
||||
virtual const char* what() const // returns what_arg
|
||||
virtual const char* what() const noexcept // returns what_arg
|
||||
};
|
||||
|
||||
} // std
|
||||
@@ -60,12 +60,12 @@ public:
|
||||
explicit logic_error(const string&);
|
||||
explicit logic_error(const char*);
|
||||
|
||||
logic_error(const logic_error&) throw();
|
||||
logic_error& operator=(const logic_error&) throw();
|
||||
logic_error(const logic_error&) _NOEXCEPT;
|
||||
logic_error& operator=(const logic_error&) _NOEXCEPT;
|
||||
|
||||
virtual ~logic_error() throw();
|
||||
virtual ~logic_error() _NOEXCEPT;
|
||||
|
||||
virtual const char* what() const throw();
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI runtime_error
|
||||
@@ -77,12 +77,12 @@ public:
|
||||
explicit runtime_error(const string&);
|
||||
explicit runtime_error(const char*);
|
||||
|
||||
runtime_error(const runtime_error&) throw();
|
||||
runtime_error& operator=(const runtime_error&) throw();
|
||||
runtime_error(const runtime_error&) _NOEXCEPT;
|
||||
runtime_error& operator=(const runtime_error&) _NOEXCEPT;
|
||||
|
||||
virtual ~runtime_error() throw();
|
||||
virtual ~runtime_error() _NOEXCEPT;
|
||||
|
||||
virtual const char* what() const throw();
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI domain_error
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~domain_error() throw();
|
||||
virtual ~domain_error() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI invalid_argument
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~invalid_argument() throw();
|
||||
virtual ~invalid_argument() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI length_error
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~length_error() throw();
|
||||
virtual ~length_error() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI out_of_range
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~out_of_range() throw();
|
||||
virtual ~out_of_range() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI range_error
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {}
|
||||
|
||||
virtual ~range_error() throw();
|
||||
virtual ~range_error() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI overflow_error
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {}
|
||||
|
||||
virtual ~overflow_error() throw();
|
||||
virtual ~overflow_error() _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI underflow_error
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {}
|
||||
|
||||
virtual ~underflow_error() throw();
|
||||
virtual ~underflow_error() _NOEXCEPT;
|
||||
};
|
||||
|
||||
} // std
|
||||
|
808
include/string
808
include/string
File diff suppressed because it is too large
Load Diff
@@ -20,24 +20,24 @@ namespace std
|
||||
class error_category
|
||||
{
|
||||
public:
|
||||
virtual ~error_category();
|
||||
virtual ~error_category() noexcept;
|
||||
|
||||
error_category(const error_category&) = delete;
|
||||
error_category& operator=(const error_category&) = delete;
|
||||
|
||||
virtual const char* name() const = 0;
|
||||
virtual error_condition default_error_condition(int ev) const;
|
||||
virtual bool equivalent(int code, const error_condition& condition) const;
|
||||
virtual bool equivalent(const error_code& code, int condition) const;
|
||||
virtual const char* name() const noexcept = 0;
|
||||
virtual error_condition default_error_condition(int ev) const noexcept;
|
||||
virtual bool equivalent(int code, const error_condition& condition) const noexcept;
|
||||
virtual bool equivalent(const error_code& code, int condition) const noexcept;
|
||||
virtual string message(int ev) const = 0;
|
||||
|
||||
bool operator==(const error_category& rhs) const;
|
||||
bool operator!=(const error_category& rhs) const;
|
||||
bool operator<(const error_category& rhs) const;
|
||||
bool operator==(const error_category& rhs) const noexcept;
|
||||
bool operator!=(const error_category& rhs) const noexcept;
|
||||
bool operator<(const error_category& rhs) const noexcept;
|
||||
};
|
||||
|
||||
const error_category& generic_category();
|
||||
const error_category& system_category();
|
||||
const error_category& generic_category() noexcept;
|
||||
const error_category& system_category() noexcept;
|
||||
|
||||
template <class T> struct is_error_code_enum
|
||||
: public false_type {};
|
||||
@@ -49,27 +49,27 @@ class error_code
|
||||
{
|
||||
public:
|
||||
// constructors:
|
||||
error_code();
|
||||
error_code(int val, const error_category& cat);
|
||||
error_code() noexcept;
|
||||
error_code(int val, const error_category& cat) noexcept;
|
||||
template <class ErrorCodeEnum>
|
||||
error_code(ErrorCodeEnum e);
|
||||
error_code(ErrorCodeEnum e) noexcept;
|
||||
|
||||
// modifiers:
|
||||
void assign(int val, const error_category& cat);
|
||||
void assign(int val, const error_category& cat) noexcept;
|
||||
template <class ErrorCodeEnum>
|
||||
error_code& operator=(ErrorCodeEnum e);
|
||||
void clear();
|
||||
error_code& operator=(ErrorCodeEnum e) noexcept;
|
||||
void clear() noexcept;
|
||||
|
||||
// observers:
|
||||
int value() const;
|
||||
const error_category& category() const;
|
||||
error_condition default_error_condition() const;
|
||||
int value() const noexcept;
|
||||
const error_category& category() const noexcept;
|
||||
error_condition default_error_condition() const noexcept;
|
||||
string message() const;
|
||||
explicit operator bool() const;
|
||||
explicit operator bool() const noexcept;
|
||||
};
|
||||
|
||||
// non-member functions:
|
||||
bool operator<(const error_code& lhs, const error_code& rhs);
|
||||
bool operator<(const error_code& lhs, const error_code& rhs) noexcept;
|
||||
template <class charT, class traits>
|
||||
basic_ostream<charT,traits>&
|
||||
operator<<(basic_ostream<charT,traits>& os, const error_code& ec);
|
||||
@@ -78,25 +78,25 @@ class error_condition
|
||||
{
|
||||
public:
|
||||
// constructors:
|
||||
error_condition();
|
||||
error_condition(int val, const error_category& cat);
|
||||
error_condition() noexcept;
|
||||
error_condition(int val, const error_category& cat) noexcept;
|
||||
template <class ErrorConditionEnum>
|
||||
error_condition(ErrorConditionEnum e);
|
||||
error_condition(ErrorConditionEnum e) noexcept;
|
||||
|
||||
// modifiers:
|
||||
void assign(int val, const error_category& cat);
|
||||
void assign(int val, const error_category& cat) noexcept;
|
||||
template <class ErrorConditionEnum>
|
||||
error_condition& operator=(ErrorConditionEnum e);
|
||||
void clear();
|
||||
error_condition& operator=(ErrorConditionEnum e) noexcept;
|
||||
void clear() noexcept;
|
||||
|
||||
// observers:
|
||||
int value() const;
|
||||
const error_category& category() const;
|
||||
string message() const;
|
||||
explicit operator bool() const;
|
||||
int value() const noexcept;
|
||||
const error_category& category() const noexcept;
|
||||
string message() const noexcept;
|
||||
explicit operator bool() const noexcept;
|
||||
};
|
||||
|
||||
bool operator<(const error_condition& lhs, const error_condition& rhs);
|
||||
bool operator<(const error_condition& lhs, const error_condition& rhs) noexcept;
|
||||
|
||||
class system_error
|
||||
: public runtime_error
|
||||
@@ -109,8 +109,8 @@ public:
|
||||
system_error(int ev, const error_category& ecat, const char* what_arg);
|
||||
system_error(int ev, const error_category& ecat);
|
||||
|
||||
const error_code& code() const throw();
|
||||
const char* what() const throw();
|
||||
const error_code& code() const noexcept;
|
||||
const char* what() const noexcept;
|
||||
};
|
||||
|
||||
enum class errc
|
||||
@@ -198,18 +198,18 @@ enum class errc
|
||||
template <> struct is_error_condition_enum<errc>
|
||||
: true_type { }
|
||||
|
||||
error_code make_error_code(errc e);
|
||||
error_condition make_error_condition(errc e);
|
||||
error_code make_error_code(errc e) noexcept;
|
||||
error_condition make_error_condition(errc e) noexcept;
|
||||
|
||||
// Comparison operators:
|
||||
bool operator==(const error_code& lhs, const error_code& rhs);
|
||||
bool operator==(const error_code& lhs, const error_condition& rhs);
|
||||
bool operator==(const error_condition& lhs, const error_code& rhs);
|
||||
bool operator==(const error_condition& lhs, const error_condition& rhs);
|
||||
bool operator!=(const error_code& lhs, const error_code& rhs);
|
||||
bool operator!=(const error_code& lhs, const error_condition& rhs);
|
||||
bool operator!=(const error_condition& lhs, const error_code& rhs);
|
||||
bool operator!=(const error_condition& lhs, const error_condition& rhs);
|
||||
bool operator==(const error_code& lhs, const error_code& rhs) noexcept;
|
||||
bool operator==(const error_code& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator==(const error_condition& lhs, const error_code& rhs) noexcept;
|
||||
bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator!=(const error_code& lhs, const error_code& rhs) noexcept;
|
||||
bool operator!=(const error_code& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept;
|
||||
bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept;
|
||||
|
||||
template <> struct hash<std::error_code>;
|
||||
|
||||
@@ -369,28 +369,28 @@ class __do_message;
|
||||
class _LIBCPP_VISIBLE error_category
|
||||
{
|
||||
public:
|
||||
virtual ~error_category();
|
||||
virtual ~error_category() _NOEXCEPT;
|
||||
|
||||
private:
|
||||
error_category();
|
||||
error_category() _NOEXCEPT;
|
||||
error_category(const error_category&);// = delete;
|
||||
error_category& operator=(const error_category&);// = delete;
|
||||
|
||||
public:
|
||||
virtual const char* name() const = 0;
|
||||
virtual error_condition default_error_condition(int __ev) const;
|
||||
virtual bool equivalent(int __code, const error_condition& __condition) const;
|
||||
virtual bool equivalent(const error_code& __code, int __condition) const;
|
||||
virtual const char* name() const _NOEXCEPT = 0;
|
||||
virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
|
||||
virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
|
||||
virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
|
||||
virtual string message(int __ev) const = 0;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool operator==(const error_category& __rhs) const {return this == &__rhs;}
|
||||
bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool operator!=(const error_category& __rhs) const {return !(*this == __rhs);}
|
||||
bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool operator< (const error_category& __rhs) const {return this < &__rhs;}
|
||||
bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
|
||||
|
||||
friend class __do_message;
|
||||
};
|
||||
@@ -402,8 +402,8 @@ public:
|
||||
virtual string message(int ev) const;
|
||||
};
|
||||
|
||||
const error_category& generic_category();
|
||||
const error_category& system_category();
|
||||
const error_category& generic_category() _NOEXCEPT;
|
||||
const error_category& system_category() _NOEXCEPT;
|
||||
|
||||
class _LIBCPP_VISIBLE error_condition
|
||||
{
|
||||
@@ -411,19 +411,21 @@ class _LIBCPP_VISIBLE error_condition
|
||||
const error_category* __cat_;
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition() : __val_(0), __cat_(&generic_category()) {}
|
||||
error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition(int __val, const error_category& __cat)
|
||||
error_condition(int __val, const error_category& __cat) _NOEXCEPT
|
||||
: __val_(__val), __cat_(&__cat) {}
|
||||
|
||||
template <class _E>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition(_E __e, typename enable_if<is_error_condition_enum<_E>::value>::type* = 0)
|
||||
error_condition(_E __e,
|
||||
typename enable_if<is_error_condition_enum<_E>::value>::type* = 0
|
||||
) _NOEXCEPT
|
||||
{*this = make_error_condition(__e);}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void assign(int __val, const error_category& __cat)
|
||||
void assign(int __val, const error_category& __cat) _NOEXCEPT
|
||||
{
|
||||
__val_ = __val;
|
||||
__cat_ = &__cat;
|
||||
@@ -436,38 +438,38 @@ public:
|
||||
is_error_condition_enum<_E>::value,
|
||||
error_condition&
|
||||
>::type
|
||||
operator=(_E __e)
|
||||
operator=(_E __e) _NOEXCEPT
|
||||
{*this = make_error_condition(__e); return *this;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void clear()
|
||||
void clear() _NOEXCEPT
|
||||
{
|
||||
__val_ = 0;
|
||||
__cat_ = &generic_category();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int value() const {return __val_;}
|
||||
int value() const _NOEXCEPT {return __val_;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
const error_category& category() const {return *__cat_;}
|
||||
const error_category& category() const _NOEXCEPT {return *__cat_;}
|
||||
string message() const;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
//explicit
|
||||
operator bool() const {return __val_ != 0;}
|
||||
operator bool() const _NOEXCEPT {return __val_ != 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
error_condition
|
||||
make_error_condition(errc __e)
|
||||
make_error_condition(errc __e) _NOEXCEPT
|
||||
{
|
||||
return error_condition(static_cast<int>(__e), generic_category());
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const error_condition& __x, const error_condition& __y)
|
||||
operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.category() < __y.category()
|
||||
|| __x.category() == __y.category() && __x.value() < __y.value();
|
||||
@@ -481,19 +483,21 @@ class _LIBCPP_VISIBLE error_code
|
||||
const error_category* __cat_;
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_code() : __val_(0), __cat_(&system_category()) {}
|
||||
error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_code(int __val, const error_category& __cat)
|
||||
error_code(int __val, const error_category& __cat) _NOEXCEPT
|
||||
: __val_(__val), __cat_(&__cat) {}
|
||||
|
||||
template <class _E>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_code(_E __e, typename enable_if<is_error_code_enum<_E>::value>::type* = 0)
|
||||
error_code(_E __e,
|
||||
typename enable_if<is_error_code_enum<_E>::value>::type* = 0
|
||||
) _NOEXCEPT
|
||||
{*this = make_error_code(__e);}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void assign(int __val, const error_category& __cat)
|
||||
void assign(int __val, const error_category& __cat) _NOEXCEPT
|
||||
{
|
||||
__val_ = __val;
|
||||
__cat_ = &__cat;
|
||||
@@ -506,43 +510,43 @@ public:
|
||||
is_error_code_enum<_E>::value,
|
||||
error_code&
|
||||
>::type
|
||||
operator=(_E __e)
|
||||
operator=(_E __e) _NOEXCEPT
|
||||
{*this = make_error_code(__e); return *this;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void clear()
|
||||
void clear() _NOEXCEPT
|
||||
{
|
||||
__val_ = 0;
|
||||
__cat_ = &system_category();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int value() const {return __val_;}
|
||||
int value() const _NOEXCEPT {return __val_;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
const error_category& category() const {return *__cat_;}
|
||||
const error_category& category() const _NOEXCEPT {return *__cat_;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition default_error_condition() const
|
||||
error_condition default_error_condition() const _NOEXCEPT
|
||||
{return __cat_->default_error_condition(__val_);}
|
||||
|
||||
string message() const;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
//explicit
|
||||
operator bool() const {return __val_ != 0;}
|
||||
operator bool() const _NOEXCEPT {return __val_ != 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
error_code
|
||||
make_error_code(errc __e)
|
||||
make_error_code(errc __e) _NOEXCEPT
|
||||
{
|
||||
return error_code(static_cast<int>(__e), generic_category());
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const error_code& __x, const error_code& __y)
|
||||
operator<(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.category() < __y.category()
|
||||
|| __x.category() == __y.category() && __x.value() < __y.value();
|
||||
@@ -550,14 +554,14 @@ operator<(const error_code& __x, const error_code& __y)
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_code& __x, const error_code& __y)
|
||||
operator==(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.category() == __y.category() && __x.value() == __y.value();
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_code& __x, const error_condition& __y)
|
||||
operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.category().equivalent(__x.value(), __y)
|
||||
|| __y.category().equivalent(__x, __y.value());
|
||||
@@ -565,40 +569,44 @@ operator==(const error_code& __x, const error_condition& __y)
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_condition& __x, const error_code& __y)
|
||||
operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT
|
||||
{
|
||||
return __y == __x;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_condition& __x, const error_condition& __y)
|
||||
operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
{
|
||||
return __x.category() == __y.category() && __x.value() == __y.value();
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_code& __x, const error_code& __y) {return !(__x == __y);}
|
||||
operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_code& __x, const error_condition& __y) {return !(__x == __y);}
|
||||
operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_condition& __x, const error_code& __y) {return !(__x == __y);}
|
||||
operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_condition& __x, const error_condition& __y) {return !(__x == __y);}
|
||||
operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<error_code>
|
||||
: public unary_function<error_code, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const error_code& __ec) const
|
||||
size_t operator()(const error_code& __ec) const _NOEXCEPT
|
||||
{
|
||||
return static_cast<size_t>(__ec.value());
|
||||
}
|
||||
@@ -617,10 +625,10 @@ public:
|
||||
system_error(int __ev, const error_category& __ecat, const string& __what_arg);
|
||||
system_error(int __ev, const error_category& __ecat, const char* __what_arg);
|
||||
system_error(int __ev, const error_category& __ecat);
|
||||
~system_error() throw();
|
||||
~system_error() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
const error_code& code() const throw() {return __ec_;}
|
||||
const error_code& code() const _NOEXCEPT {return __ec_;}
|
||||
|
||||
private:
|
||||
static string __init(const error_code&, string);
|
||||
|
@@ -95,6 +95,9 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
|
||||
#include <system_error>
|
||||
#include <chrono>
|
||||
#include <__mutex_base>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#pragma GCC system_header
|
||||
@@ -315,6 +318,44 @@ public:
|
||||
|
||||
__thread_specific_ptr<__thread_struct>& __thread_local_data();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F, class ..._Args, size_t ..._Indices>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__threaad_execute(tuple<_F, _Args...>& __t, __tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_STD::move(_STD::get<0>(__t)), _STD::move(_STD::get<_Indices>(__t))...);
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
{
|
||||
__thread_local_data().reset(new __thread_struct);
|
||||
std::unique_ptr<_F> __p(static_cast<_F*>(__vp));
|
||||
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
|
||||
__threaad_execute(*__p, _Index());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <class _F, class ..._Args,
|
||||
class
|
||||
>
|
||||
thread::thread(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G;
|
||||
_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();
|
||||
else
|
||||
__throw_system_error(__ec, "thread constructor failed");
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
@@ -325,25 +366,6 @@ __thread_proxy(void* __vp)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F, class ..._Args,
|
||||
class
|
||||
>
|
||||
thread::thread(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef decltype(bind(std::forward<_F>(__f), std::forward<_Args>(__args)...)) _G;
|
||||
std::unique_ptr<_G> __p(new _G(bind(std::forward<_F>(__f),
|
||||
std::forward<_Args>(__args)...)));
|
||||
int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get());
|
||||
if (__ec == 0)
|
||||
__p.release();
|
||||
else
|
||||
__throw_system_error(__ec, "thread constructor failed");
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
thread::thread(_F __f)
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@ public:
|
||||
template <class... U>
|
||||
explicit tuple(U&&...);
|
||||
tuple(const tuple&) = default;
|
||||
tuple(tuple&&);
|
||||
tuple(tuple&&) = default;
|
||||
template <class... U>
|
||||
tuple(const tuple<U...>&);
|
||||
template <class... U>
|
||||
@@ -56,7 +56,8 @@ public:
|
||||
tuple(allocator_arg_t, const Alloc& a, pair<U1, U2>&&);
|
||||
|
||||
tuple& operator=(const tuple&);
|
||||
tuple& operator=(tuple&&);
|
||||
tuple&
|
||||
operator=(tuple&&) noexcept(AND(is_nothrow_move_assignable<T>::value ...));
|
||||
template <class... U>
|
||||
tuple& operator=(const tuple<U...>&);
|
||||
template <class... U>
|
||||
@@ -66,14 +67,14 @@ public:
|
||||
template <class U1, class U2>
|
||||
tuple& operator=(pair<U1, U2>&&); //iffsizeof...(T) == 2
|
||||
|
||||
void swap(tuple&);
|
||||
void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...));
|
||||
};
|
||||
|
||||
const unspecified ignore;
|
||||
|
||||
template <class... T> tuple<V...> make_tuple(T&&...);
|
||||
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...);
|
||||
template <class... T> tuple<T&...> tie(T&...);
|
||||
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept;
|
||||
template <class... T> tuple<T&...> tie(T&...) noexcept;
|
||||
template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls);
|
||||
|
||||
// 20.4.1.4, tuple helper classes:
|
||||
@@ -83,9 +84,15 @@ template <intsize_t I, class T> class tuple_element; // undefined
|
||||
template <intsize_t I, class... T> class tuple_element<I, tuple<T...>>;
|
||||
|
||||
// 20.4.1.5, element access:
|
||||
template <intsize_t I, class... T> typename tuple_element<I, tuple<T...>>::type& get(tuple<T...>&);
|
||||
template <intsize_t I, class... T> typename tuple_element<I, tuple<T...>>::type const& get(const tuple<T...>&);
|
||||
template <intsize_t I, class... T> typename tuple_element<I, tuple<T...>>::type&& get(tuple<T...>&&);
|
||||
template <intsize_t I, class... T>
|
||||
typename tuple_element<I, tuple<T...>>::type&
|
||||
get(tuple<T...>&) noexcept;
|
||||
template <intsize_t I, class... T>
|
||||
typename tuple_element<I, tuple<T...>>::type const&
|
||||
get(const tuple<T...>&) noexcept;
|
||||
template <intsize_t I, class... T>
|
||||
typename tuple_element<I, tuple<T...>>::type&&
|
||||
get(tuple<T...>&&) noexcept;
|
||||
|
||||
// 20.4.1.6, relational operators:
|
||||
template<class... T, class... U> bool operator==(const tuple<T...>&, const tuple<U...>&);
|
||||
@@ -99,7 +106,8 @@ template <class... Types, class Alloc>
|
||||
struct uses_allocator<tuple<Types...>, Alloc>;
|
||||
|
||||
template <class... Types>
|
||||
void swap(tuple<Types...>& x, tuple<Types...>& y);
|
||||
void
|
||||
swap(tuple<Types...>& x, tuple<Types...>& y) noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -142,6 +150,7 @@ class __tuple_leaf;
|
||||
template <size_t _Ip, class _Hp, bool _Ep>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Hp>::value)
|
||||
{
|
||||
swap(__x.get(), __y.get());
|
||||
}
|
||||
@@ -256,7 +265,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int swap(__tuple_leaf& __t)
|
||||
int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
|
||||
{
|
||||
_STD::swap(*this, __t);
|
||||
return 0;
|
||||
@@ -324,7 +333,9 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY int swap(__tuple_leaf& __t)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
|
||||
{
|
||||
_STD::swap(*this, __t);
|
||||
return 0;
|
||||
@@ -338,6 +349,20 @@ template <class ..._Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __swallow(_Tp&&...) {}
|
||||
|
||||
template <bool ...> struct __all;
|
||||
|
||||
template <>
|
||||
struct __all<>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <bool _B0, bool ... _B>
|
||||
struct __all<_B0, _B...>
|
||||
{
|
||||
static const bool value = _B0 && __all<_B...>::value;
|
||||
};
|
||||
|
||||
// __tuple_impl
|
||||
|
||||
template<class _Indx, class ..._Tp> struct __tuple_impl;
|
||||
@@ -412,6 +437,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(__tuple_impl& __t)
|
||||
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||
{
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
|
||||
}
|
||||
@@ -533,7 +559,8 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(tuple& __t) {base_.swap(__t.base_);}
|
||||
void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||
{base_.swap(__t.base_);}
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -555,13 +582,19 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&, array<_U, 0>) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(tuple&) {}
|
||||
void swap(tuple&) _NOEXCEPT {}
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u) {__t.swap(__u);}
|
||||
typename enable_if
|
||||
<
|
||||
__all<__is_swappable<_Tp>::value...>::value,
|
||||
void
|
||||
>::type
|
||||
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
|
||||
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||
{__t.swap(__u);}
|
||||
|
||||
// get
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -21,24 +21,24 @@ namespace std
|
||||
class type_index
|
||||
{
|
||||
public:
|
||||
type_index(const type_info& rhs);
|
||||
type_index(const type_info& rhs) noexcept;
|
||||
|
||||
bool operator==(const type_index& rhs) const;
|
||||
bool operator!=(const type_index& rhs) const;
|
||||
bool operator< (const type_index& rhs) const;
|
||||
bool operator<=(const type_index& rhs) const;
|
||||
bool operator> (const type_index& rhs) const;
|
||||
bool operator>=(const type_index& rhs) const;
|
||||
bool operator==(const type_index& rhs) const noexcept;
|
||||
bool operator!=(const type_index& rhs) const noexcept;
|
||||
bool operator< (const type_index& rhs) const noexcept;
|
||||
bool operator<=(const type_index& rhs) const noexcept;
|
||||
bool operator> (const type_index& rhs) const noexcept;
|
||||
bool operator>=(const type_index& rhs) const noexcept;
|
||||
|
||||
size_t hash_code() const;
|
||||
const char* name() const;
|
||||
size_t hash_code() const noexcept;
|
||||
const char* name() const noexcept;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct hash<type_index>
|
||||
: public unary_function<type_index, size_t>
|
||||
{
|
||||
size_t operator()(type_index index) const;
|
||||
size_t operator()(type_index index) const noexcept;
|
||||
};
|
||||
|
||||
} // std
|
||||
@@ -58,25 +58,31 @@ class _LIBCPP_VISIBLE type_index
|
||||
const type_info* __t_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type_index(const type_info& __y) : __t_(&__y) {}
|
||||
type_index(const type_info& __y) _NOEXCEPT : __t_(&__y) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_index& __y) const {return *__t_ == *__y.__t_;}
|
||||
bool operator==(const type_index& __y) const _NOEXCEPT
|
||||
{return *__t_ == *__y.__t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_index& __y) const {return *__t_ != *__y.__t_;}
|
||||
bool operator!=(const type_index& __y) const _NOEXCEPT
|
||||
{return *__t_ != *__y.__t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator< (const type_index& __y) const {return __t_->before(*__y.__t_);}
|
||||
bool operator< (const type_index& __y) const _NOEXCEPT
|
||||
{return __t_->before(*__y.__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator<=(const type_index& __y) const {return !__y.__t_->before(*__t_);}
|
||||
bool operator<=(const type_index& __y) const _NOEXCEPT
|
||||
{return !__y.__t_->before(*__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator> (const type_index& __y) const {return __y.__t_->before(*__t_);}
|
||||
bool operator> (const type_index& __y) const _NOEXCEPT
|
||||
{return __y.__t_->before(*__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator>=(const type_index& __y) const {return !__t_->before(*__y.__t_);}
|
||||
bool operator>=(const type_index& __y) const _NOEXCEPT
|
||||
{return !__t_->before(*__y.__t_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t hash_code() const {return __t_->hash_code();}
|
||||
size_t hash_code() const _NOEXCEPT {return __t_->hash_code();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const {return __t_->name();}
|
||||
const char* name() const _NOEXCEPT {return __t_->name();}
|
||||
};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
||||
@@ -86,7 +92,8 @@ struct _LIBCPP_VISIBLE hash<type_index>
|
||||
: public unary_function<type_index, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(type_index __index) const {return __index.hash_code();}
|
||||
size_t operator()(type_index __index) const _NOEXCEPT
|
||||
{return __index.hash_code();}
|
||||
};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -22,12 +22,12 @@ class type_info
|
||||
public:
|
||||
virtual ~type_info();
|
||||
|
||||
bool operator==(const type_info& rhs) const;
|
||||
bool operator!=(const type_info& rhs) const;
|
||||
bool operator==(const type_info& rhs) const noexcept;
|
||||
bool operator!=(const type_info& rhs) const noexcept;
|
||||
|
||||
bool before(const type_info& rhs) const;
|
||||
size_t hash_code() const throw();
|
||||
const char* name() const;
|
||||
bool before(const type_info& rhs) const noexcept;
|
||||
size_t hash_code() const noexcept;
|
||||
const char* name() const noexcept;
|
||||
|
||||
type_info(const type_info& rhs) = delete;
|
||||
type_info& operator=(const type_info& rhs) = delete;
|
||||
@@ -37,20 +37,20 @@ class bad_cast
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_cast() throw();
|
||||
bad_cast(const bad_cast&) throw();
|
||||
bad_cast& operator=(const bad_cast&) throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_cast() noexcept;
|
||||
bad_cast(const bad_cast&) noexcept;
|
||||
bad_cast& operator=(const bad_cast&) noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
};
|
||||
|
||||
class bad_typeid
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_typeid() throw();
|
||||
bad_typeid(const bad_typeid&) throw();
|
||||
bad_typeid& operator=(const bad_typeid&) throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_typeid() noexcept;
|
||||
bad_typeid(const bad_typeid&) noexcept;
|
||||
bad_typeid& operator=(const bad_typeid&) noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
};
|
||||
|
||||
} // std
|
||||
@@ -81,20 +81,20 @@ public:
|
||||
virtual ~type_info();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const {return __type_name;}
|
||||
const char* name() const _NOEXCEPT {return __type_name;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool before(const type_info& __arg) const
|
||||
bool before(const type_info& __arg) const _NOEXCEPT
|
||||
{return __type_name < __arg.__type_name;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t hash_code() const throw()
|
||||
size_t hash_code() const _NOEXCEPT
|
||||
{return *reinterpret_cast<const size_t*>(&__type_name);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_info& __arg) const
|
||||
bool operator==(const type_info& __arg) const _NOEXCEPT
|
||||
{return __type_name == __arg.__type_name;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_info& __arg) const
|
||||
bool operator!=(const type_info& __arg) const _NOEXCEPT
|
||||
{return !operator==(__arg);}
|
||||
|
||||
};
|
||||
@@ -103,18 +103,18 @@ class _LIBCPP_EXCEPTION_ABI bad_cast
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_cast() throw();
|
||||
virtual ~bad_cast() throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_cast() _NOEXCEPT;
|
||||
virtual ~bad_cast() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_typeid
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_typeid() throw();
|
||||
virtual ~bad_typeid() throw();
|
||||
virtual const char* what() const throw();
|
||||
bad_typeid() _NOEXCEPT;
|
||||
virtual ~bad_typeid() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
} // std
|
||||
|
@@ -44,7 +44,12 @@ public:
|
||||
typedef /unspecified/ local_iterator;
|
||||
typedef /unspecified/ const_local_iterator;
|
||||
|
||||
explicit unordered_map(size_type n = 0, const hasher& hf = hasher(),
|
||||
unordered_map()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<hasher>::value &&
|
||||
is_nothrow_default_constructible<key_equal>::value &&
|
||||
is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit unordered_map(size_type n, const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
template <class InputIterator>
|
||||
@@ -55,28 +60,37 @@ public:
|
||||
explicit unordered_map(const allocator_type&);
|
||||
unordered_map(const unordered_map&);
|
||||
unordered_map(const unordered_map&, const Allocator&);
|
||||
unordered_map(unordered_map&&);
|
||||
unordered_map(unordered_map&&)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value &&
|
||||
is_nothrow_move_constructible<allocator_type>::value);
|
||||
unordered_map(unordered_map&&, const Allocator&);
|
||||
unordered_map(initializer_list<value_type>, size_type n = 0,
|
||||
const hasher& hf = hasher(), const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
~unordered_map();
|
||||
unordered_map& operator=(const unordered_map&);
|
||||
unordered_map& operator=(unordered_map&&);
|
||||
unordered_map& operator=(unordered_map&&)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value);
|
||||
unordered_map& operator=(initializer_list<value_type>);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
iterator end();
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
iterator begin() noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
template <class... Args>
|
||||
pair<iterator, bool> emplace(Args&&... args);
|
||||
@@ -95,9 +109,14 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(unordered_map&);
|
||||
void swap(unordered_map&)
|
||||
noexcept(
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value) &&
|
||||
__is_nothrow_swappable<hasher>::value &&
|
||||
__is_nothrow_swappable<key_equal>::value);
|
||||
|
||||
hasher hash_function() const;
|
||||
key_equal key_eq() const;
|
||||
@@ -114,8 +133,8 @@ public:
|
||||
mapped_type& at(const key_type& k);
|
||||
const mapped_type& at(const key_type& k) const;
|
||||
|
||||
size_type bucket_count() const;
|
||||
size_type max_bucket_count() const;
|
||||
size_type bucket_count() const noexcept;
|
||||
size_type max_bucket_count() const noexcept;
|
||||
|
||||
size_type bucket_size(size_type n) const;
|
||||
size_type bucket(const key_type& k) const;
|
||||
@@ -127,8 +146,8 @@ public:
|
||||
const_local_iterator cbegin(size_type n) const;
|
||||
const_local_iterator cend(size_type n) const;
|
||||
|
||||
float load_factor() const;
|
||||
float max_load_factor() const;
|
||||
float load_factor() const noexcept;
|
||||
float max_load_factor() const noexcept;
|
||||
void max_load_factor(float z);
|
||||
void rehash(size_type n);
|
||||
void reserve(size_type n);
|
||||
@@ -136,7 +155,8 @@ public:
|
||||
|
||||
template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
void swap(unordered_map<Key, T, Hash, Pred, Alloc>& x,
|
||||
unordered_map<Key, T, Hash, Pred, Alloc>& y);
|
||||
unordered_map<Key, T, Hash, Pred, Alloc>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
bool
|
||||
@@ -172,7 +192,12 @@ public:
|
||||
typedef /unspecified/ local_iterator;
|
||||
typedef /unspecified/ const_local_iterator;
|
||||
|
||||
explicit unordered_multimap(size_type n = 0, const hasher& hf = hasher(),
|
||||
unordered_multimap()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<hasher>::value &&
|
||||
is_nothrow_default_constructible<key_equal>::value &&
|
||||
is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit unordered_multimap(size_type n, const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
template <class InputIterator>
|
||||
@@ -183,28 +208,37 @@ public:
|
||||
explicit unordered_multimap(const allocator_type&);
|
||||
unordered_multimap(const unordered_multimap&);
|
||||
unordered_multimap(const unordered_multimap&, const Allocator&);
|
||||
unordered_multimap(unordered_multimap&&);
|
||||
unordered_multimap(unordered_multimap&&)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value &&
|
||||
is_nothrow_move_constructible<allocator_type>::value);
|
||||
unordered_multimap(unordered_multimap&&, const Allocator&);
|
||||
unordered_multimap(initializer_list<value_type>, size_type n = 0,
|
||||
const hasher& hf = hasher(), const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
~unordered_multimap();
|
||||
unordered_multimap& operator=(const unordered_multimap&);
|
||||
unordered_multimap& operator=(unordered_multimap&&);
|
||||
unordered_multimap& operator=(unordered_multimap&&)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value);
|
||||
unordered_multimap& operator=(initializer_list<value_type>);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
iterator end();
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
iterator begin() noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
template <class... Args>
|
||||
iterator emplace(Args&&... args);
|
||||
@@ -223,9 +257,14 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(unordered_multimap&);
|
||||
void swap(unordered_multimap&)
|
||||
noexcept(
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value) &&
|
||||
__is_nothrow_swappable<hasher>::value &&
|
||||
__is_nothrow_swappable<key_equal>::value);
|
||||
|
||||
hasher hash_function() const;
|
||||
key_equal key_eq() const;
|
||||
@@ -236,8 +275,8 @@ public:
|
||||
pair<iterator, iterator> equal_range(const key_type& k);
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
||||
|
||||
size_type bucket_count() const;
|
||||
size_type max_bucket_count() const;
|
||||
size_type bucket_count() const noexcept;
|
||||
size_type max_bucket_count() const noexcept;
|
||||
|
||||
size_type bucket_size(size_type n) const;
|
||||
size_type bucket(const key_type& k) const;
|
||||
@@ -249,8 +288,8 @@ public:
|
||||
const_local_iterator cbegin(size_type n) const;
|
||||
const_local_iterator cend(size_type n) const;
|
||||
|
||||
float load_factor() const;
|
||||
float max_load_factor() const;
|
||||
float load_factor() const noexcept;
|
||||
float max_load_factor() const noexcept;
|
||||
void max_load_factor(float z);
|
||||
void rehash(size_type n);
|
||||
void reserve(size_type n);
|
||||
@@ -258,7 +297,8 @@ public:
|
||||
|
||||
template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
void swap(unordered_multimap<Key, T, Hash, Pred, Alloc>& x,
|
||||
unordered_multimap<Key, T, Hash, Pred, Alloc>& y);
|
||||
unordered_multimap<Key, T, Hash, Pred, Alloc>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
bool
|
||||
@@ -289,11 +329,15 @@ class __unordered_map_hasher
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher() : _Hash() {}
|
||||
__unordered_map_hasher()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Hash>::value)
|
||||
: _Hash() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher(const _Hash& __h) : _Hash(__h) {}
|
||||
__unordered_map_hasher(const _Hash& __h)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Hash>::value)
|
||||
: _Hash(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Hash& hash_function() const {return *this;}
|
||||
const _Hash& hash_function() const _NOEXCEPT {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x.first);}
|
||||
@@ -308,11 +352,15 @@ class __unordered_map_hasher<_Tp, _Hash, false>
|
||||
_Hash __hash_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher() : __hash_() {}
|
||||
__unordered_map_hasher()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Hash>::value)
|
||||
: __hash_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher(const _Hash& __h) : __hash_(__h) {}
|
||||
__unordered_map_hasher(const _Hash& __h)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Hash>::value)
|
||||
: __hash_(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Hash& hash_function() const {return __hash_;}
|
||||
const _Hash& hash_function() const _NOEXCEPT {return __hash_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return __hash_(__x.first);}
|
||||
@@ -327,11 +375,15 @@ class __unordered_map_equal
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal() : _Pred() {}
|
||||
__unordered_map_equal()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Pred>::value)
|
||||
: _Pred() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal(const _Pred& __p) : _Pred(__p) {}
|
||||
__unordered_map_equal(const _Pred& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Pred>::value)
|
||||
: _Pred(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Pred& key_eq() const {return *this;}
|
||||
const _Pred& key_eq() const _NOEXCEPT {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
|
||||
@@ -353,11 +405,15 @@ class __unordered_map_equal<_Tp, _Pred, false>
|
||||
_Pred __pred_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal() : __pred_() {}
|
||||
__unordered_map_equal()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Pred>::value)
|
||||
: __pred_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal(const _Pred& __p) : __pred_(__p) {}
|
||||
__unordered_map_equal(const _Pred& __p)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Pred>::value)
|
||||
: __pred_(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Pred& key_eq() const {return __pred_;}
|
||||
const _Pred& key_eq() const _NOEXCEPT {return __pred_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __pred_(__x.first, __y.first);}
|
||||
@@ -394,7 +450,7 @@ public:
|
||||
bool __second_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_map_node_destructor(allocator_type& __na)
|
||||
explicit __hash_map_node_destructor(allocator_type& __na) _NOEXCEPT
|
||||
: __na_(__na),
|
||||
__first_constructed(false),
|
||||
__second_constructed(false)
|
||||
@@ -403,6 +459,7 @@ public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
|
||||
_NOEXCEPT
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
__second_constructed(__x.__value_constructed)
|
||||
@@ -421,7 +478,7 @@ public:
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
void operator()(pointer __p) _NOEXCEPT
|
||||
{
|
||||
if (__second_constructed)
|
||||
__alloc_traits::destroy(__na_, _STD::addressof(__p->__value_.second));
|
||||
@@ -454,10 +511,10 @@ public:
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator() {}
|
||||
__hash_map_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
__hash_map_iterator(_HashIterator __i) _NOEXCEPT : __i_(__i) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return *operator->();}
|
||||
@@ -510,13 +567,14 @@ public:
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator() {}
|
||||
__hash_map_const_iterator() _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
__hash_map_const_iterator(_HashIterator __i) _NOEXCEPT : __i_(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(
|
||||
__hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
|
||||
_NOEXCEPT
|
||||
: __i_(__i.__i_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -599,7 +657,9 @@ public:
|
||||
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_map() {} // = default;
|
||||
unordered_map()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
|
||||
{} // = default;
|
||||
explicit unordered_map(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
unordered_map(size_type __n, const hasher& __hf,
|
||||
@@ -620,7 +680,8 @@ public:
|
||||
unordered_map(const unordered_map& __u);
|
||||
unordered_map(const unordered_map& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_map(unordered_map&& __u);
|
||||
unordered_map(unordered_map&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_map(unordered_map&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_map(initializer_list<value_type> __il);
|
||||
@@ -632,33 +693,34 @@ public:
|
||||
// ~unordered_map() = default;
|
||||
// unordered_map& operator=(const unordered_map& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_map& operator=(unordered_map&& __u);
|
||||
unordered_map& operator=(unordered_map&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
unordered_map& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
iterator end() _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -733,10 +795,12 @@ public:
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
void clear() _NOEXCEPT {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_map& __u) {__table_.swap(__u.__table_);}
|
||||
void swap(unordered_map& __u)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__table>::value)
|
||||
{__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const
|
||||
@@ -767,9 +831,9 @@ public:
|
||||
const mapped_type& at(const key_type& __k) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const
|
||||
@@ -791,9 +855,9 @@ public:
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
float load_factor() const _NOEXCEPT {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -895,6 +959,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
unordered_map&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
@@ -949,6 +1014,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
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_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
@@ -1111,6 +1177,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
@@ -1193,7 +1260,9 @@ public:
|
||||
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multimap() {} // = default
|
||||
unordered_multimap()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
|
||||
{} // = default;
|
||||
explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
unordered_multimap(size_type __n, const hasher& __hf,
|
||||
@@ -1214,7 +1283,8 @@ public:
|
||||
unordered_multimap(const unordered_multimap& __u);
|
||||
unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multimap(unordered_multimap&& __u);
|
||||
unordered_multimap(unordered_multimap&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multimap(initializer_list<value_type> __il);
|
||||
@@ -1227,33 +1297,34 @@ public:
|
||||
// ~unordered_multimap() = default;
|
||||
// unordered_multimap& operator=(const unordered_multimap& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multimap& operator=(unordered_multimap&& __u);
|
||||
unordered_multimap& operator=(unordered_multimap&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
unordered_multimap& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
iterator end() _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1324,10 +1395,12 @@ public:
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
void clear() _NOEXCEPT {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_multimap& __u) {__table_.swap(__u.__table_);}
|
||||
void swap(unordered_multimap& __u)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__table>::value)
|
||||
{__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const
|
||||
@@ -1350,9 +1423,10 @@ public:
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
size_type max_bucket_count() const _NOEXCEPT
|
||||
{return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const
|
||||
@@ -1374,9 +1448,9 @@ public:
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
float load_factor() const _NOEXCEPT {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1474,6 +1548,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
unordered_multimap&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
@@ -1530,6 +1605,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
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_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
@@ -1637,6 +1713,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -43,7 +43,12 @@ public:
|
||||
typedef /unspecified/ local_iterator;
|
||||
typedef /unspecified/ const_local_iterator;
|
||||
|
||||
explicit unordered_set(size_type n = 0, const hasher& hf = hasher(),
|
||||
unordered_set()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<hasher>::value &&
|
||||
is_nothrow_default_constructible<key_equal>::value &&
|
||||
is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit unordered_set(size_type n, const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
template <class InputIterator>
|
||||
@@ -54,28 +59,37 @@ public:
|
||||
explicit unordered_set(const allocator_type&);
|
||||
unordered_set(const unordered_set&);
|
||||
unordered_set(const unordered_set&, const Allocator&);
|
||||
unordered_set(unordered_set&&);
|
||||
unordered_set(unordered_set&&)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value &&
|
||||
is_nothrow_move_constructible<allocator_type>::value);
|
||||
unordered_set(unordered_set&&, const Allocator&);
|
||||
unordered_set(initializer_list<value_type>, size_type n = 0,
|
||||
const hasher& hf = hasher(), const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
~unordered_set();
|
||||
unordered_set& operator=(const unordered_set&);
|
||||
unordered_set& operator=(unordered_set&&);
|
||||
unordered_set& operator=(unordered_set&&)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value);
|
||||
unordered_set& operator=(initializer_list<value_type>);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
iterator end();
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
iterator begin() noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
template <class... Args>
|
||||
pair<iterator, bool> emplace(Args&&... args);
|
||||
@@ -92,9 +106,14 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(unordered_set&);
|
||||
void swap(unordered_set&)
|
||||
noexcept(
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value) &&
|
||||
__is_nothrow_swappable<hasher>::value &&
|
||||
__is_nothrow_swappable<key_equal>::value);
|
||||
|
||||
hasher hash_function() const;
|
||||
key_equal key_eq() const;
|
||||
@@ -105,8 +124,8 @@ public:
|
||||
pair<iterator, iterator> equal_range(const key_type& k);
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
||||
|
||||
size_type bucket_count() const;
|
||||
size_type max_bucket_count() const;
|
||||
size_type bucket_count() const noexcept;
|
||||
size_type max_bucket_count() const noexcept;
|
||||
|
||||
size_type bucket_size(size_type n) const;
|
||||
size_type bucket(const key_type& k) const;
|
||||
@@ -118,8 +137,8 @@ public:
|
||||
const_local_iterator cbegin(size_type n) const;
|
||||
const_local_iterator cend(size_type n) const;
|
||||
|
||||
float load_factor() const;
|
||||
float max_load_factor() const;
|
||||
float load_factor() const noexcept;
|
||||
float max_load_factor() const noexcept;
|
||||
void max_load_factor(float z);
|
||||
void rehash(size_type n);
|
||||
void reserve(size_type n);
|
||||
@@ -127,7 +146,8 @@ public:
|
||||
|
||||
template <class Value, class Hash, class Pred, class Alloc>
|
||||
void swap(unordered_set<Value, Hash, Pred, Alloc>& x,
|
||||
unordered_set<Value, Hash, Pred, Alloc>& y);
|
||||
unordered_set<Value, Hash, Pred, Alloc>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class Value, class Hash, class Pred, class Alloc>
|
||||
bool
|
||||
@@ -162,7 +182,12 @@ public:
|
||||
typedef /unspecified/ local_iterator;
|
||||
typedef /unspecified/ const_local_iterator;
|
||||
|
||||
explicit unordered_multiset(size_type n = 0, const hasher& hf = hasher(),
|
||||
unordered_multiset()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<hasher>::value &&
|
||||
is_nothrow_default_constructible<key_equal>::value &&
|
||||
is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit unordered_multiset(size_type n, const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
template <class InputIterator>
|
||||
@@ -173,28 +198,37 @@ public:
|
||||
explicit unordered_multiset(const allocator_type&);
|
||||
unordered_multiset(const unordered_multiset&);
|
||||
unordered_multiset(const unordered_multiset&, const Allocator&);
|
||||
unordered_multiset(unordered_multiset&&);
|
||||
unordered_multiset(unordered_multiset&&)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<hasher>::value &&
|
||||
is_nothrow_move_constructible<key_equal>::value &&
|
||||
is_nothrow_move_constructible<allocator_type>::value);
|
||||
unordered_multiset(unordered_multiset&&, const Allocator&);
|
||||
unordered_multiset(initializer_list<value_type>, size_type n = /see below/,
|
||||
const hasher& hf = hasher(), const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
~unordered_multiset();
|
||||
unordered_multiset& operator=(const unordered_multiset&);
|
||||
unordered_multiset& operator=(unordered_multiset&&);
|
||||
unordered_multiset& operator=(unordered_multiset&&)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<hasher>::value &&
|
||||
is_nothrow_move_assignable<key_equal>::value);
|
||||
unordered_multiset& operator=(initializer_list<value_type>);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
iterator end();
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
iterator begin() noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
|
||||
template <class... Args>
|
||||
iterator emplace(Args&&... args);
|
||||
@@ -211,9 +245,14 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void swap(unordered_multiset&);
|
||||
void swap(unordered_multiset&)
|
||||
noexcept(
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value) &&
|
||||
__is_nothrow_swappable<hasher>::value &&
|
||||
__is_nothrow_swappable<key_equal>::value);
|
||||
|
||||
hasher hash_function() const;
|
||||
key_equal key_eq() const;
|
||||
@@ -224,8 +263,8 @@ public:
|
||||
pair<iterator, iterator> equal_range(const key_type& k);
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
||||
|
||||
size_type bucket_count() const;
|
||||
size_type max_bucket_count() const;
|
||||
size_type bucket_count() const noexcept;
|
||||
size_type max_bucket_count() const noexcept;
|
||||
|
||||
size_type bucket_size(size_type n) const;
|
||||
size_type bucket(const key_type& k) const;
|
||||
@@ -237,8 +276,8 @@ public:
|
||||
const_local_iterator cbegin(size_type n) const;
|
||||
const_local_iterator cend(size_type n) const;
|
||||
|
||||
float load_factor() const;
|
||||
float max_load_factor() const;
|
||||
float load_factor() const noexcept;
|
||||
float max_load_factor() const noexcept;
|
||||
void max_load_factor(float z);
|
||||
void rehash(size_type n);
|
||||
void reserve(size_type n);
|
||||
@@ -246,7 +285,8 @@ public:
|
||||
|
||||
template <class Value, class Hash, class Pred, class Alloc>
|
||||
void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x,
|
||||
unordered_multiset<Value, Hash, Pred, Alloc>& y);
|
||||
unordered_multiset<Value, Hash, Pred, Alloc>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
template <class Value, class Hash, class Pred, class Alloc>
|
||||
bool
|
||||
@@ -300,7 +340,9 @@ public:
|
||||
typedef typename __table::const_local_iterator const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set() {} // = default;
|
||||
unordered_set()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
|
||||
{} // = default;
|
||||
explicit unordered_set(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql,
|
||||
@@ -319,7 +361,8 @@ public:
|
||||
unordered_set(const unordered_set& __u);
|
||||
unordered_set(const unordered_set& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_set(unordered_set&& __u);
|
||||
unordered_set(unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_set(unordered_set&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_set(initializer_list<value_type> __il);
|
||||
@@ -332,33 +375,34 @@ public:
|
||||
// ~unordered_set() = default;
|
||||
// unordered_set& operator=(const unordered_set& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_set& operator=(unordered_set&& __u);
|
||||
unordered_set& operator=(unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
unordered_set& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
iterator end() _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
template <class... _Args>
|
||||
@@ -400,10 +444,12 @@ public:
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
void clear() _NOEXCEPT {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_set& __u) {__table_.swap(__u.__table_);}
|
||||
void swap(unordered_set& __u)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__table>::value)
|
||||
{__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const {return __table_.hash_function();}
|
||||
@@ -424,9 +470,9 @@ public:
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
@@ -447,9 +493,9 @@ public:
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
float load_factor() const _NOEXCEPT {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -536,6 +582,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
@@ -588,6 +635,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>&
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
|
||||
{
|
||||
__table_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
@@ -621,6 +669,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
@@ -684,7 +733,9 @@ public:
|
||||
typedef typename __table::const_local_iterator const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multiset() {} // = default
|
||||
unordered_multiset()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
|
||||
{} // = default
|
||||
explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
unordered_multiset(size_type __n, const hasher& __hf,
|
||||
@@ -703,7 +754,8 @@ public:
|
||||
unordered_multiset(const unordered_multiset& __u);
|
||||
unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multiset(unordered_multiset&& __u);
|
||||
unordered_multiset(unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
|
||||
unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multiset(initializer_list<value_type> __il);
|
||||
@@ -716,33 +768,34 @@ public:
|
||||
// ~unordered_multiset() = default;
|
||||
// unordered_multiset& operator=(const unordered_multiset& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
unordered_multiset& operator=(unordered_multiset&& __u);
|
||||
unordered_multiset& operator=(unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
|
||||
#endif
|
||||
unordered_multiset& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
size_type max_size() const _NOEXCEPT {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
iterator begin() _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
iterator end() _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
const_iterator begin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
const_iterator end() const _NOEXCEPT {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
const_iterator cbegin() const _NOEXCEPT {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
template <class... _Args>
|
||||
@@ -782,10 +835,12 @@ public:
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
void clear() _NOEXCEPT {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_multiset& __u) {__table_.swap(__u.__table_);}
|
||||
void swap(unordered_multiset& __u)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__table>::value)
|
||||
{__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const {return __table_.hash_function();}
|
||||
@@ -806,9 +861,9 @@ public:
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
size_type max_bucket_count() const _NOEXCEPT {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
@@ -829,9 +884,9 @@ public:
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
float load_factor() const _NOEXCEPT {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
float max_load_factor() const _NOEXCEPT {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -919,6 +974,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
{
|
||||
}
|
||||
@@ -972,6 +1028,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
unordered_multiset&& __u)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
|
||||
{
|
||||
__table_ = _STD::move(__u.__table_);
|
||||
return *this;
|
||||
@@ -1005,6 +1062,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
102
include/utility
102
include/utility
@@ -29,11 +29,19 @@ namespace rel_ops
|
||||
template<class T> bool operator>=(const T&, const T&);
|
||||
}
|
||||
|
||||
template<class T> void swap(T& a, T& b);
|
||||
template <class T, size_t N> void swap(T (&a)[N], T (&b)[N]);
|
||||
template<class T>
|
||||
void
|
||||
swap(T& a, T& b) noexcept(is_nothrow_move_constructible<T>::value &&
|
||||
is_nothrow_move_assignable<T>::value);
|
||||
|
||||
template <class T, class U> T&& forward(U&&);
|
||||
template <class T> typename remove_reference<T>::type&& move(T&&);
|
||||
template <class T, size_t N>
|
||||
void
|
||||
swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));
|
||||
|
||||
template <class T> T&& forward(typename remove_reference<T>::type& t) noexcept;
|
||||
template <class T> T&& forward(typename remove_reference<T>::type&& t) noexcept;
|
||||
|
||||
template <class T> typename remove_reference<T>::type&& move(T&&) noexcept;
|
||||
|
||||
template <class T>
|
||||
typename conditional
|
||||
@@ -42,7 +50,7 @@ template <class T>
|
||||
const T&,
|
||||
T&&
|
||||
>::type
|
||||
move_if_noexcept(T& x);
|
||||
move_if_noexcept(T& x) noexcept;
|
||||
|
||||
template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
|
||||
|
||||
@@ -56,6 +64,7 @@ struct pair
|
||||
T2 second;
|
||||
|
||||
pair(const pair&) = default;
|
||||
pair(pair&&) = default;
|
||||
constexpr pair();
|
||||
pair(const T1& x, const T2& y);
|
||||
template <class U, class V> pair(U&& x, V&& y);
|
||||
@@ -66,10 +75,12 @@ struct pair
|
||||
tuple<Args2...> second_args);
|
||||
|
||||
template <class U, class V> pair& operator=(const pair<U, V>& p);
|
||||
pair& operator=(pair&& p);
|
||||
pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable<T1>::value &&
|
||||
is_nothrow_move_assignable<T2>::value);
|
||||
template <class U, class V> pair& operator=(pair<U, V>&& p);
|
||||
|
||||
void swap(pair& p);
|
||||
void swap(pair& p) noexcept(noexcept(swap(first, p.first)) &&
|
||||
noexcept(swap(second, p.second)));
|
||||
};
|
||||
|
||||
template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&);
|
||||
@@ -80,7 +91,9 @@ template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,
|
||||
template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&);
|
||||
|
||||
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);
|
||||
template <class T1, class T2> void swap(pair<T1, T2>& x, pair<T1, T2>& y);
|
||||
template <class T1, class T2>
|
||||
void
|
||||
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
|
||||
|
||||
struct piecewise_construct_t { };
|
||||
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
|
||||
@@ -94,15 +107,15 @@ template <class T1, class T2> struct tuple_element<1, std::pair<T1, T2> >;
|
||||
|
||||
template<size_t I, class T1, class T2>
|
||||
typename tuple_element<I, std::pair<T1, T2> >::type&
|
||||
get(std::pair<T1, T2>&);
|
||||
get(std::pair<T1, T2>&) noexcept;
|
||||
|
||||
template<size_t I, class T1, class T2>
|
||||
const typename const tuple_element<I, std::pair<T1, T2> >::type&
|
||||
get(const std::pair<T1, T2>&);
|
||||
get(const std::pair<T1, T2>&) noexcept;
|
||||
|
||||
template<size_t I, class T1, class T2>
|
||||
typename tuple_element<I, std::pair<T1, T2> >::type&&
|
||||
get(std::pair<T1, T2>&&);
|
||||
get(std::pair<T1, T2>&&) noexcept;
|
||||
|
||||
} // std
|
||||
|
||||
@@ -168,7 +181,7 @@ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardItera
|
||||
template<class _Tp, size_t _N>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(_Tp (&__a)[_N], _Tp (&__b)[_N])
|
||||
swap(_Tp (&__a)[_N], _Tp (&__b)[_N]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{
|
||||
_STD::swap_ranges(__a, __a + _N, __b);
|
||||
}
|
||||
@@ -185,7 +198,7 @@ typename conditional
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
const _Tp&
|
||||
#endif
|
||||
move_if_noexcept(_Tp& __x)
|
||||
move_if_noexcept(_Tp& __x) _NOEXCEPT
|
||||
{
|
||||
return _STD::move(__x);
|
||||
}
|
||||
@@ -194,9 +207,6 @@ struct _LIBCPP_VISIBLE piecewise_construct_t { };
|
||||
//constexpr
|
||||
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
|
||||
|
||||
template <class _T1, class _T2> struct pair;
|
||||
template <class _T1, class _T2> void swap(pair<_T1, _T2>&, pair<_T1, _T2>&);
|
||||
|
||||
template <class _T1, class _T2>
|
||||
struct _LIBCPP_VISIBLE pair
|
||||
{
|
||||
@@ -206,6 +216,9 @@ struct _LIBCPP_VISIBLE pair
|
||||
_T1 first;
|
||||
_T2 second;
|
||||
|
||||
// pair(const pair&) = default;
|
||||
// pair(pair&&) = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY pair() : first(), second() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
|
||||
@@ -218,6 +231,14 @@ struct _LIBCPP_VISIBLE pair
|
||||
is_convertible<_U2, _T2>::value>::type* = 0)
|
||||
: first(__p.first), second(__p.second) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair& operator=(const pair& __p)
|
||||
{
|
||||
first = __p.first;
|
||||
second = __p.second;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _U1, class _U2,
|
||||
@@ -237,6 +258,16 @@ struct _LIBCPP_VISIBLE pair
|
||||
: 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 = _STD::forward<first_type>(__p.first);
|
||||
second = _STD::forward<second_type>(__p.second);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template<class _Tuple,
|
||||
@@ -277,7 +308,14 @@ struct _LIBCPP_VISIBLE pair
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void _LIBCPP_INLINE_VISIBILITY swap(pair& __p) {_STD::swap(*this, __p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
|
||||
__is_nothrow_swappable<second_type>::value)
|
||||
{
|
||||
_STD::iter_swap(&first, &__p.first);
|
||||
_STD::iter_swap(&second, &__p.second);
|
||||
}
|
||||
private:
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -339,11 +377,17 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
|
||||
|
||||
template <class _T1, class _T2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
typename enable_if
|
||||
<
|
||||
__is_swappable<_T1>::value &&
|
||||
__is_swappable<_T2>::value,
|
||||
void
|
||||
>::type
|
||||
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
|
||||
_NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
|
||||
__is_nothrow_swappable<_T2>::value))
|
||||
{
|
||||
swap(__x.first, __y.first);
|
||||
swap(__x.second, __y.second);
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -436,13 +480,13 @@ struct __get_pair<0>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_T1&
|
||||
get(pair<_T1, _T2>& __p) {return __p.first;}
|
||||
get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
|
||||
|
||||
template <class _T1, class _T2>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _T1&
|
||||
get(const pair<_T1, _T2>& __p) {return __p.first;}
|
||||
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -450,7 +494,7 @@ struct __get_pair<0>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_T1&&
|
||||
get(pair<_T1, _T2>&& __p) {return _STD::forward<_T1>(__p.first);}
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _STD::forward<_T1>(__p.first);}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
};
|
||||
@@ -462,13 +506,13 @@ struct __get_pair<1>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_T2&
|
||||
get(pair<_T1, _T2>& __p) {return __p.second;}
|
||||
get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
|
||||
|
||||
template <class _T1, class _T2>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _T2&
|
||||
get(const pair<_T1, _T2>& __p) {return __p.second;}
|
||||
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
@@ -476,7 +520,7 @@ struct __get_pair<1>
|
||||
static
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_T2&&
|
||||
get(pair<_T1, _T2>&& __p) {return _STD::forward<_T2>(__p.second);}
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _STD::forward<_T2>(__p.second);}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
};
|
||||
@@ -484,7 +528,7 @@ struct __get_pair<1>
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(pair<_T1, _T2>& __p)
|
||||
get(pair<_T1, _T2>& __p) _NOEXCEPT
|
||||
{
|
||||
return __get_pair<_Ip>::get(__p);
|
||||
}
|
||||
@@ -492,7 +536,7 @@ get(pair<_T1, _T2>& __p)
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(const pair<_T1, _T2>& __p)
|
||||
get(const pair<_T1, _T2>& __p) _NOEXCEPT
|
||||
{
|
||||
return __get_pair<_Ip>::get(__p);
|
||||
}
|
||||
@@ -502,7 +546,7 @@ get(const pair<_T1, _T2>& __p)
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(pair<_T1, _T2>&& __p)
|
||||
get(pair<_T1, _T2>&& __p) _NOEXCEPT
|
||||
{
|
||||
return __get_pair<_Ip>::get(_STD::move(__p));
|
||||
}
|
||||
|
493
include/vector
493
include/vector
@@ -34,47 +34,53 @@ public:
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
explicit vector(const allocator_type& = allocator_type());
|
||||
vector()
|
||||
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit vector(const allocator_type&);
|
||||
explicit vector(size_type n);
|
||||
vector(size_type n, const value_type& value, const allocator_type& = allocator_type());
|
||||
template <class InputIterator>
|
||||
vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
|
||||
vector(const vector& x);
|
||||
vector(vector&& x);
|
||||
vector(vector&& x)
|
||||
noexcept(is_nothrow_move_constructible<allocator_type>::value);
|
||||
vector(initializer_list<value_type> il);
|
||||
vector(initializer_list<value_type> il, const allocator_type& a);
|
||||
~vector();
|
||||
vector& operator=(const vector& x);
|
||||
vector& operator=(vector&& x);
|
||||
vector& operator=(vector&& x)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
vector& operator=(initializer_list<value_type> il);
|
||||
template <class InputIterator>
|
||||
void assign(InputIterator first, InputIterator last);
|
||||
void assign(size_type n, const value_type& u);
|
||||
void assign(initializer_list<value_type> il);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
size_type capacity() const;
|
||||
bool empty() const;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
size_type capacity() const noexcept;
|
||||
bool empty() const noexcept;
|
||||
void reserve(size_type n);
|
||||
void shrink_to_fit();
|
||||
void shrink_to_fit() noexcept;
|
||||
|
||||
reference operator[](size_type n);
|
||||
const_reference operator[](size_type n) const;
|
||||
@@ -86,8 +92,8 @@ public:
|
||||
reference back();
|
||||
const_reference back() const;
|
||||
|
||||
value_type* data();
|
||||
const value_type* data() const;
|
||||
value_type* data() noexcept;
|
||||
const value_type* data() const noexcept;
|
||||
|
||||
void push_back(const value_type& x);
|
||||
void push_back(value_type&& x);
|
||||
@@ -106,12 +112,14 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void resize(size_type sz);
|
||||
void resize(size_type sz, const value_type& c);
|
||||
|
||||
void swap(vector&);
|
||||
void swap(vector&)
|
||||
noexcept(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
|
||||
bool __invariants() const;
|
||||
};
|
||||
@@ -134,62 +142,68 @@ public:
|
||||
class reference
|
||||
{
|
||||
public:
|
||||
reference(const reference&);
|
||||
operator bool() const;
|
||||
reference& operator=(const bool x);
|
||||
reference& operator=(const reference& x);
|
||||
iterator operator&() const;
|
||||
void flip();
|
||||
reference(const reference&) noexcept;
|
||||
operator bool() const noexcept;
|
||||
reference& operator=(const bool x) noexcept;
|
||||
reference& operator=(const reference& x) noexcept;
|
||||
iterator operator&() const noexcept;
|
||||
void flip() noexcept;
|
||||
};
|
||||
|
||||
class const_reference
|
||||
{
|
||||
public:
|
||||
const_reference(const reference&);
|
||||
operator bool() const;
|
||||
const_iterator operator&() const;
|
||||
const_reference(const reference&) noexcept;
|
||||
operator bool() const noexcept;
|
||||
const_iterator operator&() const noexcept;
|
||||
};
|
||||
|
||||
vector()
|
||||
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||
explicit vector(const allocator_type& = allocator_type());
|
||||
explicit vector(size_type n, const value_type& value = value_type(), const allocator_type& = allocator_type());
|
||||
template <class InputIterator>
|
||||
vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());
|
||||
vector(const vector& x);
|
||||
vector(vector&& x);
|
||||
vector(vector&& x)
|
||||
noexcept(is_nothrow_move_constructible<allocator_type>::value);
|
||||
vector(initializer_list<value_type> il);
|
||||
vector(initializer_list<value_type> il, const allocator_type& a);
|
||||
~vector();
|
||||
vector& operator=(const vector& x);
|
||||
vector& operator=(vector&& x);
|
||||
vector& operator=(vector&& x)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
vector& operator=(initializer_list<value_type> il);
|
||||
template <class InputIterator>
|
||||
void assign(InputIterator first, InputIterator last);
|
||||
void assign(size_type n, const value_type& u);
|
||||
void assign(initializer_list<value_type> il);
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
allocator_type get_allocator() const noexcept;
|
||||
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
size_type capacity() const;
|
||||
bool empty() const;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
size_type capacity() const noexcept;
|
||||
bool empty() const noexcept;
|
||||
void reserve(size_type n);
|
||||
void shrink_to_fit();
|
||||
void shrink_to_fit() noexcept;
|
||||
|
||||
reference operator[](size_type n);
|
||||
const_reference operator[](size_type n) const;
|
||||
@@ -213,13 +227,15 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
|
||||
void clear();
|
||||
void clear() noexcept;
|
||||
|
||||
void resize(size_type sz);
|
||||
void resize(size_type sz, value_type x);
|
||||
|
||||
void swap(vector&);
|
||||
void flip();
|
||||
void swap(vector&)
|
||||
noexcept(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
void flip() noexcept;
|
||||
|
||||
bool __invariants() const;
|
||||
};
|
||||
@@ -233,7 +249,9 @@ template <class T, class Allocator> bool operator> (const vector<T,Allocator>& x
|
||||
template <class T, class Allocator> bool operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y);
|
||||
template <class T, class Allocator> bool operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y);
|
||||
|
||||
template <class T, class Allocator> void swap(vector<T,Allocator>& x, vector<T,Allocator>& y);
|
||||
template <class T, class Allocator>
|
||||
void swap(vector<T,Allocator>& x, vector<T,Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
|
||||
} // std
|
||||
|
||||
@@ -313,22 +331,38 @@ protected:
|
||||
pointer __end_;
|
||||
__compressed_pair<pointer, allocator_type> __end_cap_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type& __alloc() {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const allocator_type& __alloc() const {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type& __alloc() _NOEXCEPT
|
||||
{return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const allocator_type& __alloc() const _NOEXCEPT
|
||||
{return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer& __end_cap() _NOEXCEPT
|
||||
{return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const pointer& __end_cap() const _NOEXCEPT
|
||||
{return __end_cap_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __vector_base();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__vector_base()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
|
||||
_LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a);
|
||||
~__vector_base();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__destruct_at_end(__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast<size_type>(__end_cap() - __begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT {__destruct_at_end(__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type capacity() const _NOEXCEPT
|
||||
{return static_cast<size_type>(__end_cap() - __begin_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __destruct_at_end(const_pointer __new_last) _NOEXCEPT
|
||||
{__destruct_at_end(__new_last, is_trivially_destructible<value_type>());}
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last, false_type);
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last, true_type);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __destruct_at_end(const_pointer __new_last, false_type) _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __destruct_at_end(const_pointer __new_last, true_type) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __vector_base& __c)
|
||||
@@ -337,11 +371,17 @@ protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__vector_base& __c)
|
||||
_NOEXCEPT_(
|
||||
!__alloc_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{__move_assign_alloc(__c, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_move_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y)
|
||||
_NOEXCEPT_(
|
||||
!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_swap::value>());}
|
||||
private:
|
||||
@@ -363,29 +403,33 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __vector_base& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __vector_base& __c, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
};
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, false_type)
|
||||
__vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, false_type) _NOEXCEPT
|
||||
{
|
||||
while (__new_last < __end_)
|
||||
__alloc_traits::destroy(__alloc(), const_cast<pointer>(--__end_));
|
||||
@@ -394,7 +438,7 @@ __vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, fals
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, true_type)
|
||||
__vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, true_type) _NOEXCEPT
|
||||
{
|
||||
__end_ = const_cast<pointer>(__new_last);
|
||||
}
|
||||
@@ -402,6 +446,7 @@ __vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, true
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
__vector_base<_Tp, _Allocator>::__vector_base()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
: __begin_(0),
|
||||
__end_(0),
|
||||
__end_cap_(0)
|
||||
@@ -465,7 +510,10 @@ public:
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY vector() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a) : __base(__a) {}
|
||||
explicit vector(size_type __n);
|
||||
vector(size_type __n, const_reference __x);
|
||||
@@ -499,11 +547,15 @@ public:
|
||||
vector& operator=(const vector& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(vector&& __x);
|
||||
vector(vector&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(vector&& __x, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(vector&& __x);
|
||||
vector& operator=(vector&& __x)
|
||||
_NOEXCEPT_(
|
||||
__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(initializer_list<value_type> __il)
|
||||
@@ -530,29 +582,53 @@ public:
|
||||
void assign(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const {return this->__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return this->__alloc();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin();
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const;
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end();
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const;
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cbegin() const {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cend() const {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crbegin() const {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crend() const {return rend();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT
|
||||
{return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT
|
||||
{return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT
|
||||
{return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT
|
||||
{return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast<size_type>(this->__end_ - this->__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type capacity() const {return __base::capacity();}
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return this->__begin_ == this->__end_;}
|
||||
size_type max_size() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT
|
||||
{return static_cast<size_type>(this->__end_ - this->__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type capacity() const _NOEXCEPT
|
||||
{return __base::capacity();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT
|
||||
{return this->__begin_ == this->__end_;}
|
||||
size_type max_size() const _NOEXCEPT;
|
||||
void reserve(size_type __n);
|
||||
void shrink_to_fit();
|
||||
void shrink_to_fit() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n);
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const;
|
||||
@@ -564,9 +640,11 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY reference back() {return *(this->__end_ - 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const {return *(this->__end_ - 1);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY value_type* data()
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type* data() _NOEXCEPT
|
||||
{return _STD::__to_raw_pointer(this->__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY const value_type* data() const
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type* data() const _NOEXCEPT
|
||||
{return _STD::__to_raw_pointer(this->__begin_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
|
||||
@@ -610,19 +688,23 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
|
||||
iterator erase(const_iterator __first, const_iterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__base::clear();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT
|
||||
{__base::clear();}
|
||||
|
||||
void resize(size_type __sz);
|
||||
void resize(size_type __sz, const_reference __x);
|
||||
|
||||
void swap(vector&);
|
||||
void swap(vector&)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
|
||||
void allocate(size_type __n);
|
||||
void deallocate();
|
||||
void deallocate() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
|
||||
void __construct_at_end(size_type __n);
|
||||
void __construct_at_end(size_type __n, const_reference __x);
|
||||
@@ -637,13 +719,14 @@ private:
|
||||
void __append(size_type __n);
|
||||
void __append(size_type __n, const_reference __x);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator __make_iter(pointer __p);
|
||||
iterator __make_iter(pointer __p) _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator __make_iter(const_pointer __p) const;
|
||||
const_iterator __make_iter(const_pointer __p) const _NOEXCEPT;
|
||||
void __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v);
|
||||
pointer __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p);
|
||||
void __move_range(pointer __from_s, pointer __from_e, pointer __to);
|
||||
void __move_assign(vector& __c, true_type);
|
||||
void __move_assign(vector& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
||||
void __move_assign(vector& __c, false_type);
|
||||
};
|
||||
|
||||
@@ -652,7 +735,7 @@ void
|
||||
vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v)
|
||||
{
|
||||
for (pointer __p = this->__end_; this->__begin_ < __p;)
|
||||
__v.push_front(_STD::move(*--__p));
|
||||
__v.push_front(_STD::move_if_noexcept(*--__p));
|
||||
_STD::swap(this->__begin_, __v.__begin_);
|
||||
_STD::swap(this->__end_, __v.__end_);
|
||||
_STD::swap(this->__end_cap(), __v.__end_cap());
|
||||
@@ -666,9 +749,9 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
|
||||
{
|
||||
pointer __r = __v.__begin_;
|
||||
for (pointer __i = __p; this->__begin_ < __i;)
|
||||
__v.push_front(_STD::move(*--__i));
|
||||
__v.push_front(_STD::move_if_noexcept(*--__i));
|
||||
for (pointer __i = __p; __i < this->__end_; ++__i)
|
||||
__v.push_back(_STD::move(*__i));
|
||||
__v.push_back(_STD::move_if_noexcept(*__i));
|
||||
_STD::swap(this->__begin_, __v.__begin_);
|
||||
_STD::swap(this->__end_, __v.__end_);
|
||||
_STD::swap(this->__end_cap(), __v.__end_cap());
|
||||
@@ -696,7 +779,7 @@ vector<_Tp, _Allocator>::allocate(size_type __n)
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
vector<_Tp, _Allocator>::deallocate()
|
||||
vector<_Tp, _Allocator>::deallocate() _NOEXCEPT
|
||||
{
|
||||
if (this->__begin_ != 0)
|
||||
{
|
||||
@@ -709,7 +792,7 @@ vector<_Tp, _Allocator>::deallocate()
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename vector<_Tp, _Allocator>::size_type
|
||||
vector<_Tp, _Allocator>::max_size() const
|
||||
vector<_Tp, _Allocator>::max_size() const _NOEXCEPT
|
||||
{
|
||||
return _STD::min(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2); // end() >= begin(), always
|
||||
}
|
||||
@@ -800,7 +883,7 @@ vector<_Tp, _Allocator>::__move_construct_at_end(pointer __first, pointer __last
|
||||
// Default constructs __n objects starting at __end_
|
||||
// throws if construction throws
|
||||
// Postcondition: size() == size() + __n
|
||||
// Exception safety: strong but assumes move ctor doesn't throw (copy ctor can)
|
||||
// Exception safety: strong.
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
vector<_Tp, _Allocator>::__append(size_type __n)
|
||||
@@ -819,7 +902,7 @@ vector<_Tp, _Allocator>::__append(size_type __n)
|
||||
// Default constructs __n objects starting at __end_
|
||||
// throws if construction throws
|
||||
// Postcondition: size() == size() + __n
|
||||
// Exception safety: strong but assumes move ctor doesn't throw (copy ctor can)
|
||||
// Exception safety: strong.
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)
|
||||
@@ -943,6 +1026,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<_Tp, _Allocator>::vector(vector&& __x)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __base(_STD::move(__x.__alloc()))
|
||||
{
|
||||
this->__begin_ = __x.__begin_;
|
||||
@@ -999,6 +1083,9 @@ template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<_Tp, _Allocator>&
|
||||
vector<_Tp, _Allocator>::operator=(vector&& __x)
|
||||
_NOEXCEPT_(
|
||||
__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__move_assign(__x, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -1021,6 +1108,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type)
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
deallocate();
|
||||
this->__begin_ = __c.__begin_;
|
||||
@@ -1118,7 +1206,7 @@ vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename vector<_Tp, _Allocator>::iterator
|
||||
vector<_Tp, _Allocator>::__make_iter(pointer __p)
|
||||
vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT
|
||||
{
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
return iterator(this, __p);
|
||||
@@ -1130,7 +1218,7 @@ vector<_Tp, _Allocator>::__make_iter(pointer __p)
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename vector<_Tp, _Allocator>::const_iterator
|
||||
vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const
|
||||
vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT
|
||||
{
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
return const_iterator(this, __p);
|
||||
@@ -1142,7 +1230,7 @@ vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename vector<_Tp, _Allocator>::iterator
|
||||
vector<_Tp, _Allocator>::begin()
|
||||
vector<_Tp, _Allocator>::begin() _NOEXCEPT
|
||||
{
|
||||
return __make_iter(this->__begin_);
|
||||
}
|
||||
@@ -1150,7 +1238,7 @@ vector<_Tp, _Allocator>::begin()
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename vector<_Tp, _Allocator>::const_iterator
|
||||
vector<_Tp, _Allocator>::begin() const
|
||||
vector<_Tp, _Allocator>::begin() const _NOEXCEPT
|
||||
{
|
||||
return __make_iter(this->__begin_);
|
||||
}
|
||||
@@ -1158,7 +1246,7 @@ vector<_Tp, _Allocator>::begin() const
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename vector<_Tp, _Allocator>::iterator
|
||||
vector<_Tp, _Allocator>::end()
|
||||
vector<_Tp, _Allocator>::end() _NOEXCEPT
|
||||
{
|
||||
return __make_iter(this->__end_);
|
||||
}
|
||||
@@ -1166,7 +1254,7 @@ vector<_Tp, _Allocator>::end()
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename vector<_Tp, _Allocator>::const_iterator
|
||||
vector<_Tp, _Allocator>::end() const
|
||||
vector<_Tp, _Allocator>::end() const _NOEXCEPT
|
||||
{
|
||||
return __make_iter(this->__end_);
|
||||
}
|
||||
@@ -1218,17 +1306,14 @@ vector<_Tp, _Allocator>::reserve(size_type __n)
|
||||
if (__n > capacity())
|
||||
{
|
||||
allocator_type& __a = this->__alloc();
|
||||
__split_buffer<value_type, allocator_type&> __v(__n, 0, __a);
|
||||
__v.__construct_at_end(move_iterator<pointer>(this->__begin_),
|
||||
move_iterator<pointer>(this->__end_));
|
||||
clear();
|
||||
__split_buffer<value_type, allocator_type&> __v(__n, size(), __a);
|
||||
__swap_out_circular_buffer(__v);
|
||||
}
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
vector<_Tp, _Allocator>::shrink_to_fit()
|
||||
vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
{
|
||||
if (capacity() > size())
|
||||
{
|
||||
@@ -1237,10 +1322,7 @@ vector<_Tp, _Allocator>::shrink_to_fit()
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
allocator_type& __a = this->__alloc();
|
||||
__split_buffer<value_type, allocator_type&> __v(size(), 0, __a);
|
||||
__v.__construct_at_end(move_iterator<pointer>(this->__begin_),
|
||||
move_iterator<pointer>(this->__end_));
|
||||
clear();
|
||||
__split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
|
||||
__swap_out_circular_buffer(__v);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1613,6 +1695,8 @@ vector<_Tp, _Allocator>::resize(size_type __sz, const_reference __x)
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
vector<_Tp, _Allocator>::swap(vector& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
_STD::swap(this->__begin_, __x.__begin_);
|
||||
_STD::swap(this->__end_, __x.__end_);
|
||||
@@ -1714,20 +1798,32 @@ private:
|
||||
size_type __size_;
|
||||
__compressed_pair<size_type, __storage_allocator> __cap_alloc_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type& __cap() {return __cap_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const size_type& __cap() const {return __cap_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY __storage_allocator& __alloc() {return __cap_alloc_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const __storage_allocator& __alloc() const {return __cap_alloc_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& __cap() _NOEXCEPT
|
||||
{return __cap_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const size_type& __cap() const _NOEXCEPT
|
||||
{return __cap_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__storage_allocator& __alloc() _NOEXCEPT
|
||||
{return __cap_alloc_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __storage_allocator& __alloc() const _NOEXCEPT
|
||||
{return __cap_alloc_.second();}
|
||||
|
||||
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY static size_type __internal_cap_to_external(size_type __n)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __internal_cap_to_external(size_type __n) _NOEXCEPT
|
||||
{return __n * __bits_per_word;}
|
||||
_LIBCPP_INLINE_VISIBILITY static size_type __external_cap_to_internal(size_type __n)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __external_cap_to_internal(size_type __n) _NOEXCEPT
|
||||
{return (__n - 1) / __bits_per_word + 1;}
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY vector();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
|
||||
_LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a);
|
||||
~vector();
|
||||
explicit vector(size_type __n);
|
||||
@@ -1755,9 +1851,15 @@ public:
|
||||
vector(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY vector(vector&& __v);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(vector&& __v)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
|
||||
vector(vector&& __v, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY vector& operator=(vector&& __v);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(vector&& __v)
|
||||
_NOEXCEPT_(
|
||||
__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(initializer_list<value_type> __il)
|
||||
@@ -1784,30 +1886,60 @@ public:
|
||||
void assign(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(this->__alloc());}
|
||||
|
||||
size_type max_size() const;
|
||||
_LIBCPP_INLINE_VISIBILITY size_type capacity() const {return __internal_cap_to_external(__cap());}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return __size_;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return __size_ == 0;}
|
||||
size_type max_size() const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type capacity() const _NOEXCEPT
|
||||
{return __internal_cap_to_external(__cap());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT
|
||||
{return __size_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT
|
||||
{return __size_ == 0;}
|
||||
void reserve(size_type __n);
|
||||
void shrink_to_fit();
|
||||
void shrink_to_fit() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return __make_iter(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const {return __make_iter(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() {return __make_iter(__size_);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const {return __make_iter(__size_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() _NOEXCEPT
|
||||
{return __make_iter(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const _NOEXCEPT
|
||||
{return __make_iter(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() _NOEXCEPT
|
||||
{return __make_iter(__size_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const _NOEXCEPT
|
||||
{return __make_iter(__size_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cbegin() const {return __make_iter(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cend() const {return __make_iter(__size_);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crbegin() const {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crend() const {return rend();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT
|
||||
{return __make_iter(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT
|
||||
{return __make_iter(__size_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT
|
||||
{return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT
|
||||
{return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __make_ref(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const {return __make_ref(__n);}
|
||||
@@ -1847,20 +1979,24 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
|
||||
iterator erase(const_iterator __first, const_iterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__size_ = 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT {__size_ = 0;}
|
||||
|
||||
void swap(vector&);
|
||||
void swap(vector&)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value);
|
||||
|
||||
void resize(size_type __sz, value_type __x = false);
|
||||
void flip();
|
||||
void flip() _NOEXCEPT;
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
|
||||
void allocate(size_type __n);
|
||||
void deallocate();
|
||||
_LIBCPP_INLINE_VISIBILITY static size_type __align(size_type __new_size)
|
||||
void deallocate() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __align(size_type __new_size) _NOEXCEPT
|
||||
{return __new_size + (__bits_per_word-1) & ~(__bits_per_word-1);};
|
||||
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
|
||||
_LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);
|
||||
@@ -1872,9 +2008,11 @@ private:
|
||||
>::type
|
||||
__construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
|
||||
void __append(size_type __n, const_reference __x);
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_type __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference __make_ref(size_type __pos) _NOEXCEPT
|
||||
{return reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_type __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference __make_ref(size_type __pos) const _NOEXCEPT
|
||||
{return const_reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_type __pos)
|
||||
@@ -1884,11 +2022,14 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __const_iterator_cast(const_iterator __p)
|
||||
{return iterator(this, pointer(const_cast<__storage_pointer>(__p.base().__seg_), __p.base().__ctz_));}
|
||||
#else // _LIBCPP_DEBUG
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_type __pos)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator __make_iter(size_type __pos) _NOEXCEPT
|
||||
{return iterator(__begin_ + __pos / __bits_per_word, static_cast<unsigned>(__pos % __bits_per_word));}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_type __pos) const
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator __make_iter(size_type __pos) const _NOEXCEPT
|
||||
{return const_iterator(__begin_ + __pos / __bits_per_word, static_cast<unsigned>(__pos % __bits_per_word));}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __const_iterator_cast(const_iterator __p)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator __const_iterator_cast(const_iterator __p) _NOEXCEPT
|
||||
{return iterator(const_cast<__storage_pointer>(__p.__seg_), __p.__ctz_);}
|
||||
#endif // _LIBCPP_DEBUG
|
||||
|
||||
@@ -1909,37 +2050,48 @@ private:
|
||||
{}
|
||||
|
||||
void __move_assign(vector& __c, false_type);
|
||||
void __move_assign(vector& __c, true_type);
|
||||
void __move_assign(vector& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(vector& __c)
|
||||
_NOEXCEPT_(
|
||||
!__storage_traits::propagate_on_container_move_assignment::value ||
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{__move_assign_alloc(__c, integral_constant<bool,
|
||||
__storage_traits::propagate_on_container_move_assignment::value>());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const vector& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const vector& __c, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y)
|
||||
_NOEXCEPT_(
|
||||
!__storage_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__storage_traits::propagate_on_container_swap::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, false_type)
|
||||
_NOEXCEPT
|
||||
{}
|
||||
|
||||
size_t __hash_code() const;
|
||||
size_t __hash_code() const _NOEXCEPT;
|
||||
|
||||
friend class __bit_reference<vector>;
|
||||
friend class __bit_const_reference<vector>;
|
||||
@@ -1983,7 +2135,7 @@ vector<bool, _Allocator>::allocate(size_type __n)
|
||||
|
||||
template <class _Allocator>
|
||||
void
|
||||
vector<bool, _Allocator>::deallocate()
|
||||
vector<bool, _Allocator>::deallocate() _NOEXCEPT
|
||||
{
|
||||
if (this->__begin_ != 0)
|
||||
{
|
||||
@@ -1996,7 +2148,7 @@ vector<bool, _Allocator>::deallocate()
|
||||
|
||||
template <class _Allocator>
|
||||
typename vector<bool, _Allocator>::size_type
|
||||
vector<bool, _Allocator>::max_size() const
|
||||
vector<bool, _Allocator>::max_size() const _NOEXCEPT
|
||||
{
|
||||
size_type __amax = __storage_traits::max_size(__alloc());
|
||||
size_type __nmax = numeric_limits<size_type>::max() / 2; // end() >= begin(), always
|
||||
@@ -2051,6 +2203,7 @@ vector<bool, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardI
|
||||
template <class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<bool, _Allocator>::vector()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
: __begin_(0),
|
||||
__size_(0),
|
||||
__cap_alloc_(0)
|
||||
@@ -2281,6 +2434,7 @@ vector<bool, _Allocator>::operator=(const vector& __v)
|
||||
template <class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<bool, _Allocator>::vector(vector&& __v)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __begin_(__v.__begin_),
|
||||
__size_(__v.__size_),
|
||||
__cap_alloc_(__v.__cap_alloc_)
|
||||
@@ -2315,6 +2469,9 @@ template <class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<bool, _Allocator>&
|
||||
vector<bool, _Allocator>::operator=(vector&& __v)
|
||||
_NOEXCEPT_(
|
||||
__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
__move_assign(__v, integral_constant<bool,
|
||||
__storage_traits::propagate_on_container_move_assignment::value>());
|
||||
@@ -2333,6 +2490,7 @@ vector<bool, _Allocator>::__move_assign(vector& __c, false_type)
|
||||
template <class _Allocator>
|
||||
void
|
||||
vector<bool, _Allocator>::__move_assign(vector& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
{
|
||||
deallocate();
|
||||
this->__begin_ = __c.__begin_;
|
||||
@@ -2419,7 +2577,7 @@ vector<bool, _Allocator>::reserve(size_type __n)
|
||||
|
||||
template <class _Allocator>
|
||||
void
|
||||
vector<bool, _Allocator>::shrink_to_fit()
|
||||
vector<bool, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
{
|
||||
if (__external_cap_to_internal(size()) > __cap())
|
||||
{
|
||||
@@ -2618,6 +2776,8 @@ vector<bool, _Allocator>::erase(const_iterator __first, const_iterator __last)
|
||||
template <class _Allocator>
|
||||
void
|
||||
vector<bool, _Allocator>::swap(vector& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value)
|
||||
{
|
||||
_STD::swap(this->__begin_, __x.__begin_);
|
||||
_STD::swap(this->__size_, __x.__size_);
|
||||
@@ -2660,7 +2820,7 @@ vector<bool, _Allocator>::resize(size_type __sz, value_type __x)
|
||||
|
||||
template <class _Allocator>
|
||||
void
|
||||
vector<bool, _Allocator>::flip()
|
||||
vector<bool, _Allocator>::flip() _NOEXCEPT
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = __size_;
|
||||
@@ -2698,7 +2858,7 @@ vector<bool, _Allocator>::__invariants() const
|
||||
|
||||
template <class _Allocator>
|
||||
size_t
|
||||
vector<bool, _Allocator>::__hash_code() const
|
||||
vector<bool, _Allocator>::__hash_code() const _NOEXCEPT
|
||||
{
|
||||
size_t __h = 0;
|
||||
// do middle whole words
|
||||
@@ -2720,7 +2880,7 @@ struct _LIBCPP_VISIBLE hash<vector<bool, _Allocator> >
|
||||
: public unary_function<vector<bool, _Allocator>, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const vector<bool, _Allocator>& __vec) const
|
||||
size_t operator()(const vector<bool, _Allocator>& __vec) const _NOEXCEPT
|
||||
{return __vec.__hash_code();}
|
||||
};
|
||||
|
||||
@@ -2777,6 +2937,7 @@ template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ endif()
|
||||
append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
|
||||
append_if(libraries LIBCXX_HAS_C_LIB c)
|
||||
append_if(libraries LIBCXX_HAS_M_LIB m)
|
||||
append_if(libraries LIBCXX_HAS_RT_LIB rt)
|
||||
append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)
|
||||
|
||||
target_link_libraries(cxx ${libraries})
|
||||
|
43
lib/buildit
43
lib/buildit
@@ -17,9 +17,17 @@ then
|
||||
CXX=clang++
|
||||
fi
|
||||
|
||||
if [ -z "$CC" ]
|
||||
then
|
||||
CC=clang
|
||||
fi
|
||||
|
||||
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
if [ -z $IPHONEOS_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $RC_ProjectSourceVersion ]
|
||||
@@ -27,9 +35,11 @@ then
|
||||
RC_ProjectSourceVersion=1
|
||||
fi
|
||||
|
||||
EXTRA_FLAGS="-std=c++0x "
|
||||
|
||||
case $TRIPLE in
|
||||
*-apple-*)
|
||||
if [ -z $RC_BUILDIT ]
|
||||
if [ -z $RC_XBS ]
|
||||
then
|
||||
RC_CFLAGS="-arch i386 -arch x86_64"
|
||||
fi
|
||||
@@ -45,16 +55,27 @@ case $TRIPLE in
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
/usr/lib/libSystem.B.dylib"
|
||||
else
|
||||
EXTRA_FLAGS="-std=c++0x"
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi.exp"
|
||||
if [ -n "$SDKROOT" ]
|
||||
then
|
||||
EXTRA_FLAGS+="-isysroot ${SDKROOT}"
|
||||
if echo "${RC_ARCHS}" | grep -q "armv7"
|
||||
then
|
||||
RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"
|
||||
else
|
||||
RE_EXPORT_LINE="-Wl,-reexport_library,${SDKROOT}/usr/lib/libc++abi.dylib"
|
||||
fi
|
||||
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
|
||||
CC=`xcrun -sdk "${SDKROOT}" -find clang`
|
||||
fi
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs \
|
||||
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.1.dylib \
|
||||
${SDKROOT}/usr/lib/libc++abi.dylib \
|
||||
-lSystem \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
-Wl,-reexported_symbols_list,libc++abi.exp \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp"
|
||||
${RE_EXPORT_LINE} \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp "
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
@@ -62,11 +83,11 @@ case $TRIPLE in
|
||||
SOEXT=so
|
||||
LDSHARED_FLAGS="-o libc++.so.1.0 \
|
||||
-shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
|
||||
-lpthread -lrt -lc"
|
||||
-lpthread -lrt -lc -lstdc++"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z $RC_BUILDIT ]
|
||||
if [ -z $RC_XBS ]
|
||||
then
|
||||
rm -f libc++.1.$SOEXT*
|
||||
fi
|
||||
@@ -78,11 +99,11 @@ for FILE in ../src/*.cpp; do
|
||||
done
|
||||
|
||||
|
||||
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
|
||||
|
||||
#libtool -static -o libc++.a *.o
|
||||
|
||||
if [ -z $RC_BUILDIT ]
|
||||
if [ -z $RC_XBS ]
|
||||
then
|
||||
rm *.o
|
||||
fi
|
||||
|
159
lib/libc++sjlj-abi.exp
Normal file
159
lib/libc++sjlj-abi.exp
Normal file
@@ -0,0 +1,159 @@
|
||||
___cxa_allocate_exception
|
||||
___cxa_end_catch
|
||||
___cxa_demangle
|
||||
___cxa_current_exception_type
|
||||
___cxa_call_unexpected
|
||||
___cxa_free_exception
|
||||
___cxa_get_exception_ptr
|
||||
___cxa_get_globals
|
||||
___cxa_get_globals_fast
|
||||
___cxa_guard_abort
|
||||
___cxa_guard_acquire
|
||||
___cxa_guard_release
|
||||
___cxa_rethrow
|
||||
___cxa_pure_virtual
|
||||
___cxa_begin_catch
|
||||
___cxa_throw
|
||||
___cxa_vec_cctor
|
||||
___cxa_vec_cleanup
|
||||
___cxa_vec_ctor
|
||||
___cxa_vec_delete
|
||||
___cxa_vec_delete2
|
||||
___cxa_vec_delete3
|
||||
___cxa_vec_dtor
|
||||
___cxa_vec_new
|
||||
___cxa_vec_new2
|
||||
___cxa_vec_new3
|
||||
___dynamic_cast
|
||||
___gxx_personality_sj0
|
||||
__ZTIDi
|
||||
__ZTIDn
|
||||
__ZTIDs
|
||||
__ZTIPDi
|
||||
__ZTIPDn
|
||||
__ZTIPDs
|
||||
__ZTIPKDi
|
||||
__ZTIPKDn
|
||||
__ZTIPKDs
|
||||
__ZTSPm
|
||||
__ZTSPl
|
||||
__ZTSPj
|
||||
__ZTSPi
|
||||
__ZTSPh
|
||||
__ZTSPf
|
||||
__ZTSPe
|
||||
__ZTSPd
|
||||
__ZTSPc
|
||||
__ZTSPb
|
||||
__ZTSPa
|
||||
__ZTSPKc
|
||||
__ZTSPKy
|
||||
__ZTSPKx
|
||||
__ZTSPKw
|
||||
__ZTSPKv
|
||||
__ZTSPKt
|
||||
__ZTSPKs
|
||||
__ZTSPKm
|
||||
__ZTSPKl
|
||||
__ZTSPKi
|
||||
__ZTSPKh
|
||||
__ZTSPs
|
||||
__ZTSPt
|
||||
__ZTSPv
|
||||
__ZTSPw
|
||||
__ZTSPKa
|
||||
__ZTSPx
|
||||
__ZTSPy
|
||||
__ZTSPKd
|
||||
__ZTSPKe
|
||||
__ZTSPKj
|
||||
__ZTSPKb
|
||||
__ZTSPKf
|
||||
__ZTSv
|
||||
__ZTSt
|
||||
__ZTSs
|
||||
__ZTSm
|
||||
__ZTSl
|
||||
__ZTSj
|
||||
__ZTSi
|
||||
__ZTSh
|
||||
__ZTSf
|
||||
__ZTSe
|
||||
__ZTSd
|
||||
__ZTSc
|
||||
__ZTSw
|
||||
__ZTSx
|
||||
__ZTSy
|
||||
__ZTSb
|
||||
__ZTSa
|
||||
__ZTIPKh
|
||||
__ZTIPKf
|
||||
__ZTIPKe
|
||||
__ZTIPKd
|
||||
__ZTIPKc
|
||||
__ZTIPKb
|
||||
__ZTIPKa
|
||||
__ZTIPy
|
||||
__ZTIPx
|
||||
__ZTIPw
|
||||
__ZTIPv
|
||||
__ZTIPt
|
||||
__ZTIPs
|
||||
__ZTIPm
|
||||
__ZTIPl
|
||||
__ZTIPj
|
||||
__ZTIPi
|
||||
__ZTIPKi
|
||||
__ZTIPKj
|
||||
__ZTIPKl
|
||||
__ZTIPKm
|
||||
__ZTIPKs
|
||||
__ZTIPKt
|
||||
__ZTIPKv
|
||||
__ZTIPKw
|
||||
__ZTIPKx
|
||||
__ZTIPKy
|
||||
__ZTIPa
|
||||
__ZTIPb
|
||||
__ZTIPc
|
||||
__ZTIPd
|
||||
__ZTIPe
|
||||
__ZTIPf
|
||||
__ZTIPh
|
||||
__ZTVN10__cxxabiv129__pointer_to_member_type_infoE
|
||||
__ZTVN10__cxxabiv116__enum_type_infoE
|
||||
__ZTVN10__cxxabiv117__array_type_infoE
|
||||
__ZTVN10__cxxabiv117__class_type_infoE
|
||||
__ZTVN10__cxxabiv117__pbase_type_infoE
|
||||
__ZTVN10__cxxabiv119__pointer_type_infoE
|
||||
__ZTVN10__cxxabiv120__function_type_infoE
|
||||
__ZTVN10__cxxabiv120__si_class_type_infoE
|
||||
__ZTVN10__cxxabiv121__vmi_class_type_infoE
|
||||
__ZTVN10__cxxabiv123__fundamental_type_infoE
|
||||
__ZTIa
|
||||
__ZTIb
|
||||
__ZTIc
|
||||
__ZTId
|
||||
__ZTIe
|
||||
__ZTIf
|
||||
__ZTIh
|
||||
__ZTIi
|
||||
__ZTIj
|
||||
__ZTIl
|
||||
__ZTIm
|
||||
__ZTIs
|
||||
__ZTIt
|
||||
__ZTSN10__cxxabiv129__pointer_to_member_type_infoE
|
||||
__ZTSN10__cxxabiv123__fundamental_type_infoE
|
||||
__ZTSN10__cxxabiv121__vmi_class_type_infoE
|
||||
__ZTSN10__cxxabiv120__si_class_type_infoE
|
||||
__ZTSN10__cxxabiv120__function_type_infoE
|
||||
__ZTSN10__cxxabiv119__pointer_type_infoE
|
||||
__ZTSN10__cxxabiv117__pbase_type_infoE
|
||||
__ZTSN10__cxxabiv117__class_type_infoE
|
||||
__ZTSN10__cxxabiv117__array_type_infoE
|
||||
__ZTSN10__cxxabiv116__enum_type_infoE
|
||||
__ZTIy
|
||||
__ZTIx
|
||||
__ZTIw
|
||||
__ZTIv
|
@@ -25,7 +25,7 @@ namespace chrono
|
||||
// system_clock
|
||||
|
||||
system_clock::time_point
|
||||
system_clock::now()
|
||||
system_clock::now() _NOEXCEPT
|
||||
{
|
||||
timeval tv;
|
||||
gettimeofday(&tv, 0);
|
||||
@@ -33,13 +33,13 @@ system_clock::now()
|
||||
}
|
||||
|
||||
time_t
|
||||
system_clock::to_time_t(const time_point& t)
|
||||
system_clock::to_time_t(const time_point& t) _NOEXCEPT
|
||||
{
|
||||
return time_t(duration_cast<seconds>(t.time_since_epoch()).count());
|
||||
}
|
||||
|
||||
system_clock::time_point
|
||||
system_clock::from_time_t(time_t t)
|
||||
system_clock::from_time_t(time_t t) _NOEXCEPT
|
||||
{
|
||||
return system_clock::time_point(seconds(t));
|
||||
}
|
||||
@@ -97,7 +97,7 @@ init_steady_clock()
|
||||
#pragma GCC visibility pop
|
||||
|
||||
steady_clock::time_point
|
||||
steady_clock::now()
|
||||
steady_clock::now() _NOEXCEPT
|
||||
{
|
||||
static FP fp = init_steady_clock();
|
||||
return time_point(duration(fp()));
|
||||
@@ -114,7 +114,7 @@ steady_clock::now()
|
||||
// instead.
|
||||
|
||||
steady_clock::time_point
|
||||
steady_clock::now()
|
||||
steady_clock::now() _NOEXCEPT
|
||||
{
|
||||
struct timespec tp;
|
||||
if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
|
||||
|
@@ -24,17 +24,18 @@
|
||||
#endif // __APPLE__
|
||||
|
||||
std::unexpected_handler
|
||||
std::set_unexpected(std::unexpected_handler func) throw()
|
||||
std::set_unexpected(std::unexpected_handler func) _NOEXCEPT
|
||||
{
|
||||
return __sync_lock_test_and_set(&__unexpected_handler, func);
|
||||
}
|
||||
|
||||
std::unexpected_handler
|
||||
std::get_unexpected() throw()
|
||||
std::get_unexpected() _NOEXCEPT
|
||||
{
|
||||
return __sync_fetch_and_add(&__unexpected_handler, (std::unexpected_handler)0);
|
||||
}
|
||||
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
std::unexpected()
|
||||
{
|
||||
@@ -44,19 +45,19 @@ std::unexpected()
|
||||
}
|
||||
|
||||
std::terminate_handler
|
||||
std::set_terminate(std::terminate_handler func) throw()
|
||||
std::set_terminate(std::terminate_handler func) _NOEXCEPT
|
||||
{
|
||||
return __sync_lock_test_and_set(&__terminate_handler, func);
|
||||
}
|
||||
|
||||
std::terminate_handler
|
||||
std::get_terminate() throw()
|
||||
std::get_terminate() _NOEXCEPT
|
||||
{
|
||||
return __sync_fetch_and_add(&__terminate_handler, (std::terminate_handler)0);
|
||||
}
|
||||
|
||||
void
|
||||
std::terminate()
|
||||
std::terminate() _NOEXCEPT
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
@@ -75,7 +76,7 @@ std::terminate()
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
bool std::uncaught_exception() throw()
|
||||
bool std::uncaught_exception() _NOEXCEPT
|
||||
{
|
||||
#if __APPLE__
|
||||
// on Darwin, there is a helper function so __cxa_get_globals is private
|
||||
@@ -92,25 +93,25 @@ bool std::uncaught_exception() throw()
|
||||
namespace std
|
||||
{
|
||||
|
||||
exception::~exception() throw()
|
||||
exception::~exception() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_exception::~bad_exception() throw()
|
||||
bad_exception::~bad_exception() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char* exception::what() const throw()
|
||||
const char* exception::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::exception";
|
||||
}
|
||||
|
||||
const char* bad_exception::what() const throw()
|
||||
const char* bad_exception::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_exception";
|
||||
}
|
||||
|
||||
exception_ptr::~exception_ptr()
|
||||
exception_ptr::~exception_ptr() _NOEXCEPT
|
||||
{
|
||||
#if __APPLE__
|
||||
__cxxabiapple::__cxa_decrement_exception_refcount(__ptr_);
|
||||
@@ -120,7 +121,7 @@ exception_ptr::~exception_ptr()
|
||||
#endif // __APPLE__
|
||||
}
|
||||
|
||||
exception_ptr::exception_ptr(const exception_ptr& other)
|
||||
exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
|
||||
: __ptr_(other.__ptr_)
|
||||
{
|
||||
#if __APPLE__
|
||||
@@ -131,7 +132,7 @@ exception_ptr::exception_ptr(const exception_ptr& other)
|
||||
#endif // __APPLE__
|
||||
}
|
||||
|
||||
exception_ptr& exception_ptr::operator=(const exception_ptr& other)
|
||||
exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
|
||||
{
|
||||
#if __APPLE__
|
||||
if (__ptr_ != other.__ptr_)
|
||||
@@ -147,17 +148,18 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other)
|
||||
#endif // __APPLE__
|
||||
}
|
||||
|
||||
nested_exception::nested_exception()
|
||||
nested_exception::nested_exception() _NOEXCEPT
|
||||
: __ptr_(current_exception())
|
||||
{
|
||||
}
|
||||
|
||||
nested_exception::~nested_exception()
|
||||
nested_exception::~nested_exception() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
nested_exception::rethrow_nested /*[[noreturn]]*/ () const
|
||||
nested_exception::rethrow_nested() const
|
||||
{
|
||||
if (__ptr_ == nullptr)
|
||||
terminate();
|
||||
@@ -166,7 +168,7 @@ nested_exception::rethrow_nested /*[[noreturn]]*/ () const
|
||||
|
||||
} // std
|
||||
|
||||
std::exception_ptr std::current_exception()
|
||||
std::exception_ptr std::current_exception() _NOEXCEPT
|
||||
{
|
||||
#if __APPLE__
|
||||
// be nicer if there was a constructor that took a ptr, then
|
||||
|
@@ -16,12 +16,12 @@ class _LIBCPP_HIDDEN __future_error_category
|
||||
: public __do_message
|
||||
{
|
||||
public:
|
||||
virtual const char* name() const;
|
||||
virtual const char* name() const _NOEXCEPT;
|
||||
virtual string message(int ev) const;
|
||||
};
|
||||
|
||||
const char*
|
||||
__future_error_category::name() const
|
||||
__future_error_category::name() const _NOEXCEPT
|
||||
{
|
||||
return "future";
|
||||
}
|
||||
@@ -60,7 +60,7 @@ future_error::future_error(error_code __ec)
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::__on_zero_shared()
|
||||
__assoc_sub_state::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
@@ -38,12 +38,12 @@ class _LIBCPP_HIDDEN __iostream_category
|
||||
: public __do_message
|
||||
{
|
||||
public:
|
||||
virtual const char* name() const;
|
||||
virtual const char* name() const _NOEXCEPT;
|
||||
virtual string message(int ev) const;
|
||||
};
|
||||
|
||||
const char*
|
||||
__iostream_category::name() const
|
||||
__iostream_category::name() const _NOEXCEPT
|
||||
{
|
||||
return "iostream";
|
||||
}
|
||||
|
108
src/locale.cpp
108
src/locale.cpp
@@ -399,25 +399,25 @@ locale::__global()
|
||||
return g;
|
||||
}
|
||||
|
||||
locale::locale() throw()
|
||||
locale::locale() _NOEXCEPT
|
||||
: __locale_(__global().__locale_)
|
||||
{
|
||||
__locale_->__add_shared();
|
||||
}
|
||||
|
||||
locale::locale(const locale& l) throw()
|
||||
locale::locale(const locale& l) _NOEXCEPT
|
||||
: __locale_(l.__locale_)
|
||||
{
|
||||
__locale_->__add_shared();
|
||||
}
|
||||
|
||||
locale::~locale() throw()
|
||||
locale::~locale()
|
||||
{
|
||||
__locale_->__release_shared();
|
||||
}
|
||||
|
||||
const locale&
|
||||
locale::operator=(const locale& other) throw()
|
||||
locale::operator=(const locale& other) _NOEXCEPT
|
||||
{
|
||||
other.__locale_->__add_shared();
|
||||
__locale_->__release_shared();
|
||||
@@ -518,7 +518,7 @@ locale::facet::~facet()
|
||||
}
|
||||
|
||||
void
|
||||
locale::facet::__on_zero_shared()
|
||||
locale::facet::__on_zero_shared() _NOEXCEPT
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
@@ -895,7 +895,7 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
|
||||
}
|
||||
|
||||
const ctype<char>::mask*
|
||||
ctype<char>::classic_table() throw()
|
||||
ctype<char>::classic_table() _NOEXCEPT
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return _DefaultRuneLocale.__runetype;
|
||||
@@ -1164,13 +1164,13 @@ codecvt<char, char, mbstate_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char, char, mbstate_t>::do_encoding() const throw()
|
||||
codecvt<char, char, mbstate_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool
|
||||
codecvt<char, char, mbstate_t>::do_always_noconv() const throw()
|
||||
codecvt<char, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1183,7 +1183,7 @@ codecvt<char, char, mbstate_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char, char, mbstate_t>::do_max_length() const throw()
|
||||
codecvt<char, char, mbstate_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -1365,7 +1365,7 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_encoding() const throw()
|
||||
codecvt<wchar_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (mbtowc_l(0, 0, MB_LEN_MAX, __l) == 0)
|
||||
@@ -1382,7 +1382,7 @@ codecvt<wchar_t, char, mbstate_t>::do_encoding() const throw()
|
||||
}
|
||||
|
||||
bool
|
||||
codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const throw()
|
||||
codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1418,7 +1418,7 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_max_length() const throw()
|
||||
codecvt<wchar_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return __l == 0 ? 1 : MB_CUR_MAX_L(__l);
|
||||
@@ -2875,13 +2875,13 @@ codecvt<char16_t, char, mbstate_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char16_t, char, mbstate_t>::do_encoding() const throw()
|
||||
codecvt<char16_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
codecvt<char16_t, char, mbstate_t>::do_always_noconv() const throw()
|
||||
codecvt<char16_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -2896,7 +2896,7 @@ codecvt<char16_t, char, mbstate_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char16_t, char, mbstate_t>::do_max_length() const throw()
|
||||
codecvt<char16_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@@ -2952,13 +2952,13 @@ codecvt<char32_t, char, mbstate_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char32_t, char, mbstate_t>::do_encoding() const throw()
|
||||
codecvt<char32_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
codecvt<char32_t, char, mbstate_t>::do_always_noconv() const throw()
|
||||
codecvt<char32_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -2973,7 +2973,7 @@ codecvt<char32_t, char, mbstate_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char32_t, char, mbstate_t>::do_max_length() const throw()
|
||||
codecvt<char32_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@@ -3025,13 +3025,13 @@ __codecvt_utf8<wchar_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8<wchar_t>::do_encoding() const throw()
|
||||
__codecvt_utf8<wchar_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf8<wchar_t>::do_always_noconv() const throw()
|
||||
__codecvt_utf8<wchar_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3046,7 +3046,7 @@ __codecvt_utf8<wchar_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8<wchar_t>::do_max_length() const throw()
|
||||
__codecvt_utf8<wchar_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 7;
|
||||
@@ -3100,13 +3100,13 @@ __codecvt_utf8<char16_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8<char16_t>::do_encoding() const throw()
|
||||
__codecvt_utf8<char16_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf8<char16_t>::do_always_noconv() const throw()
|
||||
__codecvt_utf8<char16_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3121,7 +3121,7 @@ __codecvt_utf8<char16_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8<char16_t>::do_max_length() const throw()
|
||||
__codecvt_utf8<char16_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 6;
|
||||
@@ -3175,13 +3175,13 @@ __codecvt_utf8<char32_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8<char32_t>::do_encoding() const throw()
|
||||
__codecvt_utf8<char32_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf8<char32_t>::do_always_noconv() const throw()
|
||||
__codecvt_utf8<char32_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3196,7 +3196,7 @@ __codecvt_utf8<char32_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8<char32_t>::do_max_length() const throw()
|
||||
__codecvt_utf8<char32_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 7;
|
||||
@@ -3250,13 +3250,13 @@ __codecvt_utf16<wchar_t, false>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<wchar_t, false>::do_encoding() const throw()
|
||||
__codecvt_utf16<wchar_t, false>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf16<wchar_t, false>::do_always_noconv() const throw()
|
||||
__codecvt_utf16<wchar_t, false>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3271,7 +3271,7 @@ __codecvt_utf16<wchar_t, false>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<wchar_t, false>::do_max_length() const throw()
|
||||
__codecvt_utf16<wchar_t, false>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 6;
|
||||
@@ -3325,13 +3325,13 @@ __codecvt_utf16<wchar_t, true>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<wchar_t, true>::do_encoding() const throw()
|
||||
__codecvt_utf16<wchar_t, true>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf16<wchar_t, true>::do_always_noconv() const throw()
|
||||
__codecvt_utf16<wchar_t, true>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3346,7 +3346,7 @@ __codecvt_utf16<wchar_t, true>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<wchar_t, true>::do_max_length() const throw()
|
||||
__codecvt_utf16<wchar_t, true>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 6;
|
||||
@@ -3400,13 +3400,13 @@ __codecvt_utf16<char16_t, false>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char16_t, false>::do_encoding() const throw()
|
||||
__codecvt_utf16<char16_t, false>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf16<char16_t, false>::do_always_noconv() const throw()
|
||||
__codecvt_utf16<char16_t, false>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3421,7 +3421,7 @@ __codecvt_utf16<char16_t, false>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char16_t, false>::do_max_length() const throw()
|
||||
__codecvt_utf16<char16_t, false>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 4;
|
||||
@@ -3475,13 +3475,13 @@ __codecvt_utf16<char16_t, true>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char16_t, true>::do_encoding() const throw()
|
||||
__codecvt_utf16<char16_t, true>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf16<char16_t, true>::do_always_noconv() const throw()
|
||||
__codecvt_utf16<char16_t, true>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3496,7 +3496,7 @@ __codecvt_utf16<char16_t, true>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char16_t, true>::do_max_length() const throw()
|
||||
__codecvt_utf16<char16_t, true>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 4;
|
||||
@@ -3550,13 +3550,13 @@ __codecvt_utf16<char32_t, false>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char32_t, false>::do_encoding() const throw()
|
||||
__codecvt_utf16<char32_t, false>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf16<char32_t, false>::do_always_noconv() const throw()
|
||||
__codecvt_utf16<char32_t, false>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3571,7 +3571,7 @@ __codecvt_utf16<char32_t, false>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char32_t, false>::do_max_length() const throw()
|
||||
__codecvt_utf16<char32_t, false>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 6;
|
||||
@@ -3625,13 +3625,13 @@ __codecvt_utf16<char32_t, true>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char32_t, true>::do_encoding() const throw()
|
||||
__codecvt_utf16<char32_t, true>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf16<char32_t, true>::do_always_noconv() const throw()
|
||||
__codecvt_utf16<char32_t, true>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3646,7 +3646,7 @@ __codecvt_utf16<char32_t, true>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf16<char32_t, true>::do_max_length() const throw()
|
||||
__codecvt_utf16<char32_t, true>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 6;
|
||||
@@ -3700,13 +3700,13 @@ __codecvt_utf8_utf16<wchar_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<wchar_t>::do_encoding() const throw()
|
||||
__codecvt_utf8_utf16<wchar_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf8_utf16<wchar_t>::do_always_noconv() const throw()
|
||||
__codecvt_utf8_utf16<wchar_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3721,7 +3721,7 @@ __codecvt_utf8_utf16<wchar_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<wchar_t>::do_max_length() const throw()
|
||||
__codecvt_utf8_utf16<wchar_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 7;
|
||||
@@ -3775,13 +3775,13 @@ __codecvt_utf8_utf16<char16_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<char16_t>::do_encoding() const throw()
|
||||
__codecvt_utf8_utf16<char16_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf8_utf16<char16_t>::do_always_noconv() const throw()
|
||||
__codecvt_utf8_utf16<char16_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3796,7 +3796,7 @@ __codecvt_utf8_utf16<char16_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<char16_t>::do_max_length() const throw()
|
||||
__codecvt_utf8_utf16<char16_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 7;
|
||||
@@ -3850,13 +3850,13 @@ __codecvt_utf8_utf16<char32_t>::do_unshift(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<char32_t>::do_encoding() const throw()
|
||||
__codecvt_utf8_utf16<char32_t>::do_encoding() const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
__codecvt_utf8_utf16<char32_t>::do_always_noconv() const throw()
|
||||
__codecvt_utf8_utf16<char32_t>::do_always_noconv() const _NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3871,7 +3871,7 @@ __codecvt_utf8_utf16<char32_t>::do_length(state_type&,
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<char32_t>::do_max_length() const throw()
|
||||
__codecvt_utf8_utf16<char32_t>::do_max_length() const _NOEXCEPT
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
return 7;
|
||||
|
@@ -16,14 +16,14 @@ namespace
|
||||
|
||||
template <class T>
|
||||
inline T
|
||||
increment(T& t)
|
||||
increment(T& t) _NOEXCEPT
|
||||
{
|
||||
return __sync_add_and_fetch(&t, 1);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T
|
||||
decrement(T& t)
|
||||
decrement(T& t) _NOEXCEPT
|
||||
{
|
||||
return __sync_add_and_fetch(&t, -1);
|
||||
}
|
||||
@@ -32,10 +32,10 @@ decrement(T& t)
|
||||
|
||||
const allocator_arg_t allocator_arg = allocator_arg_t();
|
||||
|
||||
bad_weak_ptr::~bad_weak_ptr() throw() {}
|
||||
bad_weak_ptr::~bad_weak_ptr() _NOEXCEPT {}
|
||||
|
||||
const char*
|
||||
bad_weak_ptr::what() const throw()
|
||||
bad_weak_ptr::what() const _NOEXCEPT
|
||||
{
|
||||
return "bad_weak_ptr";
|
||||
}
|
||||
@@ -45,13 +45,13 @@ __shared_count::~__shared_count()
|
||||
}
|
||||
|
||||
void
|
||||
__shared_count::__add_shared()
|
||||
__shared_count::__add_shared() _NOEXCEPT
|
||||
{
|
||||
increment(__shared_owners_);
|
||||
}
|
||||
|
||||
bool
|
||||
__shared_count::__release_shared()
|
||||
__shared_count::__release_shared() _NOEXCEPT
|
||||
{
|
||||
if (decrement(__shared_owners_) == -1)
|
||||
{
|
||||
@@ -66,33 +66,33 @@ __shared_weak_count::~__shared_weak_count()
|
||||
}
|
||||
|
||||
void
|
||||
__shared_weak_count::__add_shared()
|
||||
__shared_weak_count::__add_shared() _NOEXCEPT
|
||||
{
|
||||
__shared_count::__add_shared();
|
||||
}
|
||||
|
||||
void
|
||||
__shared_weak_count::__add_weak()
|
||||
__shared_weak_count::__add_weak() _NOEXCEPT
|
||||
{
|
||||
increment(__shared_weak_owners_);
|
||||
}
|
||||
|
||||
void
|
||||
__shared_weak_count::__release_shared()
|
||||
__shared_weak_count::__release_shared() _NOEXCEPT
|
||||
{
|
||||
if (__shared_count::__release_shared())
|
||||
__release_weak();
|
||||
}
|
||||
|
||||
void
|
||||
__shared_weak_count::__release_weak()
|
||||
__shared_weak_count::__release_weak() _NOEXCEPT
|
||||
{
|
||||
if (decrement(__shared_weak_owners_) == -1)
|
||||
__on_zero_shared_weak();
|
||||
}
|
||||
|
||||
__shared_weak_count*
|
||||
__shared_weak_count::lock()
|
||||
__shared_weak_count::lock() _NOEXCEPT
|
||||
{
|
||||
long object_owners = __shared_owners_;
|
||||
while (object_owners != -1)
|
||||
@@ -112,7 +112,7 @@ __shared_weak_count::lock()
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
|
||||
const void*
|
||||
__shared_weak_count::__get_deleter(const type_info&) const
|
||||
__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ undeclare_no_pointers(char*, size_t)
|
||||
}
|
||||
|
||||
pointer_safety
|
||||
get_pointer_safety()
|
||||
get_pointer_safety() _NOEXCEPT
|
||||
{
|
||||
return pointer_safety::relaxed;
|
||||
}
|
||||
|
32
src/new.cpp
32
src/new.cpp
@@ -27,7 +27,7 @@
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void *
|
||||
operator new(std::size_t size) throw (std::bad_alloc)
|
||||
operator new(std::size_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
@@ -51,7 +51,7 @@ operator new(std::size_t size) throw (std::bad_alloc)
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void*
|
||||
operator new(size_t size, const std::nothrow_t&) throw()
|
||||
operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
|
||||
{
|
||||
void* p = 0;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -70,14 +70,14 @@ operator new(size_t size, const std::nothrow_t&) throw()
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void*
|
||||
operator new[](size_t size) throw (std::bad_alloc)
|
||||
operator new[](size_t size)
|
||||
{
|
||||
return ::operator new(size);
|
||||
}
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void*
|
||||
operator new[](size_t size, const std::nothrow_t& nothrow) throw()
|
||||
operator new[](size_t size, const std::nothrow_t& nothrow) _NOEXCEPT
|
||||
{
|
||||
void* p = 0;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -96,7 +96,7 @@ operator new[](size_t size, const std::nothrow_t& nothrow) throw()
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void
|
||||
operator delete(void* ptr) throw ()
|
||||
operator delete(void* ptr) _NOEXCEPT
|
||||
{
|
||||
if (ptr)
|
||||
::free(ptr);
|
||||
@@ -104,21 +104,21 @@ operator delete(void* ptr) throw ()
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void
|
||||
operator delete(void* ptr, const std::nothrow_t&) throw ()
|
||||
operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
|
||||
{
|
||||
::operator delete(ptr);
|
||||
}
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void
|
||||
operator delete[] (void* ptr) throw ()
|
||||
operator delete[] (void* ptr) _NOEXCEPT
|
||||
{
|
||||
::operator delete (ptr);
|
||||
}
|
||||
|
||||
__attribute__((__weak__, __visibility__("default")))
|
||||
void
|
||||
operator delete[] (void* ptr, const std::nothrow_t&) throw ()
|
||||
operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
|
||||
{
|
||||
::operator delete[](ptr);
|
||||
}
|
||||
@@ -129,41 +129,41 @@ namespace std
|
||||
const nothrow_t nothrow = {};
|
||||
|
||||
new_handler
|
||||
set_new_handler(new_handler handler) throw()
|
||||
set_new_handler(new_handler handler) _NOEXCEPT
|
||||
{
|
||||
return __sync_lock_test_and_set(&__new_handler, handler);
|
||||
}
|
||||
|
||||
new_handler
|
||||
get_new_handler() throw()
|
||||
get_new_handler() _NOEXCEPT
|
||||
{
|
||||
return __sync_fetch_and_add(&__new_handler, (new_handler)0);
|
||||
}
|
||||
|
||||
bad_alloc::bad_alloc() throw()
|
||||
bad_alloc::bad_alloc() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_alloc::~bad_alloc() throw()
|
||||
bad_alloc::~bad_alloc() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
bad_alloc::what() const throw()
|
||||
bad_alloc::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_alloc";
|
||||
}
|
||||
|
||||
bad_array_new_length::bad_array_new_length() throw()
|
||||
bad_array_new_length::bad_array_new_length() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_array_new_length::~bad_array_new_length() throw()
|
||||
bad_array_new_length::~bad_array_new_length() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
bad_array_new_length::what() const throw()
|
||||
bad_array_new_length::what() const _NOEXCEPT
|
||||
{
|
||||
return "bad_array_new_length";
|
||||
}
|
||||
|
@@ -34,13 +34,13 @@ private:
|
||||
static const std::ptrdiff_t offset = static_cast<std::ptrdiff_t>(2*sizeof(unused_t) +
|
||||
sizeof(count_t));
|
||||
|
||||
count_t& count() const throw() {return (count_t&)(*(str_ - sizeof(count_t)));}
|
||||
count_t& count() const _NOEXCEPT {return (count_t&)(*(str_ - sizeof(count_t)));}
|
||||
public:
|
||||
explicit __libcpp_nmstr(const char* msg);
|
||||
__libcpp_nmstr(const __libcpp_nmstr& s) _LIBCPP_CANTTHROW;
|
||||
__libcpp_nmstr& operator=(const __libcpp_nmstr& s) _LIBCPP_CANTTHROW;
|
||||
~__libcpp_nmstr() _LIBCPP_CANTTHROW;
|
||||
const char* c_str() const throw() {return str_;}
|
||||
const char* c_str() const _NOEXCEPT {return str_;}
|
||||
};
|
||||
|
||||
__libcpp_nmstr::__libcpp_nmstr(const char* msg)
|
||||
@@ -98,14 +98,14 @@ logic_error::logic_error(const char* msg)
|
||||
::new(&s) __libcpp_nmstr(msg);
|
||||
}
|
||||
|
||||
logic_error::logic_error(const logic_error& le) throw()
|
||||
logic_error::logic_error(const logic_error& le) _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
|
||||
::new(&s) __libcpp_nmstr((const __libcpp_nmstr&)le.__imp_);
|
||||
}
|
||||
|
||||
logic_error&
|
||||
logic_error::operator=(const logic_error& le) throw()
|
||||
logic_error::operator=(const logic_error& le) _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s1 = (__libcpp_nmstr&)__imp_;
|
||||
const __libcpp_nmstr& s2 = (const __libcpp_nmstr&)le.__imp_;
|
||||
@@ -113,14 +113,14 @@ logic_error::operator=(const logic_error& le) throw()
|
||||
return *this;
|
||||
}
|
||||
|
||||
logic_error::~logic_error() throw()
|
||||
logic_error::~logic_error() _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
|
||||
s.~__libcpp_nmstr();
|
||||
}
|
||||
|
||||
const char*
|
||||
logic_error::what() const throw()
|
||||
logic_error::what() const _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
|
||||
return s.c_str();
|
||||
@@ -138,14 +138,14 @@ runtime_error::runtime_error(const char* msg)
|
||||
::new(&s) __libcpp_nmstr(msg);
|
||||
}
|
||||
|
||||
runtime_error::runtime_error(const runtime_error& le) throw()
|
||||
runtime_error::runtime_error(const runtime_error& le) _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
|
||||
::new(&s) __libcpp_nmstr((const __libcpp_nmstr&)le.__imp_);
|
||||
}
|
||||
|
||||
runtime_error&
|
||||
runtime_error::operator=(const runtime_error& le) throw()
|
||||
runtime_error::operator=(const runtime_error& le) _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s1 = (__libcpp_nmstr&)__imp_;
|
||||
const __libcpp_nmstr& s2 = (const __libcpp_nmstr&)le.__imp_;
|
||||
@@ -153,26 +153,26 @@ runtime_error::operator=(const runtime_error& le) throw()
|
||||
return *this;
|
||||
}
|
||||
|
||||
runtime_error::~runtime_error() throw()
|
||||
runtime_error::~runtime_error() _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
|
||||
s.~__libcpp_nmstr();
|
||||
}
|
||||
|
||||
const char*
|
||||
runtime_error::what() const throw()
|
||||
runtime_error::what() const _NOEXCEPT
|
||||
{
|
||||
__libcpp_nmstr& s = (__libcpp_nmstr&)__imp_;
|
||||
return s.c_str();
|
||||
}
|
||||
|
||||
domain_error::~domain_error() throw() {}
|
||||
invalid_argument::~invalid_argument() throw() {}
|
||||
length_error::~length_error() throw() {}
|
||||
out_of_range::~out_of_range() throw() {}
|
||||
domain_error::~domain_error() _NOEXCEPT {}
|
||||
invalid_argument::~invalid_argument() _NOEXCEPT {}
|
||||
length_error::~length_error() _NOEXCEPT {}
|
||||
out_of_range::~out_of_range() _NOEXCEPT {}
|
||||
|
||||
range_error::~range_error() throw() {}
|
||||
overflow_error::~overflow_error() throw() {}
|
||||
underflow_error::~underflow_error() throw() {}
|
||||
range_error::~range_error() _NOEXCEPT {}
|
||||
overflow_error::~overflow_error() _NOEXCEPT {}
|
||||
underflow_error::~underflow_error() _NOEXCEPT {}
|
||||
|
||||
} // std
|
||||
|
@@ -15,28 +15,28 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// class error_category
|
||||
|
||||
error_category::error_category()
|
||||
error_category::error_category() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
error_category::~error_category()
|
||||
error_category::~error_category() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
error_condition
|
||||
error_category::default_error_condition(int ev) const
|
||||
error_category::default_error_condition(int ev) const _NOEXCEPT
|
||||
{
|
||||
return error_condition(ev, *this);
|
||||
}
|
||||
|
||||
bool
|
||||
error_category::equivalent(int code, const error_condition& condition) const
|
||||
error_category::equivalent(int code, const error_condition& condition) const _NOEXCEPT
|
||||
{
|
||||
return default_error_condition(code) == condition;
|
||||
}
|
||||
|
||||
bool
|
||||
error_category::equivalent(const error_code& code, int condition) const
|
||||
error_category::equivalent(const error_code& code, int condition) const _NOEXCEPT
|
||||
{
|
||||
return *this == code.category() && code.value() == condition;
|
||||
}
|
||||
@@ -51,12 +51,12 @@ class _LIBCPP_HIDDEN __generic_error_category
|
||||
: public __do_message
|
||||
{
|
||||
public:
|
||||
virtual const char* name() const;
|
||||
virtual const char* name() const _NOEXCEPT;
|
||||
virtual string message(int ev) const;
|
||||
};
|
||||
|
||||
const char*
|
||||
__generic_error_category::name() const
|
||||
__generic_error_category::name() const _NOEXCEPT
|
||||
{
|
||||
return "generic";
|
||||
}
|
||||
@@ -72,7 +72,7 @@ __generic_error_category::message(int ev) const
|
||||
}
|
||||
|
||||
const error_category&
|
||||
generic_category()
|
||||
generic_category() _NOEXCEPT
|
||||
{
|
||||
static __generic_error_category s;
|
||||
return s;
|
||||
@@ -82,13 +82,13 @@ class _LIBCPP_HIDDEN __system_error_category
|
||||
: public __do_message
|
||||
{
|
||||
public:
|
||||
virtual const char* name() const;
|
||||
virtual const char* name() const _NOEXCEPT;
|
||||
virtual string message(int ev) const;
|
||||
virtual error_condition default_error_condition(int ev) const;
|
||||
virtual error_condition default_error_condition(int ev) const _NOEXCEPT;
|
||||
};
|
||||
|
||||
const char*
|
||||
__system_error_category::name() const
|
||||
__system_error_category::name() const _NOEXCEPT
|
||||
{
|
||||
return "system";
|
||||
}
|
||||
@@ -104,7 +104,7 @@ __system_error_category::message(int ev) const
|
||||
}
|
||||
|
||||
error_condition
|
||||
__system_error_category::default_error_condition(int ev) const
|
||||
__system_error_category::default_error_condition(int ev) const _NOEXCEPT
|
||||
{
|
||||
#ifdef ELAST
|
||||
if (ev > ELAST)
|
||||
@@ -114,7 +114,7 @@ __system_error_category::default_error_condition(int ev) const
|
||||
}
|
||||
|
||||
const error_category&
|
||||
system_category()
|
||||
system_category() _NOEXCEPT
|
||||
{
|
||||
static __system_error_category s;
|
||||
return s;
|
||||
@@ -186,7 +186,7 @@ system_error::system_error(int ev, const error_category& ecat)
|
||||
{
|
||||
}
|
||||
|
||||
system_error::~system_error() throw()
|
||||
system_error::~system_error() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -13,30 +13,30 @@
|
||||
|
||||
#include "typeinfo"
|
||||
|
||||
std::bad_cast::bad_cast() throw()
|
||||
std::bad_cast::bad_cast() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
std::bad_cast::~bad_cast() throw()
|
||||
std::bad_cast::~bad_cast() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
std::bad_cast::what() const throw()
|
||||
std::bad_cast::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_cast";
|
||||
}
|
||||
|
||||
std::bad_typeid::bad_typeid() throw()
|
||||
std::bad_typeid::bad_typeid() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
std::bad_typeid::~bad_typeid() throw()
|
||||
std::bad_typeid::~bad_typeid() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
std::bad_typeid::what() const throw()
|
||||
std::bad_typeid::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_typeid";
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user