Compare commits
1 Commits
svn-tags/l
...
svn-tags/l
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9789163feb |
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ export TRIPLE=-apple-
|
||||
installsrc:: $(SRCROOT)
|
||||
|
||||
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
||||
ditto $(SRCDIRS)/lib $(SRCROOT)/lib
|
||||
ditto $(SRCDIRS)/lib/buildit $(SRCROOT)/lib/buildit
|
||||
ditto $(SRCDIRS)/src $(SRCROOT)/src
|
||||
ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile
|
||||
|
||||
|
@@ -1028,7 +1028,6 @@ __equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __la
|
||||
}
|
||||
|
||||
template <class _C, bool _IC1, bool _IC2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
equal(__bit_iterator<_C, _IC1> __first1, __bit_iterator<_C, _IC1> __last1, __bit_iterator<_C, _IC2> __first2)
|
||||
{
|
||||
|
@@ -86,18 +86,6 @@
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
#ifdef __linux__
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#else
|
||||
typedef __char16_t char16_t;
|
||||
typedef __char32_t char32_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_exceptions))
|
||||
#define _LIBCPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
@@ -106,66 +94,48 @@ typedef __char32_t char32_t;
|
||||
#define _LIBCPP_NO_RTTI
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#define _LIBCPP_HAS_NO_STRONG_USING
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#define _LIBCPP_HAS_NO_DECLTYPE
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_NULLPTR
|
||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#else // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#if __has_feature(cxx_rvalue_references)
|
||||
#define _LIBCPP_MOVE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_decltype))
|
||||
#define _LIBCPP_HAS_NO_DECLTYPE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_attributes))
|
||||
#define _LIBCPP_HAS_NO_ATTRIBUTES
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
#if !(__has_feature(cxx_deleted_functions))
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#endif // !(__has_feature(cxx_deleted_functions))
|
||||
|
||||
#if !(__has_feature(cxx_lambdas))
|
||||
#define _LIBCPP_HAS_NO_LAMBDAS
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_nullptr))
|
||||
#define _LIBCPP_HAS_NO_NULLPTR
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_rvalue_references))
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_static_assert))
|
||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_auto_type))
|
||||
#define _LIBCPP_HAS_NO_AUTO_TYPE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_variadic_templates))
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif
|
||||
|
||||
#if __has_feature(cxx_inline_namespaces)
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
|
||||
#define _LIBCPP_END_NAMESPACE_STD } }
|
||||
#define _STD std::_LIBCPP_NAMESPACE
|
||||
|
||||
namespace std {
|
||||
inline namespace _LIBCPP_NAMESPACE {
|
||||
}
|
||||
using namespace _LIBCPP_NAMESPACE;
|
||||
}
|
||||
|
||||
#else // __has_feature(cxx_inline_namespaces)
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
|
||||
#define _LIBCPP_END_NAMESPACE_STD }
|
||||
#define _STD std
|
||||
#endif // __has_feature(cxx_inline_namespaces)
|
||||
|
||||
#if !(__has_feature(cxx_constexpr))
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
#endif
|
||||
|
||||
// end defined(__clang__)
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
@@ -174,7 +144,6 @@ using namespace _LIBCPP_NAMESPACE;
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
@@ -186,12 +155,11 @@ using namespace _LIBCPP_NAMESPACE;
|
||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#else // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
|
||||
#define _LIBCPP_MOVE
|
||||
#endif
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
||||
@@ -213,6 +181,13 @@ using namespace _LIBCPP_NAMESPACE;
|
||||
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#endif // defined(__GNUC__)
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_STRONG_USING
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
|
||||
#define _LIBCPP_END_NAMESPACE_STD }
|
||||
#define _STD std
|
||||
#else // _LIBCPP_HAS_NO_STRONG_USING
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
|
||||
#define _LIBCPP_END_NAMESPACE_STD } }
|
||||
#define _STD std::_LIBCPP_NAMESPACE
|
||||
@@ -223,7 +198,7 @@ namespace _LIBCPP_NAMESPACE {
|
||||
using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
|
||||
}
|
||||
|
||||
#endif // defined(__GNUC__)
|
||||
#endif // _LIBCPP_HAS_NO_STRONG_USING
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
typedef unsigned short char16_t;
|
||||
@@ -245,12 +220,4 @@ template <unsigned> struct __static_assert_check {};
|
||||
#define decltype(x) __typeof__(x)
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||
#define constexpr const
|
||||
#endif
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(__x) 0
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CONFIG
|
||||
|
@@ -196,12 +196,12 @@ mem_fn(_R (_T::* __pm)(_A0, _A1, _A2) const volatile)
|
||||
|
||||
// bad_function_call
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_function_call
|
||||
class bad_function_call
|
||||
: public exception
|
||||
{
|
||||
};
|
||||
|
||||
template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
|
||||
template<class _Fp> class function; // undefined
|
||||
|
||||
namespace __function
|
||||
{
|
||||
@@ -396,9 +396,8 @@ class __func<_F, _Alloc, _R(_A0)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -479,9 +478,8 @@ class __func<_F, _Alloc, _R(_A0, _A1)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0, _A1)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0, _A1)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -562,9 +560,8 @@ class __func<_F, _Alloc, _R(_A0, _A1, _A2)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0, _A1, _A2)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0, _A1, _A2)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -642,7 +639,7 @@ __func<_F, _Alloc, _R(_A0, _A1, _A2)>::target_type() const
|
||||
} // __function
|
||||
|
||||
template<class _R>
|
||||
class _LIBCPP_VISIBLE function<_R()>
|
||||
class function<_R()>
|
||||
{
|
||||
typedef __function::__base<_R()> __base;
|
||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||
@@ -656,18 +653,16 @@ public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -690,19 +685,18 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
// 20.7.16.2.3, function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;}
|
||||
operator bool() const {return __f_;}
|
||||
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2>
|
||||
bool operator==(const function<_R2()>&) const;// = delete;
|
||||
bool operator==(const function<_R2()>&);// = delete;
|
||||
template<class _R2>
|
||||
bool operator!=(const function<_R2()>&) const;// = delete;
|
||||
bool operator!=(const function<_R2()>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()() const;
|
||||
@@ -926,7 +920,7 @@ function<_R()>::target() const
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _R, class _A0>
|
||||
class _LIBCPP_VISIBLE function<_R(_A0)>
|
||||
class function<_R(_A0)>
|
||||
: public unary_function<_A0, _R>
|
||||
{
|
||||
typedef __function::__base<_R(_A0)> __base;
|
||||
@@ -934,42 +928,33 @@ class _LIBCPP_VISIBLE function<_R(_A0)>
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class _B0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_B0)) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)()) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)() const) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)() volatile) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)() const volatile) {return __p;}
|
||||
template <class _R2, class _B0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_B0)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -992,19 +977,18 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
// 20.7.16.2.3, function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;}
|
||||
operator bool() const {return __f_;}
|
||||
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class _B0>
|
||||
bool operator==(const function<_R2(_B0)>&) const;// = delete;
|
||||
bool operator==(const function<_R2(_B0)>&);// = delete;
|
||||
template<class _R2, class _B0>
|
||||
bool operator!=(const function<_R2(_B0)>&) const;// = delete;
|
||||
bool operator!=(const function<_R2(_B0)>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()(_A0) const;
|
||||
@@ -1228,7 +1212,7 @@ function<_R(_A0)>::target() const
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _R, class _A0, class _A1>
|
||||
class _LIBCPP_VISIBLE function<_R(_A0, _A1)>
|
||||
class function<_R(_A0, _A1)>
|
||||
: public binary_function<_A0, _A1, _R>
|
||||
{
|
||||
typedef __function::__base<_R(_A0, _A1)> __base;
|
||||
@@ -1236,42 +1220,33 @@ class _LIBCPP_VISIBLE function<_R(_A0, _A1)>
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class _B0, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_B0, _B1)) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1)) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1) const) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1) volatile) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1) const volatile) {return __p;}
|
||||
template <class _R2, class _B0, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_B0, _B1)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -1294,7 +1269,6 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
@@ -1304,9 +1278,9 @@ public:
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class _B0, class _B1>
|
||||
bool operator==(const function<_R2(_B0, _B1)>&) const;// = delete;
|
||||
bool operator==(const function<_R2(_B0, _B1)>&);// = delete;
|
||||
template<class _R2, class _B0, class _B1>
|
||||
bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete;
|
||||
bool operator!=(const function<_R2(_B0, _B1)>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()(_A0, _A1) const;
|
||||
@@ -1530,49 +1504,40 @@ function<_R(_A0, _A1)>::target() const
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _R, class _A0, class _A1, class _A2>
|
||||
class _LIBCPP_VISIBLE function<_R(_A0, _A1, _A2)>
|
||||
class function<_R(_A0, _A1, _A2)>
|
||||
{
|
||||
typedef __function::__base<_R(_A0, _A1, _A2)> __base;
|
||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class _B0, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_B0, _B1, _B2)) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2)) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2) const) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2) volatile) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2) const volatile) {return __p;}
|
||||
template <class _R2, class _B0, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_B0, _B1, _B2)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -1595,19 +1560,18 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
// 20.7.16.2.3, function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;}
|
||||
operator bool() const {return __f_;}
|
||||
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class _B0, class _B1, class _B2>
|
||||
bool operator==(const function<_R2(_B0, _B1, _B2)>&) const;// = delete;
|
||||
bool operator==(const function<_R2(_B0, _B1, _B2)>&);// = delete;
|
||||
template<class _R2, class _B0, class _B1, class _B2>
|
||||
bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete;
|
||||
bool operator!=(const function<_R2(_B0, _B1, _B2)>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()(_A0, _A1, _A2) const;
|
||||
@@ -1858,11 +1822,11 @@ swap(function<_F>& __x, function<_F>& __y)
|
||||
{return __x.swap(__y);}
|
||||
|
||||
template<class _Tp> struct __is_bind_expression : public false_type {};
|
||||
template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
|
||||
template<class _Tp> struct is_bind_expression
|
||||
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
||||
|
||||
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
||||
template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
|
||||
template<class _Tp> struct is_placeholder
|
||||
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
||||
|
||||
namespace placeholders
|
||||
|
@@ -21,21 +21,21 @@
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Arg, class _Result>
|
||||
struct _LIBCPP_VISIBLE unary_function
|
||||
struct unary_function
|
||||
{
|
||||
typedef _Arg argument_type;
|
||||
typedef _Result result_type;
|
||||
};
|
||||
|
||||
template <class _Arg1, class _Arg2, class _Result>
|
||||
struct _LIBCPP_VISIBLE binary_function
|
||||
struct binary_function
|
||||
{
|
||||
typedef _Arg1 first_argument_type;
|
||||
typedef _Arg2 second_argument_type;
|
||||
typedef _Result result_type;
|
||||
};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
||||
template <class _Tp> struct hash;
|
||||
|
||||
template <class _Tp>
|
||||
struct __has_result_type
|
||||
@@ -306,7 +306,7 @@ typename enable_if
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return (_STD::forward<const _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
@@ -319,7 +319,7 @@ typename enable_if
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return (_STD::forward<volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
@@ -332,7 +332,7 @@ typename enable_if
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return (_STD::forward<const volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// second bullet
|
||||
@@ -445,7 +445,7 @@ struct __invoke_return
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE reference_wrapper
|
||||
class reference_wrapper
|
||||
: public __weak_result_type<_Tp>
|
||||
{
|
||||
public:
|
||||
@@ -457,7 +457,7 @@ private:
|
||||
public:
|
||||
// construct/copy/destroy
|
||||
_LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) : __f_(&__f) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
|
||||
#endif
|
||||
|
||||
@@ -467,7 +467,6 @@ public:
|
||||
|
||||
// invoke
|
||||
template <class... _ArgTypes>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return<type&, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args) const
|
||||
{
|
||||
@@ -512,20 +511,10 @@ cref(reference_wrapper<_Tp> __t)
|
||||
return cref(__t.get());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
|
||||
template <class _Tp> void ref(const _Tp&& __t) = delete;
|
||||
template <class _Tp> void cref(const _Tp&& __t) = delete;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
|
||||
template <class _Tp> void ref(const _Tp&& __t);// = delete;
|
||||
template <class _Tp> void cref(const _Tp&& __t);// = delete;
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Tp> void ref(const _Tp&& __t);// = delete; // LWG 688
|
||||
template <class _Tp> void cref(const _Tp&& __t);// = delete; // LWG 688
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
|
@@ -873,7 +873,7 @@ __invoke(_R _T::* __f, _T1& __t1)
|
||||
|
||||
template <class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()())
|
||||
typename result_of<_F()>::type
|
||||
__invoke(_F __f)
|
||||
{
|
||||
return __f();
|
||||
@@ -881,7 +881,7 @@ __invoke(_F __f)
|
||||
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()(declval<_A0&>()))
|
||||
typename result_of<_F(_A0)>::type
|
||||
__invoke(_F __f, _A0& __a0)
|
||||
{
|
||||
return __f(__a0);
|
||||
@@ -889,7 +889,7 @@ __invoke(_F __f, _A0& __a0)
|
||||
|
||||
template <class _F, class _A0, class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>()))
|
||||
typename result_of<_F(_A0, _A1)>::type
|
||||
__invoke(_F __f, _A0& __a0, _A1& __a1)
|
||||
{
|
||||
return __f(__a0, __a1);
|
||||
@@ -897,7 +897,7 @@ __invoke(_F __f, _A0& __a0, _A1& __a1)
|
||||
|
||||
template <class _F, class _A0, class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>()))
|
||||
typename result_of<_F(_A0, _A1, _A2)>::type
|
||||
__invoke(_F __f, _A0& __a0, _A1& __a1, _A2& __a2)
|
||||
{
|
||||
return __f(__a0, __a1, __a2);
|
||||
@@ -996,7 +996,7 @@ struct __invoke_return2
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE reference_wrapper
|
||||
class reference_wrapper
|
||||
: public __weak_result_type<_Tp>
|
||||
{
|
||||
public:
|
||||
@@ -1015,7 +1015,6 @@ public:
|
||||
|
||||
// invoke
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return<type&>::type
|
||||
operator() () const
|
||||
{
|
||||
@@ -1023,7 +1022,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _A0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return0<type&, _A0>::type
|
||||
operator() (_A0& __a0) const
|
||||
{
|
||||
@@ -1031,7 +1029,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _A0, class _A1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return1<type&, _A0, _A1>::type
|
||||
operator() (_A0& __a0, _A1& __a1) const
|
||||
{
|
||||
@@ -1039,7 +1036,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _A0, class _A1, class _A2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return2<type&, _A0, _A1, _A2>::type
|
||||
operator() (_A0& __a0, _A1& __a1, _A2& __a2) const
|
||||
{
|
||||
|
@@ -22,7 +22,6 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
size_t __next_prime(size_t);
|
||||
|
||||
template <class _NodePtr>
|
||||
@@ -33,7 +32,7 @@ struct __hash_node_base
|
||||
|
||||
pointer __next_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_node_base() : __next_(nullptr) {}
|
||||
__hash_node_base() : __next_(nullptr) {}
|
||||
};
|
||||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
@@ -58,10 +57,10 @@ template <class, class, class, class> class __hash_table;
|
||||
template <class> class __hash_const_iterator;
|
||||
template <class> class __hash_map_iterator;
|
||||
template <class> class __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> class _LIBCPP_VISIBLE unordered_map;
|
||||
template <class, class, class, class, class> class unordered_map;
|
||||
|
||||
template <class _NodePtr>
|
||||
class _LIBCPP_VISIBLE __hash_iterator
|
||||
class __hash_iterator
|
||||
{
|
||||
typedef _NodePtr __node_pointer;
|
||||
|
||||
@@ -80,21 +79,17 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_iterator() {}
|
||||
__hash_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return addressof(__node_->__value_);}
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
pointer operator->() const {return addressof(__node_->__value_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_iterator& operator++()
|
||||
{
|
||||
__node_ = __node_->__next_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_iterator operator++(int)
|
||||
{
|
||||
__hash_iterator __t(*this);
|
||||
@@ -102,28 +97,25 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_iterator& __x, const __hash_iterator& __y)
|
||||
friend bool operator==(const __hash_iterator& __x, const __hash_iterator& __y)
|
||||
{return __x.__node_ == __y.__node_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_iterator& __x, const __hash_iterator& __y)
|
||||
friend bool operator!=(const __hash_iterator& __x, const __hash_iterator& __y)
|
||||
{return __x.__node_ != __y.__node_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_iterator(__node_pointer __node)
|
||||
: __node_(__node)
|
||||
{}
|
||||
|
||||
template <class, class, class, class> friend class __hash_table;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_map_iterator;
|
||||
template <class, class, class, class, class> friend class unordered_map;
|
||||
template <class, class, class, class, class> friend class unordered_multimap;
|
||||
};
|
||||
|
||||
template <class _ConstNodePtr>
|
||||
class _LIBCPP_VISIBLE __hash_const_iterator
|
||||
class __hash_const_iterator
|
||||
{
|
||||
typedef _ConstNodePtr __node_pointer;
|
||||
|
||||
@@ -154,25 +146,20 @@ 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() {}
|
||||
__hash_const_iterator(const __non_const_iterator& __x)
|
||||
: __node_(__x.__node_)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return addressof(__node_->__value_);}
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
pointer operator->() const {return addressof(__node_->__value_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_iterator& operator++()
|
||||
{
|
||||
__node_ = __node_->__next_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_iterator operator++(int)
|
||||
{
|
||||
__hash_const_iterator __t(*this);
|
||||
@@ -180,29 +167,26 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_const_iterator& __x, const __hash_const_iterator& __y)
|
||||
friend bool operator==(const __hash_const_iterator& __x, const __hash_const_iterator& __y)
|
||||
{return __x.__node_ == __y.__node_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_const_iterator& __x, const __hash_const_iterator& __y)
|
||||
friend bool operator!=(const __hash_const_iterator& __x, const __hash_const_iterator& __y)
|
||||
{return __x.__node_ != __y.__node_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_iterator(__node_pointer __node)
|
||||
: __node_(__node)
|
||||
{}
|
||||
|
||||
template <class, class, class, class> friend class __hash_table;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
||||
template <class> friend class __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> friend class unordered_map;
|
||||
template <class, class, class, class, class> friend class unordered_multimap;
|
||||
};
|
||||
|
||||
template <class> class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class> class __hash_const_local_iterator;
|
||||
|
||||
template <class _NodePtr>
|
||||
class _LIBCPP_VISIBLE __hash_local_iterator
|
||||
class __hash_local_iterator
|
||||
{
|
||||
typedef _NodePtr __node_pointer;
|
||||
|
||||
@@ -224,14 +208,11 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() {}
|
||||
__hash_local_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &__node_->__value_;}
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
pointer operator->() const {return &__node_->__value_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_local_iterator& operator++()
|
||||
{
|
||||
__node_ = __node_->__next_;
|
||||
@@ -240,7 +221,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_local_iterator operator++(int)
|
||||
{
|
||||
__hash_local_iterator __t(*this);
|
||||
@@ -248,15 +228,12 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_local_iterator& __x, const __hash_local_iterator& __y)
|
||||
friend bool operator==(const __hash_local_iterator& __x, const __hash_local_iterator& __y)
|
||||
{return __x.__node_ == __y.__node_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_local_iterator& __x, const __hash_local_iterator& __y)
|
||||
friend bool operator!=(const __hash_local_iterator& __x, const __hash_local_iterator& __y)
|
||||
{return __x.__node_ != __y.__node_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_local_iterator(__node_pointer __node, size_t __bucket,
|
||||
size_t __bucket_count)
|
||||
: __node_(__node),
|
||||
@@ -268,12 +245,12 @@ private:
|
||||
}
|
||||
|
||||
template <class, class, class, class> friend class __hash_table;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
template <class> friend class __hash_map_iterator;
|
||||
};
|
||||
|
||||
template <class _ConstNodePtr>
|
||||
class _LIBCPP_VISIBLE __hash_const_local_iterator
|
||||
class __hash_const_local_iterator
|
||||
{
|
||||
typedef _ConstNodePtr __node_pointer;
|
||||
|
||||
@@ -308,20 +285,16 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_local_iterator() {}
|
||||
__hash_const_local_iterator(const __non_const_iterator& __x)
|
||||
: __node_(__x.__node_),
|
||||
__bucket_(__x.__bucket_),
|
||||
__bucket_count_(__x.__bucket_count_)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &__node_->__value_;}
|
||||
reference operator*() const {return __node_->__value_;}
|
||||
pointer operator->() const {return &__node_->__value_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_local_iterator& operator++()
|
||||
{
|
||||
__node_ = __node_->__next_;
|
||||
@@ -330,7 +303,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_local_iterator operator++(int)
|
||||
{
|
||||
__hash_const_local_iterator __t(*this);
|
||||
@@ -338,15 +310,12 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_const_local_iterator& __x, const __hash_const_local_iterator& __y)
|
||||
friend bool operator==(const __hash_const_local_iterator& __x, const __hash_const_local_iterator& __y)
|
||||
{return __x.__node_ == __y.__node_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_const_local_iterator& __x, const __hash_const_local_iterator& __y)
|
||||
friend bool operator!=(const __hash_const_local_iterator& __x, const __hash_const_local_iterator& __y)
|
||||
{return __x.__node_ != __y.__node_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_const_local_iterator(__node_pointer __node, size_t __bucket,
|
||||
size_t __bucket_count)
|
||||
: __node_(__node),
|
||||
@@ -358,7 +327,7 @@ private:
|
||||
}
|
||||
|
||||
template <class, class, class, class> friend class __hash_table;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
||||
template <class> friend class __hash_map_const_iterator;
|
||||
};
|
||||
|
||||
template <class _Alloc>
|
||||
@@ -372,32 +341,27 @@ class __bucket_list_deallocator
|
||||
public:
|
||||
typedef typename __alloc_traits::pointer pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator()
|
||||
: __data_(0) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator(const allocator_type& __a, size_type __size)
|
||||
: __data_(__size, __a) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bucket_list_deallocator(__bucket_list_deallocator&& __x)
|
||||
: __data_(_STD::move(__x.__data_))
|
||||
{
|
||||
__x.size() = 0;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type& size() {return __data_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return __data_.first();}
|
||||
size_type& size() {return __data_.first();}
|
||||
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();}
|
||||
allocator_type& __alloc() {return __data_.second();}
|
||||
const allocator_type& __alloc() const {return __data_.second();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
__alloc_traits::deallocate(__alloc(), __p, size());
|
||||
@@ -423,13 +387,11 @@ private:
|
||||
public:
|
||||
bool __value_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_node_destructor(allocator_type& __na)
|
||||
: __na_(__na),
|
||||
__value_constructed(false)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
if (__value_constructed)
|
||||
@@ -495,21 +457,21 @@ private:
|
||||
__compressed_pair<float, key_equal> __p3_;
|
||||
// --- Member data end ---
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_type& size() {return __p2_.first();}
|
||||
size_type& size() {return __p2_.first();}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return __p2_.first();}
|
||||
size_type size() const {return __p2_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY hasher& hash_function() {return __p2_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const hasher& hash_function() const {return __p2_.second();}
|
||||
hasher& hash_function() {return __p2_.second();}
|
||||
const hasher& hash_function() const {return __p2_.second();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY float& max_load_factor() {return __p3_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY float max_load_factor() const {return __p3_.first();}
|
||||
float& max_load_factor() {return __p3_.first();}
|
||||
float max_load_factor() const {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();}
|
||||
key_equal& key_eq() {return __p3_.second();}
|
||||
const key_equal& key_eq() const {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();}
|
||||
__node_allocator& __node_alloc() {return __p1_.second();}
|
||||
const __node_allocator& __node_alloc() const {return __p1_.second();}
|
||||
|
||||
public:
|
||||
typedef __hash_iterator<__node_pointer> iterator;
|
||||
@@ -524,14 +486,14 @@ public:
|
||||
explicit __hash_table(const allocator_type& __a);
|
||||
__hash_table(const __hash_table& __u);
|
||||
__hash_table(const __hash_table& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__hash_table(__hash_table&& __u);
|
||||
__hash_table(__hash_table&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
~__hash_table();
|
||||
|
||||
__hash_table& operator=(const __hash_table& __u);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__hash_table& operator=(__hash_table&& __u);
|
||||
#endif
|
||||
template <class _InputIterator>
|
||||
@@ -539,7 +501,6 @@ public:
|
||||
template <class _InputIterator>
|
||||
void __assign_multi(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const
|
||||
{
|
||||
return allocator_traits<__pointer_allocator>::max_size(
|
||||
@@ -551,38 +512,36 @@ public:
|
||||
iterator __node_insert_multi(const_iterator __p,
|
||||
__node_pointer __nd);
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
pair<iterator, bool> __emplace_unique(_Args&&... __args);
|
||||
template <class... _Args>
|
||||
iterator __emplace_multi(_Args&&... __args);
|
||||
template <class... _Args>
|
||||
iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
pair<iterator, bool> __insert_unique(const value_type& __x);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P>
|
||||
pair<iterator, bool> __insert_unique(_P&& __x);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P>
|
||||
iterator __insert_multi(_P&& __x);
|
||||
template <class _P>
|
||||
iterator __insert_multi(const_iterator __p, _P&& __x);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
iterator __insert_multi(const value_type& __x);
|
||||
iterator __insert_multi(const_iterator __p, const value_type& __x);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void clear();
|
||||
void rehash(size_type __n);
|
||||
_LIBCPP_INLINE_VISIBILITY void reserve(size_type __n)
|
||||
void reserve(size_type __n)
|
||||
{rehash(static_cast<size_type>(ceil(__n / max_load_factor())));}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const
|
||||
{
|
||||
return __bucket_list_.get_deleter().size();
|
||||
@@ -594,7 +553,6 @@ public:
|
||||
const_iterator end() const;
|
||||
|
||||
template <class _Key>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket(const _Key& __k) const
|
||||
{return hash_function()(__k) % bucket_count();}
|
||||
|
||||
@@ -635,65 +593,57 @@ public:
|
||||
|
||||
void swap(__hash_table& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const
|
||||
{return __bucket_list_.get_deleter().__alloc().max_size();}
|
||||
size_type bucket_size(size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY float load_factor() const
|
||||
float load_factor() const
|
||||
{
|
||||
size_type __bc = bucket_count();
|
||||
return __bc != 0 ? (float)size() / __bc : 0.f;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf)
|
||||
void max_load_factor(float __mlf)
|
||||
{max_load_factor() = _STD::max(__mlf, load_factor());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY local_iterator begin(size_type __n)
|
||||
local_iterator begin(size_type __n)
|
||||
{return local_iterator(__bucket_list_[__n], __n, bucket_count());}
|
||||
_LIBCPP_INLINE_VISIBILITY local_iterator end(size_type __n)
|
||||
local_iterator end(size_type __n)
|
||||
{return local_iterator(nullptr, __n, bucket_count());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_local_iterator cbegin(size_type __n) const
|
||||
const_local_iterator cbegin(size_type __n) const
|
||||
{return const_local_iterator(__bucket_list_[__n], __n, bucket_count());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_local_iterator cend(size_type __n) const
|
||||
const_local_iterator cend(size_type __n) const
|
||||
{return const_local_iterator(nullptr, __n, bucket_count());}
|
||||
private:
|
||||
void __rehash(size_type __n);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class ..._Args>
|
||||
__node_holder __construct_node(_Args&& ...__args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
__node_holder __construct_node(value_type&& __v, size_t __hash);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
__node_holder __construct_node(const value_type& __v);
|
||||
#endif
|
||||
__node_holder __construct_node(const value_type& __v, size_t __hash);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __hash_table& __u)
|
||||
{__copy_assign_alloc(__u, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_copy_assignment::value>());}
|
||||
void __copy_assign_alloc(const __hash_table& __u, true_type);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __hash_table& __u, false_type) {}
|
||||
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_alloc(__hash_table& __u)
|
||||
{__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)
|
||||
{
|
||||
__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) {}
|
||||
|
||||
template <class _A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
void
|
||||
__swap_alloc(_A& __x, _A& __y)
|
||||
@@ -705,7 +655,6 @@ private:
|
||||
}
|
||||
|
||||
template <class _A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
void
|
||||
__swap_alloc(_A& __x, _A& __y, true_type)
|
||||
@@ -715,7 +664,6 @@ private:
|
||||
}
|
||||
|
||||
template <class _A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
void
|
||||
__swap_alloc(_A& __x, _A& __y, false_type) {}
|
||||
@@ -725,7 +673,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
|
||||
: __p2_(0),
|
||||
__p3_(1.0f)
|
||||
@@ -733,7 +681,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const hasher& __hf,
|
||||
const key_equal& __eql)
|
||||
: __bucket_list_(nullptr, __bucket_list_deleter()),
|
||||
@@ -786,7 +734,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
|
||||
@@ -829,7 +777,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
|
||||
@@ -894,7 +842,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach()
|
||||
return __cache;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
@@ -969,7 +917,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>&
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
|
||||
{
|
||||
@@ -978,7 +926,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
@@ -1049,7 +997,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin()
|
||||
{
|
||||
@@ -1057,7 +1005,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::begin()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end()
|
||||
{
|
||||
@@ -1065,7 +1013,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::end()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const
|
||||
{
|
||||
@@ -1073,7 +1021,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const
|
||||
}
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const
|
||||
{
|
||||
@@ -1297,8 +1245,7 @@ __done:
|
||||
return pair<iterator, bool>(iterator(__nd), __inserted);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
template <class... _Args>
|
||||
@@ -1335,8 +1282,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
|
||||
return __r;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
template <class _P>
|
||||
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
|
||||
@@ -1349,9 +1294,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_P&& __x)
|
||||
return __r;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
template <class _P>
|
||||
@@ -1376,7 +1321,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
|
||||
return __r;
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
|
||||
@@ -1399,7 +1344,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
|
||||
return __r;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
@@ -1523,8 +1468,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
|
||||
return end();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
template <class ..._Args>
|
||||
@@ -1540,8 +1484,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
|
||||
return __h;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
|
||||
@@ -1556,7 +1498,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
|
||||
@@ -1571,7 +1513,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
|
||||
@@ -1679,7 +1621,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p)
|
||||
|
||||
template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
template <class _Key>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::size_type
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__count_unique(const _Key& __k) const
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@ class locale;
|
||||
template <class _Facet> bool has_facet(const locale&) throw();
|
||||
template <class _Facet> const _Facet& use_facet(const locale&);
|
||||
|
||||
class _LIBCPP_VISIBLE locale
|
||||
class locale
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -89,11 +89,10 @@ private:
|
||||
template <class _Facet> friend const _Facet& use_facet(const locale&);
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE locale::facet
|
||||
class locale::facet
|
||||
: public __shared_count
|
||||
{
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit facet(size_t __refs = 0)
|
||||
: __shared_count(static_cast<long>(__refs)-1) {}
|
||||
|
||||
@@ -105,14 +104,14 @@ private:
|
||||
virtual void __on_zero_shared();
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE locale::id
|
||||
class locale::id
|
||||
{
|
||||
once_flag __flag_;
|
||||
int32_t __id_;
|
||||
|
||||
static int32_t __next_id;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY id() {}
|
||||
id() {}
|
||||
private:
|
||||
void __init();
|
||||
void operator=(const id&); // = delete;
|
||||
@@ -161,31 +160,27 @@ use_facet(const locale& __l)
|
||||
// template <class _CharT> class collate;
|
||||
|
||||
template <class _CharT>
|
||||
class _LIBCPP_VISIBLE collate
|
||||
class collate
|
||||
: public locale::facet
|
||||
{
|
||||
public:
|
||||
typedef _CharT char_type;
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit collate(size_t __refs = 0)
|
||||
: locale::facet(__refs) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(const char_type* __lo1, const char_type* __hi1,
|
||||
const char_type* __lo2, const char_type* __hi2) const
|
||||
{
|
||||
return do_compare(__lo1, __hi1, __lo2, __hi2);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type transform(const char_type* __lo, const char_type* __hi) const
|
||||
{
|
||||
return do_transform(__lo, __hi);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
long hash(const char_type* __lo, const char_type* __hi) const
|
||||
{
|
||||
return do_hash(__lo, __hi);
|
||||
@@ -240,15 +235,15 @@ collate<_CharT>::do_hash(const char_type* lo, const char_type* hi) const
|
||||
return static_cast<long>(h);
|
||||
}
|
||||
|
||||
extern template class _LIBCPP_VISIBLE collate<char>;
|
||||
extern template class _LIBCPP_VISIBLE collate<wchar_t>;
|
||||
extern template class collate<char>;
|
||||
extern template class collate<wchar_t>;
|
||||
|
||||
// template <class CharT> class collate_byname;
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE collate_byname;
|
||||
template <class _CharT> class collate_byname;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE collate_byname<char>
|
||||
class collate_byname<char>
|
||||
: public collate<char>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -267,7 +262,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE collate_byname<wchar_t>
|
||||
class collate_byname<wchar_t>
|
||||
: public collate<wchar_t>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -298,8 +293,7 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
|
||||
|
||||
// template <class charT> class ctype
|
||||
|
||||
class _LIBCPP_VISIBLE ctype_base
|
||||
{
|
||||
class ctype_base {
|
||||
public:
|
||||
typedef __uint32_t mask;
|
||||
|
||||
@@ -332,10 +326,10 @@ public:
|
||||
_LIBCPP_ALWAYS_INLINE ctype_base() {}
|
||||
};
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE ctype;
|
||||
template <class _CharT> class ctype;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype<wchar_t>
|
||||
class ctype<wchar_t>
|
||||
: public locale::facet,
|
||||
public ctype_base
|
||||
{
|
||||
@@ -437,7 +431,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype<char>
|
||||
class ctype<char>
|
||||
: public locale::facet, public ctype_base
|
||||
{
|
||||
const mask* __tab_;
|
||||
@@ -534,7 +528,7 @@ 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_;}
|
||||
const mask* table() const throw() {return __tab_;}
|
||||
static const mask* classic_table() throw();
|
||||
|
||||
protected:
|
||||
@@ -551,10 +545,10 @@ protected:
|
||||
|
||||
// template <class CharT> class ctype_byname;
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE ctype_byname;
|
||||
template <class _CharT> class ctype_byname;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype_byname<char>
|
||||
class ctype_byname<char>
|
||||
: public ctype<char>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -572,7 +566,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype_byname<wchar_t>
|
||||
class ctype_byname<wchar_t>
|
||||
: public ctype<wchar_t>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -703,7 +697,7 @@ tolower(_CharT __c, const locale& __loc)
|
||||
|
||||
// codecvt_base
|
||||
|
||||
class _LIBCPP_VISIBLE codecvt_base
|
||||
class codecvt_base
|
||||
{
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE codecvt_base() {}
|
||||
@@ -712,12 +706,12 @@ public:
|
||||
|
||||
// template <class internT, class externT, class stateT> class codecvt;
|
||||
|
||||
template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_VISIBLE codecvt;
|
||||
template <class _InternT, class _ExternT, class _StateT> class codecvt;
|
||||
|
||||
// template <> class codecvt<char, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<char, char, mbstate_t>
|
||||
class codecvt<char, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -803,7 +797,7 @@ protected:
|
||||
// template <> class codecvt<wchar_t, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<wchar_t, char, mbstate_t>
|
||||
class codecvt<wchar_t, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -886,7 +880,7 @@ protected:
|
||||
// template <> class codecvt<char16_t, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<char16_t, char, mbstate_t>
|
||||
class codecvt<char16_t, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -972,7 +966,7 @@ protected:
|
||||
// template <> class codecvt<char32_t, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<char32_t, char, mbstate_t>
|
||||
class codecvt<char32_t, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -1058,14 +1052,12 @@ protected:
|
||||
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
|
||||
|
||||
template <class _InternT, class _ExternT, class _StateT>
|
||||
class _LIBCPP_VISIBLE codecvt_byname
|
||||
class codecvt_byname
|
||||
: public codecvt<_InternT, _ExternT, _StateT>
|
||||
{
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit codecvt_byname(const char* __nm, size_t __refs = 0)
|
||||
: codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit codecvt_byname(const string& __nm, size_t __refs = 0)
|
||||
: codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
|
||||
protected:
|
||||
@@ -1082,7 +1074,7 @@ extern template class codecvt_byname<wchar_t, char, mbstate_t>;
|
||||
extern template class codecvt_byname<char16_t, char, mbstate_t>;
|
||||
extern template class codecvt_byname<char32_t, char, mbstate_t>;
|
||||
|
||||
_LIBCPP_VISIBLE void __throw_runtime_error(const char*);
|
||||
void __throw_runtime_error(const char*);
|
||||
|
||||
template <size_t _N>
|
||||
struct __narrow_to_utf8
|
||||
@@ -1266,10 +1258,10 @@ struct __widen_from_utf8<32>
|
||||
|
||||
// template <class charT> class numpunct
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE numpunct;
|
||||
template <class _CharT> class numpunct;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct<char>
|
||||
class numpunct<char>
|
||||
: public locale::facet
|
||||
{
|
||||
public:
|
||||
@@ -1300,7 +1292,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct<wchar_t>
|
||||
class numpunct<wchar_t>
|
||||
: public locale::facet
|
||||
{
|
||||
public:
|
||||
@@ -1332,10 +1324,10 @@ protected:
|
||||
|
||||
// template <class charT> class numpunct_byname
|
||||
|
||||
template <class charT> class _LIBCPP_VISIBLE numpunct_byname;
|
||||
template <class charT> class numpunct_byname;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct_byname<char>
|
||||
class numpunct_byname<char>
|
||||
: public numpunct<char>
|
||||
{
|
||||
public:
|
||||
@@ -1353,7 +1345,7 @@ private:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct_byname<wchar_t>
|
||||
class numpunct_byname<wchar_t>
|
||||
: public numpunct<wchar_t>
|
||||
{
|
||||
public:
|
||||
|
@@ -20,12 +20,11 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE mutex
|
||||
class mutex
|
||||
{
|
||||
pthread_mutex_t __m_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex() {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
|
||||
~mutex();
|
||||
|
||||
@@ -39,12 +38,12 @@ public:
|
||||
void unlock();
|
||||
|
||||
typedef pthread_mutex_t* native_handle_type;
|
||||
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
|
||||
native_handle_type native_handle() {return &__m_;}
|
||||
};
|
||||
|
||||
struct _LIBCPP_VISIBLE defer_lock_t {};
|
||||
struct _LIBCPP_VISIBLE try_to_lock_t {};
|
||||
struct _LIBCPP_VISIBLE adopt_lock_t {};
|
||||
struct defer_lock_t {};
|
||||
struct try_to_lock_t {};
|
||||
struct adopt_lock_t {};
|
||||
|
||||
//constexpr
|
||||
extern const
|
||||
@@ -59,7 +58,7 @@ extern const
|
||||
adopt_lock_t adopt_lock;
|
||||
|
||||
template <class _Mutex>
|
||||
class _LIBCPP_VISIBLE lock_guard
|
||||
class lock_guard
|
||||
{
|
||||
public:
|
||||
typedef _Mutex mutex_type;
|
||||
@@ -68,13 +67,10 @@ private:
|
||||
mutex_type& __m_;
|
||||
public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit lock_guard(mutex_type& __m)
|
||||
: __m_(__m) {__m_.lock();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
lock_guard(mutex_type& __m, adopt_lock_t)
|
||||
: __m_(__m) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~lock_guard() {__m_.unlock();}
|
||||
|
||||
private:
|
||||
@@ -83,7 +79,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _Mutex>
|
||||
class _LIBCPP_VISIBLE unique_lock
|
||||
class unique_lock
|
||||
{
|
||||
public:
|
||||
typedef _Mutex mutex_type;
|
||||
@@ -93,29 +89,21 @@ private:
|
||||
bool __owns_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock() : __m_(nullptr), __owns_(false) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit unique_lock(mutex_type& __m)
|
||||
: __m_(&__m), __owns_(true) {__m_->lock();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, defer_lock_t)
|
||||
: __m_(&__m), __owns_(false) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, try_to_lock_t)
|
||||
: __m_(&__m), __owns_(__m.try_lock()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, adopt_lock_t)
|
||||
: __m_(&__m), __owns_(true) {}
|
||||
template <class _Clock, class _Duration>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
|
||||
: __m_(&__m), __owns_(__m.try_lock_until(__t)) {}
|
||||
template <class _Rep, class _Period>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
|
||||
: __m_(&__m), __owns_(__m.try_lock_for(__d)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~unique_lock()
|
||||
{
|
||||
if (__owns_)
|
||||
@@ -127,12 +115,10 @@ private:
|
||||
unique_lock& operator=(unique_lock const&); // = delete;
|
||||
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unique_lock(unique_lock&& __u)
|
||||
: __m_(__u.__m_), __owns_(__u.__owns_)
|
||||
{__u.__m_ = nullptr; __u.__owns_ = false;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock& operator=(unique_lock&& __u)
|
||||
{
|
||||
if (__owns_)
|
||||
@@ -143,7 +129,7 @@ public:
|
||||
__u.__owns_ = false;
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void lock();
|
||||
bool try_lock();
|
||||
@@ -155,13 +141,11 @@ public:
|
||||
|
||||
void unlock();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unique_lock& __u)
|
||||
{
|
||||
_STD::swap(__m_, __u.__m_);
|
||||
_STD::swap(__owns_, __u.__owns_);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex_type* release()
|
||||
{
|
||||
mutex_type* __m = __m_;
|
||||
@@ -170,12 +154,9 @@ public:
|
||||
return __m;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool owns_lock() const {return __owns_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool () const {return __owns_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex_type* mutex() const {return __m_;}
|
||||
};
|
||||
|
||||
@@ -240,11 +221,11 @@ unique_lock<_Mutex>::unlock()
|
||||
}
|
||||
|
||||
template <class _Mutex>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) {__x.swap(__y);}
|
||||
|
||||
struct _LIBCPP_VISIBLE cv_status
|
||||
struct cv_status
|
||||
{
|
||||
enum _ {
|
||||
no_timeout,
|
||||
@@ -253,16 +234,15 @@ struct _LIBCPP_VISIBLE cv_status
|
||||
|
||||
_ __v_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY cv_status(_ __v) : __v_(__v) {}
|
||||
_LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;}
|
||||
cv_status(_ __v) : __v_(__v) {}
|
||||
operator int() const {return __v_;}
|
||||
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE condition_variable
|
||||
class condition_variable
|
||||
{
|
||||
pthread_cond_t __cv_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
|
||||
~condition_variable();
|
||||
|
||||
@@ -306,7 +286,7 @@ public:
|
||||
_Predicate __pred);
|
||||
|
||||
typedef pthread_cond_t* native_handle_type;
|
||||
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
|
||||
native_handle_type native_handle() {return &__cv_;}
|
||||
|
||||
private:
|
||||
void __do_timed_wait(unique_lock<mutex>& __lk,
|
||||
@@ -314,7 +294,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _To, class _Rep, class _Period>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename enable_if
|
||||
<
|
||||
chrono::__is_duration<_To>::value,
|
||||
@@ -390,7 +370,7 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
|
||||
}
|
||||
|
||||
template <class _Rep, class _Period, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
condition_variable::wait_for(unique_lock<mutex>& __lk,
|
||||
const chrono::duration<_Rep, _Period>& __d,
|
||||
|
@@ -58,11 +58,11 @@ public:
|
||||
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
|
||||
~__split_buffer();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__split_buffer(__split_buffer&& __c);
|
||||
__split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
|
||||
__split_buffer& operator=(__split_buffer&& __c);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const {return __begin_;}
|
||||
@@ -85,12 +85,12 @@ public:
|
||||
void shrink_to_fit();
|
||||
void push_front(const_reference __x);
|
||||
void push_back(const_reference __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push_front(value_type&& __x);
|
||||
void push_back(value_type&& __x);
|
||||
template <class... _Args>
|
||||
void emplace_back(_Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
|
||||
@@ -132,29 +132,23 @@ public:
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __split_buffer& __c, true_type)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __split_buffer& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y)
|
||||
{__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)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, false_type)
|
||||
{}
|
||||
};
|
||||
@@ -373,7 +367,7 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
|
||||
__alloc_traits::deallocate(__alloc(), __first_, capacity());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
|
||||
@@ -431,7 +425,7 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -516,7 +510,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
|
||||
--__begin_;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -548,7 +542,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
|
||||
--__begin_;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -580,7 +574,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
++__end_;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -612,8 +606,6 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
++__end_;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
void
|
||||
@@ -645,9 +637,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
++__end_;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
@@ -64,9 +64,7 @@ public:
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(__sso_allocator& __a) const {return &buf_ == &__a.buf_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(__sso_allocator& __a) const {return &buf_ != &__a.buf_;}
|
||||
};
|
||||
|
||||
|
151
include/__tree
151
include/__tree
@@ -22,12 +22,12 @@
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class, class, class> class __tree;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE __tree_iterator;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE __tree_const_iterator;
|
||||
template <class, class, class, class> class _LIBCPP_VISIBLE map;
|
||||
template <class, class, class, class> class _LIBCPP_VISIBLE multimap;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE set;
|
||||
template <class, class, class> class _LIBCPP_VISIBLE multiset;
|
||||
template <class, class, class> class __tree_iterator;
|
||||
template <class, class, class> class __tree_const_iterator;
|
||||
template <class, class, class, class> class map;
|
||||
template <class, class, class, class> class multimap;
|
||||
template <class, class, class> class set;
|
||||
template <class, class, class> class multiset;
|
||||
|
||||
/*
|
||||
|
||||
@@ -53,7 +53,7 @@ __root, have a non-null __parent_ field.
|
||||
// Returns: true if __x is a left child of its parent, else false
|
||||
// Precondition: __x != nullptr.
|
||||
template <class _NodePtr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
__tree_is_left_child(_NodePtr __x)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ __tree_invariant(_NodePtr __root)
|
||||
// Returns: pointer to the left-most node under __x.
|
||||
// Precondition: __x != nullptr.
|
||||
template <class _NodePtr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_NodePtr
|
||||
__tree_min(_NodePtr __x)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ __tree_min(_NodePtr __x)
|
||||
// Returns: pointer to the right-most node under __x.
|
||||
// Precondition: __x != nullptr.
|
||||
template <class _NodePtr>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_NodePtr
|
||||
__tree_max(_NodePtr __x)
|
||||
{
|
||||
@@ -513,13 +513,11 @@ private:
|
||||
public:
|
||||
bool __value_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_node_destructor(allocator_type& __na)
|
||||
: __na_(__na),
|
||||
__value_constructed(false)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
if (__value_constructed)
|
||||
@@ -540,7 +538,6 @@ public:
|
||||
typedef _Pointer pointer;
|
||||
pointer __left_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_end_node() : __left_() {}
|
||||
};
|
||||
|
||||
@@ -579,7 +576,6 @@ public:
|
||||
pointer __parent_;
|
||||
bool __is_black_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_node_base() : __right_(), __parent_(), __is_black_(false) {}
|
||||
};
|
||||
|
||||
@@ -593,23 +589,21 @@ public:
|
||||
|
||||
value_type __value_;
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_node(_Args&& ...__args)
|
||||
: __value_(_STD::forward<_Args>(__args)...) {}
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#else // _LIBCPP_MOVE
|
||||
explicit __tree_node(const value_type& __v)
|
||||
: __value_(__v) {}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // _LIBCPP_MOVE
|
||||
};
|
||||
|
||||
template <class> class __map_iterator;
|
||||
template <class> class __map_const_iterator;
|
||||
|
||||
template <class _Tp, class _NodePtr, class _DiffType>
|
||||
class _LIBCPP_VISIBLE __tree_iterator
|
||||
class __tree_iterator
|
||||
{
|
||||
typedef _NodePtr __node_pointer;
|
||||
typedef typename pointer_traits<__node_pointer>::element_type __node;
|
||||
@@ -632,48 +626,41 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __tree_iterator() {}
|
||||
__tree_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
pointer operator->() const {return &__ptr_->__value_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_iterator& operator++()
|
||||
{__ptr_ = static_cast<__node_pointer>(__tree_next(static_cast<__node_base_pointer>(__ptr_)));
|
||||
return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_iterator operator++(int)
|
||||
{__tree_iterator __t(*this); ++(*this); return __t;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_iterator& operator--()
|
||||
{__ptr_ = static_cast<__node_pointer>(__tree_prev(static_cast<__node_base_pointer>(__ptr_)));
|
||||
return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_iterator operator--(int)
|
||||
{__tree_iterator __t(*this); --(*this); return __t;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __tree_iterator& __x, const __tree_iterator& __y)
|
||||
friend bool operator==(const __tree_iterator& __x, const __tree_iterator& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __tree_iterator& __x, const __tree_iterator& __y)
|
||||
friend bool operator!=(const __tree_iterator& __x, const __tree_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_iterator(__node_pointer __p) : __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;
|
||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
|
||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
|
||||
template <class, class, class> friend class _LIBCPP_VISIBLE set;
|
||||
template <class, class, class> friend class _LIBCPP_VISIBLE multiset;
|
||||
template <class, class, class> friend class __tree_const_iterator;
|
||||
template <class> friend class __map_iterator;
|
||||
template <class, class, class, class> friend class map;
|
||||
template <class, class, class, class> friend class multimap;
|
||||
template <class, class, class> friend class set;
|
||||
template <class, class, class> friend class multiset;
|
||||
};
|
||||
|
||||
template <class _Tp, class _ConstNodePtr, class _DiffType>
|
||||
class _LIBCPP_VISIBLE __tree_const_iterator
|
||||
class __tree_const_iterator
|
||||
{
|
||||
typedef _ConstNodePtr __node_pointer;
|
||||
typedef typename pointer_traits<__node_pointer>::element_type __node;
|
||||
@@ -702,7 +689,7 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __tree_const_iterator() {}
|
||||
__tree_const_iterator() {}
|
||||
private:
|
||||
typedef typename remove_const<__node>::type __non_const_node;
|
||||
typedef typename pointer_traits<__node_pointer>::template
|
||||
@@ -715,44 +702,36 @@ private:
|
||||
typedef __tree_iterator<value_type, __non_const_node_pointer, difference_type>
|
||||
__non_const_iterator;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_const_iterator(__non_const_iterator __p) : __ptr_(__p.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
pointer operator->() const {return &__ptr_->__value_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_const_iterator& operator++()
|
||||
{__ptr_ = static_cast<__node_pointer>(__tree_next(static_cast<__node_base_pointer>(__ptr_)));
|
||||
return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_const_iterator operator++(int)
|
||||
{__tree_const_iterator __t(*this); ++(*this); return __t;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_const_iterator& operator--()
|
||||
{__ptr_ = static_cast<__node_pointer>(__tree_prev(static_cast<__node_base_pointer>(__ptr_)));
|
||||
return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tree_const_iterator operator--(int)
|
||||
{__tree_const_iterator __t(*this); --(*this); return __t;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __tree_const_iterator& __x, const __tree_const_iterator& __y)
|
||||
friend bool operator==(const __tree_const_iterator& __x, const __tree_const_iterator& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __tree_const_iterator& __x, const __tree_const_iterator& __y)
|
||||
friend bool operator!=(const __tree_const_iterator& __x, const __tree_const_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tree_const_iterator(__node_pointer __p) : __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;
|
||||
template <class, class, class> friend class _LIBCPP_VISIBLE set;
|
||||
template <class, class, class> friend class _LIBCPP_VISIBLE multiset;
|
||||
template <class> friend class _LIBCPP_VISIBLE __map_const_iterator;
|
||||
template <class, class, class, class> friend class map;
|
||||
template <class, class, class, class> friend class multimap;
|
||||
template <class, class, class> friend class set;
|
||||
template <class, class, class> friend class multiset;
|
||||
template <class> friend class __map_const_iterator;
|
||||
};
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
@@ -803,7 +782,6 @@ private:
|
||||
__compressed_pair<size_type, value_compare> __pair3_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer __end_node()
|
||||
{
|
||||
return static_cast<__node_pointer>
|
||||
@@ -811,7 +789,6 @@ public:
|
||||
pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first())
|
||||
);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_const_pointer __end_node() const
|
||||
{
|
||||
return static_cast<__node_const_pointer>
|
||||
@@ -819,33 +796,22 @@ public:
|
||||
pointer_traits<__end_node_const_ptr>::pointer_to(__pair1_.first())
|
||||
);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_allocator& __node_alloc() {return __pair1_.second();}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __node_alloc() const {return __pair1_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer& __begin_node() {return __begin_node_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_pointer& __begin_node() const {return __begin_node_;}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type __alloc() const {return allocator_type(__node_alloc());}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& size() {return __pair3_.first();}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const size_type& size() const {return __pair3_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare& value_comp() {return __pair3_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_compare& value_comp() const {return __pair3_.second();}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer __root()
|
||||
{return static_cast<__node_pointer> (__end_node()->__left_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_const_pointer __root() const
|
||||
{return static_cast<__node_const_pointer>(__end_node()->__left_);}
|
||||
|
||||
@@ -861,32 +827,26 @@ public:
|
||||
void __assign_unique(_InputIterator __first, _InputIterator __last);
|
||||
template <class _InputIterator>
|
||||
void __assign_multi(_InputIterator __first, _InputIterator __last);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__tree(__tree&& __t);
|
||||
__tree(__tree&& __t, const allocator_type& __a);
|
||||
__tree& operator=(__tree&& __t);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
~__tree();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return iterator(__begin_node());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return const_iterator(__begin_node());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return iterator(__end_node());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return const_iterator(__end_node());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __node_traits::max_size(__node_alloc());}
|
||||
|
||||
void clear();
|
||||
|
||||
void swap(__tree& __t);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
pair<iterator, bool>
|
||||
__emplace_unique(_Args&&... __args);
|
||||
@@ -900,7 +860,6 @@ public:
|
||||
template <class... _Args>
|
||||
iterator
|
||||
__emplace_hint_multi(const_iterator __p, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _V>
|
||||
pair<iterator, bool> __insert_unique(_V&& __v);
|
||||
@@ -910,13 +869,13 @@ public:
|
||||
iterator __insert_multi(_V&& __v);
|
||||
template <class _V>
|
||||
iterator __insert_multi(const_iterator __p, _V&& __v);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
pair<iterator, bool> __insert_unique(const value_type& __v);
|
||||
iterator __insert_unique(const_iterator __p, const value_type& __v);
|
||||
iterator __insert_multi(const value_type& __v);
|
||||
iterator __insert_multi(const_iterator __p, const value_type& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
|
||||
iterator __node_insert_unique(const_iterator __p,
|
||||
@@ -947,7 +906,6 @@ public:
|
||||
size_type __count_multi(const _Key& __k) const;
|
||||
|
||||
template <class _Key>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const _Key& __v)
|
||||
{return __lower_bound(__v, __root(), __end_node());}
|
||||
template <class _Key>
|
||||
@@ -955,7 +913,6 @@ public:
|
||||
__node_pointer __root,
|
||||
__node_pointer __result);
|
||||
template <class _Key>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator lower_bound(const _Key& __v) const
|
||||
{return __lower_bound(__v, __root(), __end_node());}
|
||||
template <class _Key>
|
||||
@@ -963,7 +920,6 @@ public:
|
||||
__node_const_pointer __root,
|
||||
__node_const_pointer __result) const;
|
||||
template <class _Key>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator upper_bound(const _Key& __v)
|
||||
{return __upper_bound(__v, __root(), __end_node());}
|
||||
template <class _Key>
|
||||
@@ -971,7 +927,6 @@ public:
|
||||
__node_pointer __root,
|
||||
__node_pointer __result);
|
||||
template <class _Key>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator upper_bound(const _Key& __v) const
|
||||
{return __upper_bound(__v, __root(), __end_node());}
|
||||
template <class _Key>
|
||||
@@ -1012,51 +967,42 @@ private:
|
||||
__find_equal(const_iterator __hint, typename __node::base::pointer& __parent,
|
||||
const _Key& __v);
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class ..._Args>
|
||||
__node_holder __construct_node(_Args&& ...__args);
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#else // _LIBCPP_MOVE
|
||||
__node_holder __construct_node(const value_type& __v);
|
||||
#endif
|
||||
|
||||
void destroy(__node_pointer __nd);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __tree& __t)
|
||||
{__copy_assign_alloc(__t, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_copy_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __tree& __t, true_type)
|
||||
{__node_alloc() = __t.__node_alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __tree& __t, false_type) {}
|
||||
|
||||
void __move_assign(__tree& __t, false_type);
|
||||
void __move_assign(__tree& __t, true_type);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t)
|
||||
{__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)
|
||||
{__node_alloc() = _STD::move(__t.__node_alloc());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__tree& __t, false_type) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
||||
{__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)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
|
||||
{}
|
||||
|
||||
@@ -1236,7 +1182,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
|
||||
__begin_node() = __end_node();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
|
||||
@@ -1356,7 +1302,7 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
__tree<_Tp, _Compare, _Allocator>::~__tree()
|
||||
@@ -1645,8 +1591,7 @@ __tree<_Tp, _Compare, _Allocator>::__insert_node_at(__node_base_pointer __parent
|
||||
++size();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
template <class ..._Args>
|
||||
@@ -1721,8 +1666,6 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
|
||||
return iterator(static_cast<__node_pointer>(__h.release()));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
template <class _V>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
@@ -1783,7 +1726,7 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _V&& __v)
|
||||
return iterator(__h.release());
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
|
||||
@@ -1852,7 +1795,7 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const valu
|
||||
return iterator(__h.release());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
|
@@ -25,12 +25,12 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
|
||||
template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
|
||||
template <class _Tp> class tuple_size;
|
||||
template <size_t _Ip, class _Tp> class tuple_element;
|
||||
|
||||
template <class ..._Tp> class _LIBCPP_VISIBLE tuple;
|
||||
template <class _T1, class _T2> class _LIBCPP_VISIBLE pair;
|
||||
template <class _Tp, size_t _Size> struct _LIBCPP_VISIBLE array;
|
||||
template <class ..._Tp> class tuple;
|
||||
template <class _T1, class _T2> class pair;
|
||||
template <class _Tp, size_t _Size> struct array;
|
||||
|
||||
template <class _Tp> struct __tuple_like : false_type {};
|
||||
|
||||
@@ -96,7 +96,7 @@ struct __make_tuple_indices
|
||||
template <class ..._Tp> struct __tuple_types {};
|
||||
|
||||
template <size_t _Ip>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<>>
|
||||
class tuple_element<_Ip, __tuple_types<>>
|
||||
{
|
||||
public:
|
||||
static_assert(_Ip == 0, "tuple_element index out of range");
|
||||
@@ -104,21 +104,21 @@ public:
|
||||
};
|
||||
|
||||
template <class _Hp, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<0, __tuple_types<_Hp, _Tp...>>
|
||||
class tuple_element<0, __tuple_types<_Hp, _Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef _Hp type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class _Hp, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<_Hp, _Tp...>>
|
||||
class tuple_element<_Ip, __tuple_types<_Hp, _Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef typename tuple_element<_Ip-1, __tuple_types<_Tp...>>::type type;
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<__tuple_types<_Tp...>>
|
||||
class tuple_size<__tuple_types<_Tp...>>
|
||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||
{
|
||||
};
|
||||
@@ -127,11 +127,6 @@ template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...>> : true_type {
|
||||
|
||||
// __make_tuple_types
|
||||
|
||||
// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
|
||||
// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
|
||||
// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
|
||||
// lvalue_reference type, then __tuple_types<_Types&...> is the result.
|
||||
|
||||
template <class _TupleTypes, class _Tp, size_t _Sp, size_t _Ep>
|
||||
struct __make_tuple_types_imp;
|
||||
|
||||
@@ -140,7 +135,7 @@ struct __make_tuple_types_imp<__tuple_types<_Types...>, _Tp, _Sp, _Ep>
|
||||
{
|
||||
typedef typename remove_reference<_Tp>::type _Tpr;
|
||||
typedef typename __make_tuple_types_imp<__tuple_types<_Types...,
|
||||
typename conditional<is_lvalue_reference<_Tp>::value,
|
||||
typename conditional<is_reference<_Tp>::value,
|
||||
typename tuple_element<_Sp, _Tpr>::type&,
|
||||
typename tuple_element<_Sp, _Tpr>::type>::type>,
|
||||
_Tp, _Sp+1, _Ep>::type type;
|
||||
@@ -159,6 +154,32 @@ struct __make_tuple_types
|
||||
typedef typename __make_tuple_types_imp<__tuple_types<>, _Tp, _Sp, _Ep>::type type;
|
||||
};
|
||||
|
||||
// __make_assignable_types
|
||||
|
||||
template <class _Tuple, class _Tp, size_t _Sp, size_t _Ep>
|
||||
struct __make_assignable_types_imp;
|
||||
|
||||
template <class ..._Types, class _Tp, size_t _Sp, size_t _Ep>
|
||||
struct __make_assignable_types_imp<__tuple_types<_Types...>, _Tp, _Sp, _Ep>
|
||||
{
|
||||
typedef typename __make_assignable_types_imp<__tuple_types<_Types...,
|
||||
typename remove_reference<typename tuple_element<_Sp, _Tp>::type>::type>,
|
||||
_Tp, _Sp+1, _Ep>::type type;
|
||||
};
|
||||
|
||||
template <class ..._Types, class _Tp, size_t _Ep>
|
||||
struct __make_assignable_types_imp<__tuple_types<_Types...>, _Tp, _Ep, _Ep>
|
||||
{
|
||||
typedef __tuple_types<_Types...> type;
|
||||
};
|
||||
|
||||
template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, size_t _Sp = 0>
|
||||
struct __make_assignable_types
|
||||
{
|
||||
static_assert(_Sp <= _Ep, "__make_assignable_types input error");
|
||||
typedef typename __make_assignable_types_imp<__tuple_types<>, typename remove_reference<_Tp>::type, _Sp, _Ep>::type type;
|
||||
};
|
||||
|
||||
// __tuple_convertible
|
||||
|
||||
template <bool, class _Tp, class _Up>
|
||||
@@ -188,19 +209,6 @@ struct __tuple_convertible<_Tp, _Up, true, true>
|
||||
|
||||
// __tuple_assignable
|
||||
|
||||
template <bool, class _Tp, class _Up>
|
||||
struct __tuple_assignable_imp : public false_type {};
|
||||
|
||||
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
|
||||
struct __tuple_assignable_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...>>
|
||||
: public integral_constant<bool,
|
||||
__is_assignable<_Up0&, _Tp0>::value &&
|
||||
__tuple_assignable_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...>>::value> {};
|
||||
|
||||
template <>
|
||||
struct __tuple_assignable_imp<true, __tuple_types<>, __tuple_types<>>
|
||||
: public true_type {};
|
||||
|
||||
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
|
||||
bool = __tuple_like<_Up>::value>
|
||||
struct __tuple_assignable
|
||||
@@ -208,9 +216,9 @@ struct __tuple_assignable
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
struct __tuple_assignable<_Tp, _Up, true, true>
|
||||
: public __tuple_assignable_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
|
||||
tuple_size<_Up>::value,
|
||||
typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
|
||||
: public __tuple_convertible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
|
||||
tuple_size<_Up>::value,
|
||||
typename __make_tuple_types<_Tp>::type, typename __make_assignable_types<_Up>::type>
|
||||
{};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -17,8 +17,8 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
|
||||
template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
|
||||
template <class _Tp> class tuple_size;
|
||||
template <size_t _Ip, class _Tp> class tuple_element;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
@@ -2693,7 +2693,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
|
||||
template <class _RandomAccessIterator, class _RandomNumberGenerator>
|
||||
void
|
||||
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_RandomNumberGenerator&& __rand)
|
||||
#else
|
||||
_RandomNumberGenerator& __rand)
|
||||
|
@@ -115,7 +115,7 @@ template <int I, class T, size_t N> const T& get(const array<T, N>&);
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
struct _LIBCPP_VISIBLE array
|
||||
struct array
|
||||
{
|
||||
// types:
|
||||
typedef array __self;
|
||||
@@ -134,10 +134,8 @@ struct _LIBCPP_VISIBLE array
|
||||
value_type __elems_[_Size > 0 ? _Size : 1];
|
||||
|
||||
// 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)
|
||||
{_STD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u) {_STD::fill_n(__elems_, _Size, __u);}
|
||||
_LIBCPP_INLINE_VISIBILITY void swap(array& __a) {_STD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
|
||||
// iterators:
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__elems_);}
|
||||
@@ -258,22 +256,20 @@ swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_size<array<_Tp, _Size> >
|
||||
: public integral_constant<size_t, _Size> {};
|
||||
class tuple_size<array<_Tp, _Size> > : public integral_constant<size_t, _Size> {};
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_size<const array<_Tp, _Size> >
|
||||
: public integral_constant<size_t, _Size> {};
|
||||
class tuple_size<const array<_Tp, _Size> > : public integral_constant<size_t, _Size> {};
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, array<_Tp, _Size> >
|
||||
class tuple_element<_Ip, array<_Tp, _Size> >
|
||||
{
|
||||
public:
|
||||
typedef _Tp type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const array<_Tp, _Size> >
|
||||
class tuple_element<_Ip, const array<_Tp, _Size> >
|
||||
{
|
||||
public:
|
||||
typedef const _Tp type;
|
||||
|
13060
include/atomic
13060
include/atomic
File diff suppressed because it is too large
Load Diff
@@ -592,7 +592,7 @@ template <size_t _Size> class bitset;
|
||||
template <size_t _Size> struct hash<bitset<_Size> >;
|
||||
|
||||
template <size_t _Size>
|
||||
class _LIBCPP_VISIBLE bitset
|
||||
class bitset
|
||||
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
|
||||
{
|
||||
static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1;
|
||||
@@ -656,7 +656,6 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t __hash_code() const {return base::__hash_code();}
|
||||
|
||||
friend struct hash<bitset>;
|
||||
@@ -1011,10 +1010,9 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
struct _LIBCPP_VISIBLE hash<bitset<_Size> >
|
||||
struct hash<bitset<_Size> >
|
||||
: public unary_function<bitset<_Size>, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const bitset<_Size>& __bs) const
|
||||
{return __bs.__hash_code();}
|
||||
};
|
||||
|
@@ -262,7 +262,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
namespace chrono
|
||||
{
|
||||
|
||||
template <class _Rep, class _Period = ratio<1> > class _LIBCPP_VISIBLE duration;
|
||||
template <class _Rep, class _Period = ratio<1> > class duration;
|
||||
|
||||
template <class _Tp>
|
||||
struct __is_duration : false_type {};
|
||||
@@ -282,8 +282,7 @@ struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
|
||||
} // chrono
|
||||
|
||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||
struct _LIBCPP_VISIBLE common_type<chrono::duration<_Rep1, _Period1>,
|
||||
chrono::duration<_Rep2, _Period2> >
|
||||
struct common_type<chrono::duration<_Rep1, _Period1>, chrono::duration<_Rep2, _Period2> >
|
||||
{
|
||||
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
|
||||
typename __ratio_gcd<_Period1, _Period2>::type> type;
|
||||
@@ -358,11 +357,10 @@ duration_cast(const duration<_Rep, _Period>& __fd)
|
||||
return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
|
||||
}
|
||||
|
||||
template <class _Rep>
|
||||
struct _LIBCPP_VISIBLE treat_as_floating_point : is_floating_point<_Rep> {};
|
||||
template <class _Rep> struct treat_as_floating_point : is_floating_point<_Rep> {};
|
||||
|
||||
template <class _Rep>
|
||||
struct _LIBCPP_VISIBLE duration_values
|
||||
struct duration_values
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY static _Rep zero() {return _Rep(0);}
|
||||
@@ -373,7 +371,7 @@ public:
|
||||
// duration
|
||||
|
||||
template <class _Rep, class _Period>
|
||||
class _LIBCPP_VISIBLE duration
|
||||
class duration
|
||||
{
|
||||
static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
|
||||
static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
|
||||
@@ -669,7 +667,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
template <class _Clock, class _Duration = typename _Clock::duration>
|
||||
class _LIBCPP_VISIBLE time_point
|
||||
class time_point
|
||||
{
|
||||
static_assert(__is_duration<_Duration>::value,
|
||||
"Second template parameter of time_point must be a std::chrono::duration");
|
||||
@@ -713,8 +711,7 @@ public:
|
||||
} // chrono
|
||||
|
||||
template <class _Clock, class _Duration1, class _Duration2>
|
||||
struct _LIBCPP_VISIBLE common_type<chrono::time_point<_Clock, _Duration1>,
|
||||
chrono::time_point<_Clock, _Duration2> >
|
||||
struct common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _Duration2> >
|
||||
{
|
||||
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
|
||||
};
|
||||
@@ -836,7 +833,7 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
|
||||
/////////////////////// clocks ///////////////////////////
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
class _LIBCPP_VISIBLE system_clock
|
||||
class system_clock
|
||||
{
|
||||
public:
|
||||
typedef microseconds duration;
|
||||
@@ -850,7 +847,7 @@ public:
|
||||
static time_point from_time_t(time_t __t);
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE monotonic_clock
|
||||
class monotonic_clock
|
||||
{
|
||||
public:
|
||||
typedef nanoseconds duration;
|
||||
|
196
include/cmath
196
include/cmath
@@ -317,7 +317,8 @@ using ::double_t;
|
||||
// abs
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, _A1>::type
|
||||
abs(_A1 __x) {return fabs(__x);}
|
||||
|
||||
@@ -330,7 +331,8 @@ inline _LIBCPP_INLINE_VISIBILITY float acos(float __x) {return acosf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) {return acosl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
acos(_A1 __x) {return acos((double)__x);}
|
||||
|
||||
@@ -343,7 +345,8 @@ inline _LIBCPP_INLINE_VISIBILITY float asin(float __x) {return asinf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) {return asinl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
asin(_A1 __x) {return asin((double)__x);}
|
||||
|
||||
@@ -356,7 +359,8 @@ inline _LIBCPP_INLINE_VISIBILITY float atan(float __x) {return atanf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) {return atanl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
atan(_A1 __x) {return atan((double)__x);}
|
||||
|
||||
@@ -369,7 +373,8 @@ inline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) {return atan2l(__y, __x);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -393,7 +398,8 @@ inline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) {return ceilf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) {return ceill(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
ceil(_A1 __x) {return ceil((double)__x);}
|
||||
|
||||
@@ -406,7 +412,7 @@ inline _LIBCPP_INLINE_VISIBILITY float cos(float __x) {return cosf(_
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) {return cosl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
cos(_A1 __x) {return cos((double)__x);}
|
||||
|
||||
@@ -419,7 +425,8 @@ inline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) {return coshf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) {return coshl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
cosh(_A1 __x) {return cosh((double)__x);}
|
||||
|
||||
@@ -432,7 +439,8 @@ inline _LIBCPP_INLINE_VISIBILITY float exp(float __x) {return expf(_
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) {return expl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
exp(_A1 __x) {return exp((double)__x);}
|
||||
|
||||
@@ -445,7 +453,8 @@ inline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) {return fabsf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) {return fabsl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
fabs(_A1 __x) {return fabs((double)__x);}
|
||||
|
||||
@@ -458,7 +467,8 @@ inline _LIBCPP_INLINE_VISIBILITY float floor(float __x) {return floo
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) {return floorl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
floor(_A1 __x) {return floor((double)__x);}
|
||||
|
||||
@@ -471,7 +481,8 @@ inline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) {return fmodl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -495,7 +506,8 @@ inline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) {r
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) {return frexpl(__x, __e);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
frexp(_A1 __x, int* __e) {return frexp((double)__x, __e);}
|
||||
|
||||
@@ -508,7 +520,8 @@ inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) {re
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) {return ldexpl(__x, __e);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
ldexp(_A1 __x, int __e) {return ldexp((double)__x, __e);}
|
||||
|
||||
@@ -521,7 +534,8 @@ inline _LIBCPP_INLINE_VISIBILITY float log(float __x) {return logf(_
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) {return logl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
log(_A1 __x) {return log((double)__x);}
|
||||
|
||||
@@ -534,7 +548,8 @@ inline _LIBCPP_INLINE_VISIBILITY float log10(float __x) {return log1
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) {return log10l(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
log10(_A1 __x) {return log10((double)__x);}
|
||||
|
||||
@@ -555,7 +570,8 @@ inline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) {return powl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -579,7 +595,8 @@ inline _LIBCPP_INLINE_VISIBILITY float sin(float __x) {return sinf(_
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) {return sinl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
sin(_A1 __x) {return sin((double)__x);}
|
||||
|
||||
@@ -592,7 +609,8 @@ inline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) {return sinhf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) {return sinhl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
sinh(_A1 __x) {return sinh((double)__x);}
|
||||
|
||||
@@ -605,7 +623,8 @@ inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) {return sqrtf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) {return sqrtl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
sqrt(_A1 __x) {return sqrt((double)__x);}
|
||||
|
||||
@@ -618,7 +637,8 @@ inline _LIBCPP_INLINE_VISIBILITY float tan(float __x) {return tanf(_
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) {return tanl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
tan(_A1 __x) {return tan((double)__x);}
|
||||
|
||||
@@ -631,7 +651,8 @@ inline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) {return tanhf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) {return tanhl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
tanh(_A1 __x) {return tanh((double)__x);}
|
||||
|
||||
@@ -652,7 +673,7 @@ __libcpp_signbit(_A1 __x)
|
||||
#undef signbit
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
signbit(_A1 __x)
|
||||
{
|
||||
@@ -678,7 +699,7 @@ __libcpp_fpclassify(_A1 __x)
|
||||
#undef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if<is_floating_point<_A1>::value, int>::type
|
||||
fpclassify(_A1 __x)
|
||||
{
|
||||
@@ -704,7 +725,7 @@ __libcpp_isfinite(_A1 __x)
|
||||
#undef isfinite
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isfinite(_A1 __x)
|
||||
{
|
||||
@@ -730,7 +751,7 @@ __libcpp_isinf(_A1 __x)
|
||||
#undef isinf
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isinf(_A1 __x)
|
||||
{
|
||||
@@ -756,7 +777,7 @@ __libcpp_isnan(_A1 __x)
|
||||
#undef isnan
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isnan(_A1 __x)
|
||||
{
|
||||
@@ -782,7 +803,7 @@ __libcpp_isnormal(_A1 __x)
|
||||
#undef isnormal
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isnormal(_A1 __x)
|
||||
{
|
||||
@@ -808,7 +829,7 @@ __libcpp_isgreater(_A1 __x, _A2 __y)
|
||||
#undef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
@@ -839,7 +860,7 @@ __libcpp_isgreaterequal(_A1 __x, _A2 __y)
|
||||
#undef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
@@ -870,7 +891,7 @@ __libcpp_isless(_A1 __x, _A2 __y)
|
||||
#undef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
@@ -901,7 +922,7 @@ __libcpp_islessequal(_A1 __x, _A2 __y)
|
||||
#undef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
@@ -932,7 +953,7 @@ __libcpp_islessgreater(_A1 __x, _A2 __y)
|
||||
#undef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
@@ -963,7 +984,7 @@ __libcpp_isunordered(_A1 __x, _A2 __y)
|
||||
#undef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
@@ -986,7 +1007,8 @@ inline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) {return acos
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) {return acoshl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
acosh(_A1 __x) {return acosh((double)__x);}
|
||||
|
||||
@@ -999,7 +1021,8 @@ inline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) {return asin
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) {return asinhl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
asinh(_A1 __x) {return asinh((double)__x);}
|
||||
|
||||
@@ -1012,7 +1035,8 @@ inline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) {return atan
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) {return atanhl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
atanh(_A1 __x) {return atanh((double)__x);}
|
||||
|
||||
@@ -1025,7 +1049,8 @@ inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) {return cbrtf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) {return cbrtl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
cbrt(_A1 __x) {return cbrt((double)__x);}
|
||||
|
||||
@@ -1038,7 +1063,8 @@ inline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) {return copysignl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1062,7 +1088,8 @@ inline _LIBCPP_INLINE_VISIBILITY float erf(float __x) {return erff(_
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) {return erfl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
erf(_A1 __x) {return erf((double)__x);}
|
||||
|
||||
@@ -1075,7 +1102,8 @@ inline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) {return erfcf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) {return erfcl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
erfc(_A1 __x) {return erfc((double)__x);}
|
||||
|
||||
@@ -1088,7 +1116,8 @@ inline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) {return exp2f
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) {return exp2l(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
exp2(_A1 __x) {return exp2((double)__x);}
|
||||
|
||||
@@ -1101,7 +1130,8 @@ inline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) {return expm
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) {return expm1l(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
expm1(_A1 __x) {return expm1((double)__x);}
|
||||
|
||||
@@ -1114,7 +1144,8 @@ inline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) {return fdiml(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1134,13 +1165,19 @@ fdim(_A1 __x, _A2 __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) {return (float)((double)__x*__y + __z);}
|
||||
#define FP_FAST_FMAF
|
||||
|
||||
//#if (defined(__ppc__) || defined(__ppc64__))
|
||||
//inline _LIBCPP_INLINE_VISIBILITY double fma(register double __x, register double __y, register double __z) {asm {fmadd __x, __x, __y, __z} return __x;}
|
||||
//#define FP_FAST_FMA
|
||||
//#else
|
||||
using ::fma;
|
||||
//#endif
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) {return fmaf(__x, __y, __z);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) {return fmal(__x, __y, __z);}
|
||||
|
||||
template <class _A1, class _A2, class _A3>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1166,7 +1203,8 @@ inline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1190,7 +1228,8 @@ inline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) {return fminl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1214,7 +1253,8 @@ inline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) {return hypotl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1238,7 +1278,8 @@ inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) {return ilogbf(__x);
|
||||
inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) {return ilogbl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, int>::type
|
||||
ilogb(_A1 __x) {return ilogb((double)__x);}
|
||||
|
||||
@@ -1251,7 +1292,8 @@ inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) {return lga
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) {return lgammal(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
lgamma(_A1 __x) {return lgamma((double)__x);}
|
||||
|
||||
@@ -1264,7 +1306,8 @@ inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) {return llrin
|
||||
inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) {return llrintl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, long long>::type
|
||||
llrint(_A1 __x) {return llrint((double)__x);}
|
||||
|
||||
@@ -1277,7 +1320,8 @@ inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) {return llro
|
||||
inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) {return llroundl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, long long>::type
|
||||
llround(_A1 __x) {return llround((double)__x);}
|
||||
|
||||
@@ -1290,7 +1334,8 @@ inline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) {return log1
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) {return log1pl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
log1p(_A1 __x) {return log1p((double)__x);}
|
||||
|
||||
@@ -1303,7 +1348,8 @@ inline _LIBCPP_INLINE_VISIBILITY float log2(float __x) {return log2f
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) {return log2l(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
log2(_A1 __x) {return log2((double)__x);}
|
||||
|
||||
@@ -1316,7 +1362,8 @@ inline _LIBCPP_INLINE_VISIBILITY float logb(float __x) {return logbf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) {return logbl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
logb(_A1 __x) {return logb((double)__x);}
|
||||
|
||||
@@ -1329,7 +1376,8 @@ inline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) {return lrintf(__x)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) {return lrintl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, long>::type
|
||||
lrint(_A1 __x) {return lrint((double)__x);}
|
||||
|
||||
@@ -1342,7 +1390,8 @@ inline _LIBCPP_INLINE_VISIBILITY long lround(float __x) {return lroundf(__
|
||||
inline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) {return lroundl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, long>::type
|
||||
lround(_A1 __x) {return lround((double)__x);}
|
||||
|
||||
@@ -1360,7 +1409,8 @@ inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) {return
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) {return nearbyintl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
nearbyint(_A1 __x) {return nearbyint((double)__x);}
|
||||
|
||||
@@ -1373,7 +1423,8 @@ inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1397,7 +1448,8 @@ inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double _
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
nexttoward(_A1 __x, long double __y) {return nexttoward((double)__x, __y);}
|
||||
|
||||
@@ -1410,7 +1462,8 @@ inline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) {return remainderl(__x, __y);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1434,7 +1487,8 @@ inline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* _
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) {return remquol(__x, __y, __z);}
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_A1>::value &&
|
||||
@@ -1458,7 +1512,8 @@ inline _LIBCPP_INLINE_VISIBILITY float rint(float __x) {return rintf
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) {return rintl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
rint(_A1 __x) {return rint((double)__x);}
|
||||
|
||||
@@ -1471,7 +1526,8 @@ inline _LIBCPP_INLINE_VISIBILITY float round(float __x) {return roun
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) {return roundl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
round(_A1 __x) {return round((double)__x);}
|
||||
|
||||
@@ -1484,7 +1540,8 @@ inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y)
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
scalbln(_A1 __x, long __y) {return scalbln((double)__x, __y);}
|
||||
|
||||
@@ -1497,7 +1554,8 @@ inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) {r
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
scalbn(_A1 __x, int __y) {return scalbn((double)__x, __y);}
|
||||
|
||||
@@ -1510,7 +1568,8 @@ inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) {return tga
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) {return tgammal(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
tgamma(_A1 __x) {return tgamma((double)__x);}
|
||||
|
||||
@@ -1523,7 +1582,8 @@ inline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) {return trun
|
||||
inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) {return truncl(__x);}
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
trunc(_A1 __x) {return trunc((double)__x);}
|
||||
|
||||
|
@@ -177,7 +177,7 @@ protected:
|
||||
|
||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||
codecvt_mode _Mode = (codecvt_mode)0>
|
||||
class _LIBCPP_VISIBLE codecvt_utf8
|
||||
class codecvt_utf8
|
||||
: public __codecvt_utf8<_Elem>
|
||||
{
|
||||
public:
|
||||
@@ -185,7 +185,6 @@ public:
|
||||
explicit codecvt_utf8(size_t __refs = 0)
|
||||
: __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~codecvt_utf8() {}
|
||||
};
|
||||
|
||||
@@ -405,7 +404,7 @@ protected:
|
||||
|
||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||
codecvt_mode _Mode = (codecvt_mode)0>
|
||||
class _LIBCPP_VISIBLE codecvt_utf16
|
||||
class codecvt_utf16
|
||||
: public __codecvt_utf16<_Elem, _Mode & little_endian>
|
||||
{
|
||||
public:
|
||||
@@ -413,7 +412,6 @@ public:
|
||||
explicit codecvt_utf16(size_t __refs = 0)
|
||||
: __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~codecvt_utf16() {}
|
||||
};
|
||||
|
||||
@@ -528,7 +526,7 @@ protected:
|
||||
|
||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||
codecvt_mode _Mode = (codecvt_mode)0>
|
||||
class _LIBCPP_VISIBLE codecvt_utf8_utf16
|
||||
class codecvt_utf8_utf16
|
||||
: public __codecvt_utf8_utf16<_Elem>
|
||||
{
|
||||
public:
|
||||
@@ -536,7 +534,6 @@ public:
|
||||
explicit codecvt_utf8_utf16(size_t __refs = 0)
|
||||
: __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~codecvt_utf8_utf16() {}
|
||||
};
|
||||
|
||||
|
@@ -253,13 +253,13 @@ template<class T, class charT, class traits>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template<class _Tp> class _LIBCPP_VISIBLE complex;
|
||||
template<class _Tp> class complex;
|
||||
|
||||
template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
|
||||
template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
|
||||
|
||||
template<class _Tp>
|
||||
class _LIBCPP_VISIBLE complex
|
||||
class complex
|
||||
{
|
||||
public:
|
||||
typedef _Tp value_type;
|
||||
@@ -316,11 +316,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<> class _LIBCPP_VISIBLE complex<double>;
|
||||
template<> class _LIBCPP_VISIBLE complex<long double>;
|
||||
template<> class complex<double>;
|
||||
template<> class complex<long double>;
|
||||
|
||||
template<>
|
||||
class _LIBCPP_VISIBLE complex<float>
|
||||
class complex<float>
|
||||
{
|
||||
float __re_;
|
||||
float __im_;
|
||||
@@ -375,7 +375,7 @@ public:
|
||||
};
|
||||
|
||||
template<>
|
||||
class _LIBCPP_VISIBLE complex<double>
|
||||
class complex<double>
|
||||
{
|
||||
double __re_;
|
||||
double __im_;
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
};
|
||||
|
||||
template<>
|
||||
class _LIBCPP_VISIBLE complex<long double>
|
||||
class complex<long double>
|
||||
{
|
||||
long double __re_;
|
||||
long double __im_;
|
||||
@@ -781,6 +781,20 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
|
||||
return !(__x == __y);
|
||||
}
|
||||
|
||||
/*
|
||||
Move to <istream>
|
||||
|
||||
template<class T, class charT, class traits>
|
||||
basic_istream<charT, traits>&
|
||||
operator>>(basic_istream<charT, traits>&, complex<T>&);
|
||||
|
||||
Move to <ostream>
|
||||
|
||||
template<class T, class charT, class traits>
|
||||
basic_ostream<charT, traits>&
|
||||
operator<<(basic_ostream<charT, traits>&, const complex<T>&);
|
||||
*/
|
||||
|
||||
// 26.3.7 values:
|
||||
|
||||
// real
|
||||
|
@@ -61,8 +61,6 @@ public:
|
||||
native_handle_type native_handle();
|
||||
};
|
||||
|
||||
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
||||
|
||||
class condition_variable_any
|
||||
{
|
||||
public:
|
||||
@@ -115,7 +113,7 @@ public:
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE condition_variable_any
|
||||
class condition_variable_any
|
||||
{
|
||||
condition_variable __cv_;
|
||||
shared_ptr<mutex> __mut_;
|
||||
@@ -153,11 +151,11 @@ public:
|
||||
_Predicate __pred);
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
condition_variable_any::condition_variable_any()
|
||||
: __mut_(make_shared<mutex>()) {}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
condition_variable_any::notify_one()
|
||||
{
|
||||
@@ -165,7 +163,7 @@ condition_variable_any::notify_one()
|
||||
__cv_.notify_one();
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
condition_variable_any::notify_all()
|
||||
{
|
||||
@@ -192,7 +190,7 @@ condition_variable_any::wait(_Lock& __lock)
|
||||
} // __mut_.unlock(), __lock.lock()
|
||||
|
||||
template <class _Lock, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
condition_variable_any::wait(_Lock& __lock, _Predicate __pred)
|
||||
{
|
||||
@@ -214,7 +212,7 @@ condition_variable_any::wait_until(_Lock& __lock,
|
||||
} // __mut_.unlock(), __lock.lock()
|
||||
|
||||
template <class _Lock, class _Clock, class _Duration, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
condition_variable_any::wait_until(_Lock& __lock,
|
||||
const chrono::time_point<_Clock, _Duration>& __t,
|
||||
@@ -227,7 +225,7 @@ condition_variable_any::wait_until(_Lock& __lock,
|
||||
}
|
||||
|
||||
template <class _Lock, class _Rep, class _Period>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
cv_status
|
||||
condition_variable_any::wait_for(_Lock& __lock,
|
||||
const chrono::duration<_Rep, _Period>& __d)
|
||||
@@ -236,7 +234,7 @@ condition_variable_any::wait_for(_Lock& __lock,
|
||||
}
|
||||
|
||||
template <class _Lock, class _Rep, class _Period, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
condition_variable_any::wait_for(_Lock& __lock,
|
||||
const chrono::duration<_Rep, _Period>& __d,
|
||||
@@ -246,9 +244,6 @@ condition_variable_any::wait_for(_Lock& __lock,
|
||||
_STD::move(__pred));
|
||||
}
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_CONDITION_VARIABLE
|
||||
|
@@ -54,7 +54,7 @@ typedef long double max_align_t;
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
struct _LIBCPP_VISIBLE nullptr_t
|
||||
struct nullptr_t
|
||||
{
|
||||
void* _;
|
||||
|
||||
|
@@ -78,26 +78,23 @@ using ::strcoll;
|
||||
using ::strxfrm;
|
||||
|
||||
using ::memchr;
|
||||
inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
|
||||
|
||||
using ::strchr;
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
|
||||
|
||||
using ::strcspn;
|
||||
|
||||
using ::strpbrk;
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
|
||||
|
||||
using ::strrchr;
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);}
|
||||
|
||||
using ::strspn;
|
||||
|
||||
using ::strstr;
|
||||
|
||||
#ifndef __GLIBC__ // GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strstr( char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
|
||||
#endif
|
||||
|
||||
using ::strtok;
|
||||
using ::memset;
|
||||
|
115
include/deque
115
include/deque
@@ -159,7 +159,7 @@ template <class _Tp, class _Allocator> class __deque_base;
|
||||
|
||||
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
|
||||
class _DiffType, _DiffType _BlockSize>
|
||||
class _LIBCPP_VISIBLE __deque_iterator;
|
||||
class __deque_iterator;
|
||||
|
||||
template <class _RAIter,
|
||||
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
|
||||
@@ -251,7 +251,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
||||
|
||||
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
|
||||
class _DiffType, _DiffType _BlockSize>
|
||||
class _LIBCPP_VISIBLE __deque_iterator
|
||||
class __deque_iterator
|
||||
{
|
||||
typedef _MapPointer __map_iterator;
|
||||
public:
|
||||
@@ -399,9 +399,9 @@ private:
|
||||
: __m_iter_(__m), __ptr_(__p) {}
|
||||
|
||||
template <class _Tp, class _A> friend class __deque_base;
|
||||
template <class _Tp, class _A> friend class _LIBCPP_VISIBLE deque;
|
||||
template <class _Tp, class _A> friend class deque;
|
||||
template <class _V, class _P, class _R, class _MP, class _D, _D>
|
||||
friend class _LIBCPP_VISIBLE __deque_iterator;
|
||||
friend class __deque_iterator;
|
||||
|
||||
template <class _RAIter,
|
||||
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
|
||||
@@ -930,18 +930,17 @@ protected:
|
||||
explicit __deque_base(const allocator_type& __a);
|
||||
~__deque_base();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
__deque_base(__deque_base&& __c);
|
||||
__deque_base(__deque_base&& __c, const allocator_type& __a);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(__deque_base& __c);
|
||||
void clear();
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign(__deque_base& __c)
|
||||
{
|
||||
__map_ = _STD::move(__c.__map_);
|
||||
@@ -951,35 +950,28 @@ protected:
|
||||
__c.__start_ = __c.size() = 0;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__deque_base& __c)
|
||||
{__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)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __deque_base& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y)
|
||||
{__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)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
|
||||
{}
|
||||
};
|
||||
@@ -1067,7 +1059,7 @@ __deque_base<_Tp, _Allocator>::~__deque_base()
|
||||
__alloc_traits::deallocate(__alloc(), *__i, __block_size);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
__deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
|
||||
@@ -1098,7 +1090,7 @@ __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -1135,7 +1127,7 @@ __deque_base<_Tp, _Allocator>::clear()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator = allocator<_Tp> >
|
||||
class _LIBCPP_VISIBLE deque
|
||||
class deque
|
||||
: private __deque_base<_Tp, _Allocator>
|
||||
{
|
||||
public:
|
||||
@@ -1177,14 +1169,13 @@ public:
|
||||
deque(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
|
||||
deque& operator=(const deque& __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
deque(deque&& __c);
|
||||
deque(deque&& __c, const allocator_type& __a);
|
||||
deque& operator=(deque&& __c);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _InputIter>
|
||||
void assign(_InputIter __f, _InputIter __l,
|
||||
@@ -1194,48 +1185,34 @@ public:
|
||||
void assign(_RAIter __f, _RAIter __l,
|
||||
typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0);
|
||||
void assign(size_type __n, const value_type& __v);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
|
||||
// iterators:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __base::end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() {return reverse_iterator(__base::end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(__base::end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() {return reverse_iterator(__base::begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(__base::begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const {return const_reverse_iterator(__base::end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {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());}
|
||||
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;}
|
||||
bool empty() const {return __base::size() == 0;}
|
||||
|
||||
// element access:
|
||||
reference operator[](size_type __i);
|
||||
@@ -1250,16 +1227,14 @@ public:
|
||||
// 23.2.2.3 modifiers:
|
||||
void push_front(const value_type& __v);
|
||||
void push_back(const value_type& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args> void emplace_front(_Args&&... __args);
|
||||
template <class... _Args> void emplace_back(_Args&&... __args);
|
||||
template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
void push_front(value_type&& __v);
|
||||
void push_back(value_type&& __v);
|
||||
iterator insert(const_iterator __p, value_type&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, const value_type& __v);
|
||||
iterator insert(const_iterator __p, size_type __n, const value_type& __v);
|
||||
template <class _InputIter>
|
||||
@@ -1269,7 +1244,6 @@ public:
|
||||
template <class _BiIter>
|
||||
iterator insert (const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, initializer_list<value_type> __il)
|
||||
{return insert(__p, __il.begin(), __il.end());}
|
||||
void pop_front();
|
||||
@@ -1280,25 +1254,20 @@ public:
|
||||
void swap(deque& __c);
|
||||
void clear();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool __invariants() const {return __base::__invariants();}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __recommend_blocks(size_type __n)
|
||||
{
|
||||
return __n / __base::__block_size + (__n % __base::__block_size != 0);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type __capacity() const
|
||||
{
|
||||
return __base::__map_.size() == 0 ? 0 : __base::__map_.size() * __base::__block_size - 1;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type __front_spare() const
|
||||
{
|
||||
return __base::__start_;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type __back_spare() const
|
||||
{
|
||||
return __capacity() - (__base::__start_ + __base::size());
|
||||
@@ -1327,12 +1296,10 @@ private:
|
||||
void __move_construct_backward_and_check(iterator __f, iterator __l,
|
||||
iterator __r, const_pointer& __vt);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const deque& __c)
|
||||
{__copy_assign_alloc(__c, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_copy_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const deque& __c, true_type)
|
||||
{
|
||||
if (__base::__alloc() != __c.__alloc())
|
||||
@@ -1344,7 +1311,6 @@ private:
|
||||
__base::__map_.__alloc() = __c.__map_.__alloc();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const deque& __c, false_type)
|
||||
{}
|
||||
|
||||
@@ -1430,17 +1396,17 @@ deque<_Tp, _Allocator>::operator=(const deque& __c)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
deque<_Tp, _Allocator>::deque(deque&& __c)
|
||||
: __base(_STD::move(__c))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
|
||||
: __base(_STD::move(__c), __a)
|
||||
{
|
||||
@@ -1452,7 +1418,7 @@ deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
deque<_Tp, _Allocator>&
|
||||
deque<_Tp, _Allocator>::operator=(deque&& __c)
|
||||
{
|
||||
@@ -1483,7 +1449,7 @@ deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
|
||||
__base::__move_assign(__c);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InputIter>
|
||||
@@ -1533,7 +1499,7 @@ deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_Allocator
|
||||
deque<_Tp, _Allocator>::get_allocator() const
|
||||
{
|
||||
@@ -1592,7 +1558,7 @@ deque<_Tp, _Allocator>::shrink_to_fit()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::reference
|
||||
deque<_Tp, _Allocator>::operator[](size_type __i)
|
||||
{
|
||||
@@ -1601,7 +1567,7 @@ deque<_Tp, _Allocator>::operator[](size_type __i)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::const_reference
|
||||
deque<_Tp, _Allocator>::operator[](size_type __i) const
|
||||
{
|
||||
@@ -1610,7 +1576,7 @@ deque<_Tp, _Allocator>::operator[](size_type __i) const
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::reference
|
||||
deque<_Tp, _Allocator>::at(size_type __i)
|
||||
{
|
||||
@@ -1621,7 +1587,7 @@ deque<_Tp, _Allocator>::at(size_type __i)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::const_reference
|
||||
deque<_Tp, _Allocator>::at(size_type __i) const
|
||||
{
|
||||
@@ -1632,7 +1598,7 @@ deque<_Tp, _Allocator>::at(size_type __i) const
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::reference
|
||||
deque<_Tp, _Allocator>::front()
|
||||
{
|
||||
@@ -1641,7 +1607,7 @@ deque<_Tp, _Allocator>::front()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::const_reference
|
||||
deque<_Tp, _Allocator>::front() const
|
||||
{
|
||||
@@ -1650,7 +1616,7 @@ deque<_Tp, _Allocator>::front() const
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::reference
|
||||
deque<_Tp, _Allocator>::back()
|
||||
{
|
||||
@@ -1659,7 +1625,7 @@ deque<_Tp, _Allocator>::back()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename deque<_Tp, _Allocator>::const_reference
|
||||
deque<_Tp, _Allocator>::back() const
|
||||
{
|
||||
@@ -1679,7 +1645,7 @@ deque<_Tp, _Allocator>::push_back(const value_type& __v)
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -1693,8 +1659,6 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
void
|
||||
@@ -1708,8 +1672,7 @@ deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -1724,7 +1687,7 @@ deque<_Tp, _Allocator>::push_front(const value_type& __v)
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -1739,8 +1702,6 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
void
|
||||
@@ -1755,8 +1716,7 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
|
||||
++__base::size();
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
@@ -1819,7 +1779,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
return __base::begin() + __pos;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
@@ -1876,8 +1836,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
|
||||
return __base::begin() + __pos;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
@@ -1934,8 +1892,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
||||
return __base::begin() + __pos;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
@@ -2697,7 +2654,7 @@ deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
deque<_Tp, _Allocator>::swap(deque& __c)
|
||||
{
|
||||
@@ -2705,7 +2662,7 @@ deque<_Tp, _Allocator>::swap(deque& __c)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
deque<_Tp, _Allocator>::clear()
|
||||
{
|
||||
|
@@ -115,25 +115,22 @@ class exception_ptr;
|
||||
exception_ptr current_exception();
|
||||
void rethrow_exception(exception_ptr); // noreturn
|
||||
|
||||
class _LIBCPP_VISIBLE exception_ptr
|
||||
class exception_ptr
|
||||
{
|
||||
void* __ptr_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr() : __ptr_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) : __ptr_() {}
|
||||
exception_ptr() : __ptr_() {}
|
||||
exception_ptr(nullptr_t) : __ptr_() {}
|
||||
exception_ptr(const exception_ptr&);
|
||||
exception_ptr& operator=(const exception_ptr&);
|
||||
~exception_ptr();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool() const {return __ptr_ != nullptr;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const exception_ptr& __x, const exception_ptr& __y)
|
||||
friend bool operator==(const exception_ptr& __x, const exception_ptr& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const exception_ptr& __x, const exception_ptr& __y)
|
||||
friend bool operator!=(const exception_ptr& __x, const exception_ptr& __y)
|
||||
{return !(__x == __y);}
|
||||
|
||||
friend exception_ptr current_exception();
|
||||
@@ -169,7 +166,7 @@ public:
|
||||
|
||||
// access functions
|
||||
void rethrow_nested /*[[noreturn]]*/ () const;
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const {return __ptr_;}
|
||||
exception_ptr nested_ptr() const {return __ptr_;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
@@ -177,21 +174,21 @@ struct __nested
|
||||
: public _Tp,
|
||||
public nested_exception
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
|
||||
explicit __nested(const _Tp& __t) : _Tp(__t) {}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
throw_with_nested /*[[noreturn]]*/ (_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)
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
throw_with_nested (_Tp& __t, typename enable_if<
|
||||
is_class<_Tp>::value && !is_base_of<nested_exception, _Tp>::value
|
||||
>::type* = 0)
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw __nested<typename remove_reference<_Tp>::type>(_STD::forward<_Tp>(__t));
|
||||
@@ -200,16 +197,16 @@ throw_with_nested (_Tp& __t, typename enable_if<
|
||||
|
||||
template <class _Tp>
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
throw_with_nested /*[[noreturn]]*/ (_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)
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
throw_with_nested (_Tp& __t, typename enable_if<
|
||||
!is_class<_Tp>::value || is_base_of<nested_exception, _Tp>::value
|
||||
>::type* = 0)
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw _STD::forward<_Tp>(__t);
|
||||
@@ -217,7 +214,7 @@ throw_with_nested (_Tp& __t, typename enable_if<
|
||||
}
|
||||
|
||||
template <class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
rethrow_if_nested(const _E& __e, typename enable_if<
|
||||
is_polymorphic<_E>::value
|
||||
@@ -229,7 +226,7 @@ rethrow_if_nested(const _E& __e, typename enable_if<
|
||||
}
|
||||
|
||||
template <class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
rethrow_if_nested(const _E& __e, typename enable_if<
|
||||
!is_polymorphic<_E>::value
|
||||
|
@@ -217,13 +217,11 @@ class __hash_map_hasher
|
||||
: private _Hash
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : _Hash() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_hasher() : _Hash() {}
|
||||
__hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
|
||||
const _Hash& hash_function() const {return *this;}
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const typename _Tp::first_type& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x);}
|
||||
};
|
||||
@@ -233,13 +231,11 @@ class __hash_map_hasher<_Tp, _Hash, false>
|
||||
{
|
||||
_Hash __hash_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : __hash_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return __hash_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_hasher() : __hash_() {}
|
||||
__hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
|
||||
const _Hash& hash_function() const {return __hash_;}
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return __hash_(__x.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const typename _Tp::first_type& __x) const
|
||||
{return __hash_(__x);}
|
||||
};
|
||||
@@ -249,19 +245,15 @@ class __hash_map_equal
|
||||
: private _Pred
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal() : _Pred() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : _Pred(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_equal() : _Pred() {}
|
||||
__hash_map_equal(const _Pred& __p) : _Pred(__p) {}
|
||||
const _Pred& key_eq() const {return *this;}
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x,
|
||||
const typename _Tp::first_type& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x, __y);}
|
||||
@@ -272,19 +264,15 @@ class __hash_map_equal<_Tp, _Pred, false>
|
||||
{
|
||||
_Pred __pred_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal() : __pred_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : __pred_(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return __pred_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_equal() : __pred_() {}
|
||||
__hash_map_equal(const _Pred& __p) : __pred_(__p) {}
|
||||
const _Pred& key_eq() const {return __pred_;}
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __pred_(__x.first, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
|
||||
{return __pred_(__x, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
|
||||
{return __pred_(__x.first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x,
|
||||
const typename _Tp::first_type& __y) const
|
||||
{return __pred_(__x, __y);}
|
||||
@@ -310,15 +298,13 @@ public:
|
||||
bool __first_constructed;
|
||||
bool __second_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_map_node_destructor(allocator_type& __na)
|
||||
: __na_(__na),
|
||||
__first_constructed(false),
|
||||
__second_constructed(false)
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
@@ -326,8 +312,7 @@ public:
|
||||
{
|
||||
__x.__value_constructed = false;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#else // _LIBCPP_MOVE
|
||||
__hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
@@ -335,9 +320,8 @@ public:
|
||||
{
|
||||
const_cast<bool&>(__x.__value_constructed) = false;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
if (__second_constructed)
|
||||
@@ -350,7 +334,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _HashIterator>
|
||||
class _LIBCPP_VISIBLE __hash_map_iterator
|
||||
class __hash_map_iterator
|
||||
{
|
||||
_HashIterator __i_;
|
||||
|
||||
@@ -370,15 +354,14 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {}
|
||||
__hash_map_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
__hash_map_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *operator->();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
reference operator*() const {return *operator->();}
|
||||
pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator& operator++() {++__i_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator& operator++() {++__i_; return *this;}
|
||||
__hash_map_iterator operator++(int)
|
||||
{
|
||||
__hash_map_iterator __t(*this);
|
||||
@@ -386,22 +369,20 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
friend bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
{return __x.__i_ == __y.__i_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
friend bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
{return __x.__i_ != __y.__i_;}
|
||||
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> friend class hash_map;
|
||||
template <class, class, class, class, class> friend class hash_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
template <class> friend class __hash_map_const_iterator;
|
||||
};
|
||||
|
||||
template <class _HashIterator>
|
||||
class _LIBCPP_VISIBLE __hash_map_const_iterator
|
||||
class __hash_map_const_iterator
|
||||
{
|
||||
_HashIterator __i_;
|
||||
|
||||
@@ -421,23 +402,17 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}
|
||||
__hash_map_const_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(
|
||||
__hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
|
||||
: __i_(__i.__i_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return *operator->();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator& operator++() {++__i_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator operator++(int)
|
||||
{
|
||||
__hash_map_const_iterator __t(*this);
|
||||
@@ -445,22 +420,20 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
friend bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
{return __x.__i_ == __y.__i_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
friend bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
{return __x.__i_ != __y.__i_;}
|
||||
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class, class, class, class, class> friend class hash_map;
|
||||
template <class, class, class, class, class> friend class hash_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
};
|
||||
|
||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||
class _LIBCPP_VISIBLE hash_map
|
||||
class hash_map
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -507,7 +480,7 @@ public:
|
||||
typedef __hash_map_iterator<typename __table::iterator> iterator;
|
||||
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY hash_map() {__table_.rehash(193);}
|
||||
hash_map() {__table_.rehash(193);}
|
||||
explicit hash_map(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
hash_map(size_type __n, const hasher& __hf,
|
||||
@@ -526,77 +499,52 @@ public:
|
||||
const allocator_type& __a);
|
||||
hash_map(const hash_map& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_map& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const
|
||||
{return __table_.hash_function().hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const
|
||||
{return __table_.key_eq().key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
mapped_type& operator[](const key_type& __k);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const
|
||||
{return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
|
||||
private:
|
||||
@@ -675,7 +623,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -698,7 +646,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -726,7 +674,7 @@ operator==(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -736,7 +684,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
|
||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||
class _LIBCPP_VISIBLE hash_multimap
|
||||
class hash_multimap
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -781,7 +729,6 @@ public:
|
||||
typedef __hash_map_iterator<typename __table::iterator> iterator;
|
||||
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hash_multimap() {__table_.rehash(193);}
|
||||
explicit hash_multimap(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -801,74 +748,49 @@ public:
|
||||
const allocator_type& __a);
|
||||
hash_multimap(const hash_multimap& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_multimap& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const
|
||||
{return __table_.hash_function().hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const
|
||||
{return __table_.key_eq().key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const
|
||||
{return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
};
|
||||
|
||||
@@ -931,7 +853,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -941,7 +863,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -973,7 +895,7 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
|
@@ -205,7 +205,7 @@ using namespace std;
|
||||
|
||||
template <class _Value, class _Hash = std::hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE hash_set
|
||||
class hash_set
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -231,7 +231,6 @@ public:
|
||||
typedef typename __table::const_iterator iterator;
|
||||
typedef typename __table::const_iterator const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hash_set() {__table_.rehash(193);}
|
||||
explicit hash_set(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -249,72 +248,47 @@ public:
|
||||
const allocator_type& __a);
|
||||
hash_set(const hash_set& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_set& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const {return __table_.hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const {return __table_.key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
};
|
||||
|
||||
@@ -376,7 +350,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -386,7 +360,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -414,7 +388,7 @@ operator==(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -424,7 +398,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
|
||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE hash_multiset
|
||||
class hash_multiset
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -450,7 +424,6 @@ public:
|
||||
typedef typename __table::const_iterator iterator;
|
||||
typedef typename __table::const_iterator const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hash_multiset() {__table_.rehash(193);}
|
||||
explicit hash_multiset(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -468,71 +441,46 @@ public:
|
||||
const key_equal& __eql, const allocator_type& __a);
|
||||
hash_multiset(const hash_multiset& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_multiset& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const {return __table_.hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const {return __table_.key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
};
|
||||
|
||||
@@ -595,7 +543,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -605,7 +553,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -637,7 +585,7 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
|
@@ -174,7 +174,7 @@ struct __forward_begin_node
|
||||
|
||||
pointer __next_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __forward_begin_node() : __next_(nullptr) {}
|
||||
__forward_begin_node() : __next_(nullptr) {}
|
||||
};
|
||||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
@@ -198,13 +198,12 @@ template<class, class> class forward_list;
|
||||
template<class> class __forward_list_const_iterator;
|
||||
|
||||
template <class _NodePtr>
|
||||
class _LIBCPP_VISIBLE __forward_list_iterator
|
||||
class __forward_list_iterator
|
||||
{
|
||||
typedef _NodePtr __node_pointer;
|
||||
|
||||
__node_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __forward_list_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
|
||||
template<class, class> friend class forward_list;
|
||||
@@ -225,21 +224,16 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_iterator() : __ptr_(nullptr) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &__ptr_->__value_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_iterator& operator++()
|
||||
{
|
||||
__ptr_ = __ptr_->__next_;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_iterator operator++(int)
|
||||
{
|
||||
__forward_list_iterator __t(*this);
|
||||
@@ -247,24 +241,21 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __forward_list_iterator& __x,
|
||||
const __forward_list_iterator& __y)
|
||||
friend bool operator==(const __forward_list_iterator& __x,
|
||||
const __forward_list_iterator& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __forward_list_iterator& __x,
|
||||
const __forward_list_iterator& __y)
|
||||
friend bool operator!=(const __forward_list_iterator& __x,
|
||||
const __forward_list_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
};
|
||||
|
||||
template <class _NodeConstPtr>
|
||||
class _LIBCPP_VISIBLE __forward_list_const_iterator
|
||||
class __forward_list_const_iterator
|
||||
{
|
||||
typedef _NodeConstPtr __node_const_pointer;
|
||||
|
||||
__node_const_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __forward_list_const_iterator(__node_const_pointer __p)
|
||||
: __ptr_(__p) {}
|
||||
|
||||
@@ -296,24 +287,18 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_const_iterator() : __ptr_(nullptr) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_const_iterator(__forward_list_iterator<__node_pointer> __p)
|
||||
: __ptr_(__p.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &__ptr_->__value_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_const_iterator& operator++()
|
||||
{
|
||||
__ptr_ = __ptr_->__next_;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_const_iterator operator++(int)
|
||||
{
|
||||
__forward_list_const_iterator __t(*this);
|
||||
@@ -321,12 +306,10 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __forward_list_const_iterator& __x,
|
||||
const __forward_list_const_iterator& __y)
|
||||
friend bool operator==(const __forward_list_const_iterator& __x,
|
||||
const __forward_list_const_iterator& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __forward_list_const_iterator& __x,
|
||||
friend bool operator!=(const __forward_list_const_iterator& __x,
|
||||
const __forward_list_const_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
};
|
||||
@@ -354,34 +337,28 @@ protected:
|
||||
|
||||
__compressed_pair<__begin_node, __node_allocator> __before_begin_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_pointer __before_begin()
|
||||
{return pointer_traits<__node_pointer>::pointer_to(
|
||||
static_cast<__node&>(__before_begin_.first()));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_const_pointer __before_begin() const
|
||||
{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();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __alloc() const {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()
|
||||
: __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
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__forward_list_base(__forward_list_base&& __x);
|
||||
__forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
private:
|
||||
__forward_list_base(const __forward_list_base&);
|
||||
@@ -390,12 +367,10 @@ protected:
|
||||
|
||||
~__forward_list_base();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __forward_list_base& __x)
|
||||
{__copy_assign_alloc(__x, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_copy_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x)
|
||||
{__move_assign_alloc(__x, integral_constant<bool,
|
||||
__node_traits::propagate_on_container_move_assignment::value>());}
|
||||
@@ -404,9 +379,7 @@ protected:
|
||||
void clear();
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __forward_list_base&, false_type) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __forward_list_base& __x, true_type)
|
||||
{
|
||||
if (__alloc() != __x.__alloc())
|
||||
@@ -414,21 +387,16 @@ private:
|
||||
__alloc() = __x.__alloc();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x, false_type) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__forward_list_base& __x, true_type)
|
||||
{__alloc() = _STD::move(__x.__alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
||||
{__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)
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y,
|
||||
true_type)
|
||||
{
|
||||
@@ -437,10 +405,10 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
|
||||
: __before_begin_(_STD::move(__x.__before_begin_))
|
||||
{
|
||||
@@ -448,7 +416,7 @@ __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
|
||||
const allocator_type& __a)
|
||||
: __before_begin_(__begin_node(), __node_allocator(__a))
|
||||
@@ -460,7 +428,7 @@ __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
__forward_list_base<_Tp, _Alloc>::~__forward_list_base()
|
||||
@@ -469,7 +437,7 @@ __forward_list_base<_Tp, _Alloc>::~__forward_list_base()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
__forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
|
||||
{
|
||||
@@ -494,7 +462,7 @@ __forward_list_base<_Tp, _Alloc>::clear()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc = allocator<_Tp> >
|
||||
class _LIBCPP_VISIBLE forward_list
|
||||
class forward_list
|
||||
: private __forward_list_base<_Tp, _Alloc>
|
||||
{
|
||||
typedef __forward_list_base<_Tp, _Alloc> base;
|
||||
@@ -512,7 +480,7 @@ public:
|
||||
typedef typename base::iterator iterator;
|
||||
typedef typename base::const_iterator const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY forward_list() {} // = default;
|
||||
forward_list() {} // = default;
|
||||
explicit forward_list(const allocator_type& __a);
|
||||
explicit forward_list(size_type __n);
|
||||
forward_list(size_type __n, const value_type& __v);
|
||||
@@ -530,18 +498,17 @@ public:
|
||||
>::type* = nullptr);
|
||||
forward_list(const forward_list& __x);
|
||||
forward_list(const forward_list& __x, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
forward_list(forward_list&& __x) : base(_STD::move(__x)) {}
|
||||
forward_list(forward_list&& __x, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
forward_list(initializer_list<value_type> __il);
|
||||
forward_list(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
|
||||
// ~forward_list() = default;
|
||||
|
||||
forward_list& operator=(const forward_list& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
forward_list& operator=(forward_list&& __x);
|
||||
#endif
|
||||
forward_list& operator=(initializer_list<value_type> __il);
|
||||
@@ -556,61 +523,42 @@ public:
|
||||
void assign(size_type __n, const value_type& __v);
|
||||
void assign(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return allocator_type(base::__alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return iterator(base::__before_begin()->__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return const_iterator(base::__before_begin()->__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return iterator(nullptr);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return const_iterator(nullptr);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return const_iterator(base::__before_begin()->__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return const_iterator(nullptr);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator before_begin() {return iterator(base::__before_begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator before_begin() const {return const_iterator(base::__before_begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbefore_begin() const {return const_iterator(base::__before_begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return base::__before_begin()->__next_ == nullptr;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return numeric_limits<size_type>::max();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference front() {return base::__before_begin()->__next_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference front() const {return base::__before_begin()->__next_->__value_;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args> void emplace_front(_Args&&... __args);
|
||||
#endif
|
||||
void push_front(value_type&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void push_front(const value_type& __v);
|
||||
|
||||
void pop_front();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
iterator emplace_after(const_iterator __p, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
iterator insert_after(const_iterator __p, value_type&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert_after(const_iterator __p, const value_type& __v);
|
||||
iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_input_iterator<_InputIterator>::value,
|
||||
@@ -623,40 +571,34 @@ public:
|
||||
iterator erase_after(const_iterator __p);
|
||||
iterator erase_after(const_iterator __f, const_iterator __l);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(forward_list& __x) {base::swap(__x);}
|
||||
|
||||
void resize(size_type __n);
|
||||
void resize(size_type __n, const value_type& __v);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {base::clear();}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void splice_after(const_iterator __p, forward_list&& __x);
|
||||
void splice_after(const_iterator __p, forward_list&& __x, const_iterator __i);
|
||||
void splice_after(const_iterator __p, forward_list&& __x,
|
||||
const_iterator __f, const_iterator __l);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
void splice_after(const_iterator __p, forward_list& __x);
|
||||
void splice_after(const_iterator __p, forward_list& __x, const_iterator __i);
|
||||
void splice_after(const_iterator __p, forward_list& __x,
|
||||
const_iterator __f, const_iterator __l);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void remove(const value_type& __v);
|
||||
template <class _Predicate> void remove_if(_Predicate __pred);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void unique() {unique(__equal_to<value_type>());}
|
||||
template <class _BinaryPredicate> void unique(_BinaryPredicate __binary_pred);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void merge(forward_list&& __x) {merge(_STD::move(__x), __less<value_type>());}
|
||||
template <class _Compare> void merge(forward_list&& __x, _Compare __comp);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#else // _LIBCPP_MOVE
|
||||
void merge(forward_list& __x) {merge(__x, __less<value_type>());}
|
||||
template <class _Compare> void merge(forward_list& __x, _Compare __comp);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
void sort() {sort(__less<value_type>());}
|
||||
template <class _Compare> void sort(_Compare __comp);
|
||||
void reverse();
|
||||
@@ -667,10 +609,10 @@ private:
|
||||
typedef typename base::__node_traits __node_traits;
|
||||
typedef typename base::__node_pointer __node_pointer;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void __move_assign(forward_list& __x, true_type);
|
||||
void __move_assign(forward_list& __x, false_type);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Compare>
|
||||
static
|
||||
@@ -684,7 +626,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
forward_list<_Tp, _Alloc>::forward_list(const allocator_type& __a)
|
||||
: base(__a)
|
||||
{
|
||||
@@ -763,7 +705,7 @@ forward_list<_Tp, _Alloc>::forward_list(const forward_list& __x,
|
||||
insert_after(cbefore_begin(), __x.begin(), __x.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
|
||||
@@ -777,7 +719,7 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il)
|
||||
@@ -805,7 +747,7 @@ forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
@@ -831,7 +773,7 @@ forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, false_type)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
forward_list<_Tp, _Alloc>&
|
||||
forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
|
||||
{
|
||||
@@ -840,10 +782,10 @@ forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
forward_list<_Tp, _Alloc>&
|
||||
forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
@@ -887,15 +829,14 @@ forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
|
||||
{
|
||||
assign(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class... _Args>
|
||||
@@ -911,8 +852,6 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
|
||||
base::__before_begin()->__next_ = __h.release();
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
|
||||
@@ -925,7 +864,7 @@ forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
|
||||
base::__before_begin()->__next_ = __h.release();
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
@@ -950,8 +889,7 @@ forward_list<_Tp, _Alloc>::pop_front()
|
||||
__node_traits::deallocate(__a, __p, 1);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class... _Args>
|
||||
@@ -969,8 +907,6 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args)
|
||||
return iterator(__r->__next_);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
typename forward_list<_Tp, _Alloc>::iterator
|
||||
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
|
||||
@@ -985,7 +921,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
|
||||
return iterator(__r->__next_);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
typename forward_list<_Tp, _Alloc>::iterator
|
||||
@@ -1201,7 +1137,7 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v)
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
forward_list&& __x)
|
||||
#else
|
||||
forward_list& __x)
|
||||
@@ -1226,7 +1162,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
forward_list&& __x,
|
||||
#else
|
||||
forward_list& __x,
|
||||
@@ -1248,7 +1184,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
forward_list&& __x,
|
||||
#else
|
||||
forward_list& __x,
|
||||
@@ -1336,7 +1272,7 @@ forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class _Compare>
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
forward_list<_Tp, _Alloc>::merge(forward_list&& __x, _Compare __comp)
|
||||
#else
|
||||
forward_list<_Tp, _Alloc>::merge(forward_list& __x, _Compare __comp)
|
||||
@@ -1398,7 +1334,7 @@ forward_list<_Tp, _Alloc>::__merge(__node_pointer __f1, __node_pointer __f2,
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
forward_list<_Tp, _Alloc>::sort(_Compare __comp)
|
||||
{
|
||||
@@ -1473,7 +1409,7 @@ bool operator==(const forward_list<_Tp, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool operator!=(const forward_list<_Tp, _Alloc>& __x,
|
||||
const forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1481,7 +1417,7 @@ bool operator!=(const forward_list<_Tp, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool operator< (const forward_list<_Tp, _Alloc>& __x,
|
||||
const forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1490,7 +1426,7 @@ bool operator< (const forward_list<_Tp, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool operator> (const forward_list<_Tp, _Alloc>& __x,
|
||||
const forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1498,7 +1434,7 @@ bool operator> (const forward_list<_Tp, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool operator>=(const forward_list<_Tp, _Alloc>& __x,
|
||||
const forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1506,7 +1442,7 @@ bool operator>=(const forward_list<_Tp, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool operator<=(const forward_list<_Tp, _Alloc>& __x,
|
||||
const forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1514,7 +1450,7 @@ bool operator<=(const forward_list<_Tp, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
|
@@ -176,7 +176,7 @@ typedef basic_fstream<wchar_t> wfstream;
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_filebuf
|
||||
class basic_filebuf
|
||||
: public basic_streambuf<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -189,13 +189,13 @@ public:
|
||||
|
||||
// 27.9.1.2 Constructors/destructor:
|
||||
basic_filebuf();
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_filebuf(basic_filebuf&& __rhs);
|
||||
#endif
|
||||
virtual ~basic_filebuf();
|
||||
|
||||
// 27.9.1.3 Assign/swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_filebuf& operator=(basic_filebuf&& __rhs);
|
||||
#endif
|
||||
void swap(basic_filebuf& __rhs);
|
||||
@@ -260,7 +260,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()
|
||||
setbuf(0, 4096);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
|
||||
@@ -333,7 +333,7 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
|
||||
swap(__rhs);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
|
||||
@@ -957,7 +957,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
|
||||
// basic_ifstream
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ifstream
|
||||
class basic_ifstream
|
||||
: public basic_istream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -970,11 +970,11 @@ public:
|
||||
basic_ifstream();
|
||||
explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in);
|
||||
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ifstream(basic_ifstream&& __rhs);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ifstream& operator=(basic_ifstream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ifstream& __rhs);
|
||||
@@ -1014,7 +1014,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1035,7 +1035,7 @@ basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1102,7 +1102,7 @@ basic_ifstream<_CharT, _Traits>::close()
|
||||
// basic_ofstream
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ofstream
|
||||
class basic_ofstream
|
||||
: public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -1115,11 +1115,11 @@ public:
|
||||
basic_ofstream();
|
||||
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
|
||||
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ofstream(basic_ofstream&& __rhs);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ofstream& operator=(basic_ofstream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ofstream& __rhs);
|
||||
@@ -1159,7 +1159,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1180,7 +1180,7 @@ basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1247,7 +1247,7 @@ basic_ofstream<_CharT, _Traits>::close()
|
||||
// basic_fstream
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_fstream
|
||||
class basic_fstream
|
||||
: public basic_iostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -1260,11 +1260,11 @@ public:
|
||||
basic_fstream();
|
||||
explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_fstream(basic_fstream&& __rhs);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_fstream& operator=(basic_fstream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_fstream& __rhs);
|
||||
@@ -1304,7 +1304,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1325,7 +1325,7 @@ basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
|
@@ -478,133 +478,133 @@ POLICY: For non-variadic implementations, the number of arguments is limited
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE plus : binary_function<_Tp, _Tp, _Tp>
|
||||
struct plus : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x + __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE minus : binary_function<_Tp, _Tp, _Tp>
|
||||
struct minus : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x - __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE multiplies : binary_function<_Tp, _Tp, _Tp>
|
||||
struct multiplies : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x * __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE divides : binary_function<_Tp, _Tp, _Tp>
|
||||
struct divides : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x / __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE modulus : binary_function<_Tp, _Tp, _Tp>
|
||||
struct modulus : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x % __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE negate : unary_function<_Tp, _Tp>
|
||||
struct negate : unary_function<_Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const
|
||||
{return -__x;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE equal_to : binary_function<_Tp, _Tp, bool>
|
||||
struct equal_to : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x == __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE not_equal_to : binary_function<_Tp, _Tp, bool>
|
||||
struct not_equal_to : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x != __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE greater : binary_function<_Tp, _Tp, bool>
|
||||
struct greater : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x > __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE less : binary_function<_Tp, _Tp, bool>
|
||||
struct less : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x < __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE greater_equal : binary_function<_Tp, _Tp, bool>
|
||||
struct greater_equal : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x >= __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE less_equal : binary_function<_Tp, _Tp, bool>
|
||||
struct less_equal : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x <= __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE logical_and : binary_function<_Tp, _Tp, bool>
|
||||
struct logical_and : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x && __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE logical_or : binary_function<_Tp, _Tp, bool>
|
||||
struct logical_or : binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x || __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE logical_not : unary_function<_Tp, bool>
|
||||
struct logical_not : unary_function<_Tp, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x) const
|
||||
{return !__x;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE bit_and : binary_function<_Tp, _Tp, _Tp>
|
||||
struct bit_and : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x & __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE bit_or : binary_function<_Tp, _Tp, _Tp>
|
||||
struct bit_or : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x | __y;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE bit_xor : binary_function<_Tp, _Tp, _Tp>
|
||||
struct bit_xor : binary_function<_Tp, _Tp, _Tp>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __x ^ __y;}
|
||||
};
|
||||
|
||||
template <class _Predicate>
|
||||
class _LIBCPP_VISIBLE unary_negate
|
||||
class unary_negate
|
||||
: public unary_function<typename _Predicate::argument_type, bool>
|
||||
{
|
||||
_Predicate __pred_;
|
||||
@@ -621,7 +621,7 @@ unary_negate<_Predicate>
|
||||
not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
|
||||
|
||||
template <class _Predicate>
|
||||
class _LIBCPP_VISIBLE binary_negate
|
||||
class binary_negate
|
||||
: public binary_function<typename _Predicate::first_argument_type,
|
||||
typename _Predicate::second_argument_type,
|
||||
bool>
|
||||
@@ -641,7 +641,7 @@ binary_negate<_Predicate>
|
||||
not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
|
||||
|
||||
template <class __Operation>
|
||||
class _LIBCPP_VISIBLE binder1st
|
||||
class binder1st
|
||||
: public unary_function<typename __Operation::second_argument_type,
|
||||
typename __Operation::result_type>
|
||||
{
|
||||
@@ -667,7 +667,7 @@ bind1st(const __Operation& __op, const _Tp& __x)
|
||||
{return binder1st<__Operation>(__op, __x);}
|
||||
|
||||
template <class __Operation>
|
||||
class _LIBCPP_VISIBLE binder2nd
|
||||
class binder2nd
|
||||
: public unary_function<typename __Operation::first_argument_type,
|
||||
typename __Operation::result_type>
|
||||
{
|
||||
@@ -675,7 +675,6 @@ protected:
|
||||
__Operation op;
|
||||
typename __Operation::second_argument_type value;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y)
|
||||
: op(__x), value(__y) {}
|
||||
_LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
|
||||
@@ -693,8 +692,7 @@ bind2nd(const __Operation& __op, const _Tp& __x)
|
||||
{return binder2nd<__Operation>(__op, __x);}
|
||||
|
||||
template <class _Arg, class _Result>
|
||||
class _LIBCPP_VISIBLE pointer_to_unary_function
|
||||
: public unary_function<_Arg, _Result>
|
||||
class pointer_to_unary_function : public unary_function<_Arg, _Result>
|
||||
{
|
||||
_Result (*__f_)(_Arg);
|
||||
public:
|
||||
@@ -711,8 +709,7 @@ ptr_fun(_Result (*__f)(_Arg))
|
||||
{return pointer_to_unary_function<_Arg,_Result>(__f);}
|
||||
|
||||
template <class _Arg1, class _Arg2, class _Result>
|
||||
class _LIBCPP_VISIBLE pointer_to_binary_function
|
||||
: public binary_function<_Arg1, _Arg2, _Result>
|
||||
class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result>
|
||||
{
|
||||
_Result (*__f_)(_Arg1, _Arg2);
|
||||
public:
|
||||
@@ -729,7 +726,7 @@ ptr_fun(_Result (*__f)(_Arg1,_Arg2))
|
||||
{return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
|
||||
|
||||
template<class _Sp, class _Tp>
|
||||
class _LIBCPP_VISIBLE mem_fun_t : public unary_function<_Tp*, _Sp>
|
||||
class mem_fun_t : public unary_function<_Tp*, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)();
|
||||
public:
|
||||
@@ -740,7 +737,7 @@ public:
|
||||
};
|
||||
|
||||
template<class _Sp, class _Tp, class _Ap>
|
||||
class _LIBCPP_VISIBLE mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
|
||||
class mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)(_Ap);
|
||||
public:
|
||||
@@ -763,7 +760,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap))
|
||||
{return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
|
||||
|
||||
template<class _Sp, class _Tp>
|
||||
class _LIBCPP_VISIBLE mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
||||
class mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)();
|
||||
public:
|
||||
@@ -774,7 +771,7 @@ public:
|
||||
};
|
||||
|
||||
template<class _Sp, class _Tp, class _Ap>
|
||||
class _LIBCPP_VISIBLE mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
|
||||
class mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)(_Ap);
|
||||
public:
|
||||
@@ -797,7 +794,7 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
|
||||
{return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
|
||||
|
||||
template <class _Sp, class _Tp>
|
||||
class _LIBCPP_VISIBLE const_mem_fun_t : public unary_function<const _Tp*, _Sp>
|
||||
class const_mem_fun_t : public unary_function<const _Tp*, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)() const;
|
||||
public:
|
||||
@@ -808,7 +805,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Sp, class _Tp, class _Ap>
|
||||
class _LIBCPP_VISIBLE const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
|
||||
class const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)(_Ap) const;
|
||||
public:
|
||||
@@ -831,7 +828,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap) const)
|
||||
{return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
|
||||
|
||||
template <class _Sp, class _Tp>
|
||||
class _LIBCPP_VISIBLE const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
||||
class const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)() const;
|
||||
public:
|
||||
@@ -842,8 +839,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Sp, class _Tp, class _Ap>
|
||||
class _LIBCPP_VISIBLE const_mem_fun1_ref_t
|
||||
: public binary_function<_Tp, _Ap, _Sp>
|
||||
class const_mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
|
||||
{
|
||||
_Sp (_Tp::*__p_)(_Ap) const;
|
||||
public:
|
||||
@@ -886,7 +882,6 @@ public:
|
||||
|
||||
// invoke
|
||||
template <class... _ArgTypes>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return<type, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args)
|
||||
{
|
||||
@@ -936,12 +931,12 @@ mem_fn(_R (_T::* __pm)(_Args...) const volatile)
|
||||
|
||||
// bad_function_call
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_function_call
|
||||
class bad_function_call
|
||||
: public exception
|
||||
{
|
||||
};
|
||||
|
||||
template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
|
||||
template<class _Fp> class function; // undefined
|
||||
|
||||
namespace __function
|
||||
{
|
||||
@@ -976,8 +971,8 @@ class __base<_R(_ArgTypes...)>
|
||||
__base(const __base&);
|
||||
__base& operator=(const __base&);
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __base() {}
|
||||
_LIBCPP_INLINE_VISIBILITY virtual ~__base() {}
|
||||
__base() {}
|
||||
virtual ~__base() {}
|
||||
virtual __base* __clone() const = 0;
|
||||
virtual void __clone(__base*) const = 0;
|
||||
virtual void destroy() = 0;
|
||||
@@ -997,9 +992,7 @@ class __func<_F, _Alloc, _R(_ArgTypes...)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
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;
|
||||
@@ -1078,7 +1071,7 @@ __func<_F, _Alloc, _R(_ArgTypes...)>::target_type() const
|
||||
} // __function
|
||||
|
||||
template<class _R, class ..._ArgTypes>
|
||||
class _LIBCPP_VISIBLE function<_R(_ArgTypes...)>
|
||||
class function<_R(_ArgTypes...)>
|
||||
: public __function::__maybe_derive_from_unary_function<_R(_ArgTypes...)>,
|
||||
public __function::__maybe_derive_from_binary_function<_R(_ArgTypes...)>
|
||||
{
|
||||
@@ -1087,33 +1080,24 @@ class _LIBCPP_VISIBLE function<_R(_ArgTypes...)>
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_A...)) {return __p;}
|
||||
template <class _R2, class _C, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_A...)) {return __p;}
|
||||
template <class _R2, class _C, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_A...) const) {return __p;}
|
||||
template <class _R2, class _C, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_A...) volatile) {return __p;}
|
||||
template <class _R2, class _C, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_A...) const volatile) {return __p;}
|
||||
template <class _R2, class ..._A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_A...)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
function(function&&);
|
||||
@@ -1122,10 +1106,8 @@ public:
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -1151,19 +1133,17 @@ public:
|
||||
// function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F&& __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, _STD::forward<_F>(__f)).swap(*this);}
|
||||
|
||||
// function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*explicit*/ operator bool() const {return __f_;}
|
||||
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class... _ArgTypes2>
|
||||
bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete;
|
||||
bool operator==(const function<_R2(_ArgTypes2...)>&) = delete;
|
||||
template<class _R2, class... _ArgTypes2>
|
||||
bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
|
||||
bool operator!=(const function<_R2(_ArgTypes2...)>&) = delete;
|
||||
public:
|
||||
// function invocation:
|
||||
_R operator()(_ArgTypes...) const;
|
||||
@@ -1473,11 +1453,11 @@ swap(function<_R(_ArgTypes...)>& __x, function<_R(_ArgTypes...)>& __y)
|
||||
{return __x.swap(__y);}
|
||||
|
||||
template<class _Tp> struct __is_bind_expression : public false_type {};
|
||||
template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
|
||||
template<class _Tp> struct is_bind_expression
|
||||
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
||||
|
||||
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
||||
template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
|
||||
template<class _Tp> struct is_placeholder
|
||||
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
||||
|
||||
namespace placeholders
|
||||
@@ -1665,34 +1645,30 @@ class __bind
|
||||
|
||||
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind(__bind&& __b)
|
||||
: __f_(_STD::move(__b.__f_)),
|
||||
__bound_args_(_STD::move(__b.__bound_args_)) {}
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __bind(_G&& __f, _BA&& ...__bound_args)
|
||||
: __f_(_STD::forward<_G>(__f)),
|
||||
__bound_args_(_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
// compiler bug workaround
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
|
||||
tuple<_Args&&...>(__args...));
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
|
||||
tuple<_Args&&...>(__args...));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1708,13 +1684,11 @@ public:
|
||||
typedef _R result_type;
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
|
||||
: base(_STD::forward<_G>(__f),
|
||||
_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
@@ -1722,7 +1696,6 @@ public:
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
@@ -1754,118 +1727,104 @@ bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<bool>
|
||||
struct hash<bool>
|
||||
: public unary_function<bool, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(bool __v) const {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<char>
|
||||
struct hash<char>
|
||||
: public unary_function<char, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(char __v) const {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<signed char>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<unsigned char>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<char16_t>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<char32_t>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<wchar_t>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<short>
|
||||
struct hash<short>
|
||||
: public unary_function<short, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(short __v) const {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<unsigned short>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<int>
|
||||
struct hash<int>
|
||||
: public unary_function<int, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(int __v) const {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<unsigned int>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<long>
|
||||
struct hash<long>
|
||||
: public unary_function<long, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(long __v) const {return static_cast<size_t>(__v);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<unsigned long>
|
||||
struct 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);}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<long long>
|
||||
struct hash<long long>
|
||||
: public unary_function<long long, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(long long __v) const
|
||||
{
|
||||
size_t __r = 0;
|
||||
@@ -1877,10 +1836,9 @@ struct _LIBCPP_VISIBLE hash<long long>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<unsigned long long>
|
||||
struct 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 __r = 0;
|
||||
@@ -1892,10 +1850,9 @@ struct _LIBCPP_VISIBLE hash<unsigned long long>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<float>
|
||||
struct hash<float>
|
||||
: public unary_function<float, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(float __v) const
|
||||
{
|
||||
if (__v == 0)
|
||||
@@ -1906,10 +1863,9 @@ struct _LIBCPP_VISIBLE hash<float>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<double>
|
||||
struct hash<double>
|
||||
: public unary_function<double, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(double __v) const
|
||||
{
|
||||
if (__v == 0)
|
||||
@@ -1923,10 +1879,9 @@ struct _LIBCPP_VISIBLE hash<double>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<long double>
|
||||
struct hash<long double>
|
||||
: public unary_function<long double, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(long double __v) const
|
||||
{
|
||||
if (__v == 0)
|
||||
|
2111
include/future
2111
include/future
File diff suppressed because it is too large
Load Diff
@@ -52,7 +52,7 @@ namespace std // purposefully not versioned
|
||||
{
|
||||
|
||||
template<class _E>
|
||||
class _LIBCPP_VISIBLE initializer_list
|
||||
class initializer_list
|
||||
{
|
||||
const _E* __begin_;
|
||||
size_t __size_;
|
||||
|
@@ -43,12 +43,10 @@ class __iom_t1
|
||||
{
|
||||
ios_base::fmtflags __mask_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t1(ios_base::fmtflags __m) : __mask_(__m) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t1& __x)
|
||||
{
|
||||
@@ -58,7 +56,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t1& __x)
|
||||
{
|
||||
@@ -80,12 +77,10 @@ class __iom_t2
|
||||
{
|
||||
ios_base::fmtflags __mask_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t2(ios_base::fmtflags __m) : __mask_(__m) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t2& __x)
|
||||
{
|
||||
@@ -95,7 +90,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t2& __x)
|
||||
{
|
||||
@@ -117,12 +111,10 @@ class __iom_t3
|
||||
{
|
||||
int __base_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t3(int __b) : __base_(__b) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t3& __x)
|
||||
{
|
||||
@@ -135,7 +127,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t3& __x)
|
||||
{
|
||||
@@ -161,12 +152,10 @@ class __iom_t4
|
||||
{
|
||||
_CharT __fill_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t4(_CharT __c) : __fill_(__c) {}
|
||||
|
||||
template <class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t4& __x)
|
||||
{
|
||||
@@ -189,12 +178,10 @@ class __iom_t5
|
||||
{
|
||||
int __n_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t5(int __n) : __n_(__n) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t5& __x)
|
||||
{
|
||||
@@ -204,7 +191,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t5& __x)
|
||||
{
|
||||
@@ -226,12 +212,10 @@ class __iom_t6
|
||||
{
|
||||
int __n_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t6(int __n) : __n_(__n) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t6& __x)
|
||||
{
|
||||
@@ -241,7 +225,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t6& __x)
|
||||
{
|
||||
@@ -271,7 +254,6 @@ class __iom_t7
|
||||
_MoneyT& __mon_;
|
||||
bool __intl_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t7(_MoneyT& __mon, bool __intl)
|
||||
: __mon_(__mon), __intl_(__intl) {}
|
||||
|
||||
@@ -331,7 +313,6 @@ class __iom_t8
|
||||
const _MoneyT& __mon_;
|
||||
bool __intl_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t8(const _MoneyT& __mon, bool __intl)
|
||||
: __mon_(__mon), __intl_(__intl) {}
|
||||
|
||||
@@ -390,7 +371,6 @@ class __iom_t9
|
||||
tm* __tm_;
|
||||
const _CharT* __fmt_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t9(tm* __tm, const _CharT* __fmt)
|
||||
: __tm_(__tm), __fmt_(__fmt) {}
|
||||
|
||||
@@ -451,7 +431,6 @@ class __iom_t10
|
||||
const tm* __tm_;
|
||||
const _CharT* __fmt_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t10(const tm* __tm, const _CharT* __fmt)
|
||||
: __tm_(__tm), __fmt_(__fmt) {}
|
||||
|
||||
|
22
include/ios
22
include/ios
@@ -222,7 +222,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
typedef ptrdiff_t streamsize;
|
||||
|
||||
class _LIBCPP_VISIBLE ios_base
|
||||
class ios_base
|
||||
{
|
||||
public:
|
||||
class failure;
|
||||
@@ -323,7 +323,6 @@ public:
|
||||
void __set_failbit_and_consider_rethrow();
|
||||
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ios_base() {// purposefully does no initialization
|
||||
}
|
||||
|
||||
@@ -371,7 +370,7 @@ private:
|
||||
};
|
||||
|
||||
//enum class io_errc
|
||||
struct _LIBCPP_VISIBLE io_errc
|
||||
struct io_errc
|
||||
{
|
||||
enum _ {
|
||||
stream = 1
|
||||
@@ -382,12 +381,9 @@ enum _ {
|
||||
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc> : public true_type { };
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc::_> : public true_type { };
|
||||
template <> struct is_error_code_enum<io_errc> : public true_type { };
|
||||
template <> struct is_error_code_enum<io_errc::_> : public true_type { };
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
const error_category& iostream_category();
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -404,7 +400,7 @@ make_error_condition(io_errc __e)
|
||||
return error_condition(static_cast<int>(__e), iostream_category());
|
||||
}
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI ios_base::failure
|
||||
class ios_base::failure
|
||||
: public system_error
|
||||
{
|
||||
public:
|
||||
@@ -413,7 +409,7 @@ public:
|
||||
virtual ~failure() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE ios_base::Init
|
||||
class ios_base::Init
|
||||
{
|
||||
public:
|
||||
Init();
|
||||
@@ -560,7 +556,7 @@ ios_base::exceptions(iostate __except)
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ios
|
||||
class basic_ios
|
||||
: public ios_base
|
||||
{
|
||||
public:
|
||||
@@ -608,14 +604,12 @@ public:
|
||||
char_type widen(char __c) const;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
basic_ios() {// purposefully does no initialization
|
||||
}
|
||||
void init(basic_streambuf<char_type, traits_type>* __sb);
|
||||
|
||||
void move(basic_ios& __rhs);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void move(basic_ios&& __rhs) {move(__rhs);}
|
||||
#endif
|
||||
void swap(basic_ios& __rhs);
|
||||
|
@@ -92,47 +92,32 @@ typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template<class _CharT> struct _LIBCPP_VISIBLE char_traits;
|
||||
template<class _Tp> class _LIBCPP_VISIBLE allocator;
|
||||
template<class _CharT> struct char_traits;
|
||||
template<class _Tp> class allocator;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ios;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ios;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_streambuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_istream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ostream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_iostream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_streambuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_istream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ostream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_iostream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_stringbuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_istringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ostringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_stringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_stringbuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_istringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_ostringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_stringstream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_filebuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ifstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ofstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_fstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_filebuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ifstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ofstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_fstream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE istreambuf_iterator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE ostreambuf_iterator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class istreambuf_iterator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class ostreambuf_iterator;
|
||||
|
||||
typedef basic_ios<char> ios;
|
||||
typedef basic_ios<wchar_t> wios;
|
||||
@@ -167,7 +152,7 @@ typedef basic_ifstream<wchar_t> wifstream;
|
||||
typedef basic_ofstream<wchar_t> wofstream;
|
||||
typedef basic_fstream<wchar_t> wfstream;
|
||||
|
||||
template <class _State> class _LIBCPP_VISIBLE fpos;
|
||||
template <class _State> class fpos;
|
||||
typedef fpos<mbstate_t> streampos;
|
||||
typedef fpos<mbstate_t> wstreampos;
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
@@ -179,8 +164,7 @@ typedef long long streamoff; // for char_traits in <string>
|
||||
|
||||
template <class _CharT, // for <stdexcept>
|
||||
class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_string;
|
||||
class _Allocator = allocator<_CharT> > class basic_string;
|
||||
typedef basic_string<char, char_traits<char>, allocator<char> > string;
|
||||
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
|
||||
|
||||
|
@@ -160,7 +160,7 @@ template <class charT, class traits, class T>
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_istream
|
||||
class basic_istream
|
||||
: virtual public basic_ios<_CharT, _Traits>
|
||||
{
|
||||
streamsize __gc_;
|
||||
@@ -176,12 +176,12 @@ public:
|
||||
explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb);
|
||||
virtual ~basic_istream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_istream(basic_istream&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.7.1.1.2 Assign/swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_istream& operator=(basic_istream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_istream& __rhs);
|
||||
@@ -211,7 +211,6 @@ public:
|
||||
basic_istream& operator>>(void*& __p);
|
||||
|
||||
// 27.7.1.3 Unformatted input:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
streamsize gcount() const {return __gc_;}
|
||||
int_type get();
|
||||
basic_istream& get(char_type& __c);
|
||||
@@ -238,7 +237,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_istream<_CharT, _Traits>::sentry
|
||||
class basic_istream<_CharT, _Traits>::sentry
|
||||
{
|
||||
bool __ok_;
|
||||
|
||||
@@ -249,7 +248,6 @@ public:
|
||||
explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
|
||||
// ~sentry() = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool() const {return __ok_;}
|
||||
};
|
||||
@@ -289,7 +287,7 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_
|
||||
this->init(__sb);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -309,7 +307,7 @@ basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT, _Traits>::~basic_istream()
|
||||
@@ -1465,7 +1463,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
|
||||
return __is;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1476,10 +1474,10 @@ operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
|
||||
return __is;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_iostream
|
||||
class basic_iostream
|
||||
: public basic_istream<_CharT, _Traits>,
|
||||
public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
@@ -1495,12 +1493,12 @@ public:
|
||||
explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb);
|
||||
virtual ~basic_iostream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_iostream(basic_iostream&& __rhs);
|
||||
#endif
|
||||
|
||||
// assign/swap
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_iostream& operator=(basic_iostream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_iostream& __rhs);
|
||||
@@ -1514,7 +1512,7 @@ basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, trait
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1532,7 +1530,7 @@ basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_iostream<_CharT, _Traits>::~basic_iostream()
|
||||
@@ -1649,7 +1647,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str)
|
||||
@@ -1657,10 +1655,10 @@ getline(basic_istream<_CharT, _Traits>& __is,
|
||||
return getline(__is, __str, __is.widen('\n'));
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
|
||||
@@ -1669,7 +1667,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str)
|
||||
@@ -1677,7 +1675,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
return getline(__is, __str, __is.widen('\n'));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
|
@@ -151,7 +151,7 @@ public:
|
||||
typedef void pointer;
|
||||
|
||||
explicit back_insert_iterator(Container& x);
|
||||
back_insert_iterator& operator=(const typename Container::value_type& value);
|
||||
back_insert_iterator& operator=(typename Container::const_reference value);
|
||||
back_insert_iterator& operator*();
|
||||
back_insert_iterator& operator++();
|
||||
back_insert_iterator operator++(int);
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
typedef void pointer;
|
||||
|
||||
explicit front_insert_iterator(Container& x);
|
||||
front_insert_iterator& operator=(const typename Container::value_type& value);
|
||||
front_insert_iterator& operator=(typename Container::const_reference value);
|
||||
front_insert_iterator& operator*();
|
||||
front_insert_iterator& operator++();
|
||||
front_insert_iterator operator++(int);
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
typedef void pointer;
|
||||
|
||||
insert_iterator(Container& x, typename Container::iterator i);
|
||||
insert_iterator& operator=(const typename Container::value_type& value);
|
||||
insert_iterator& operator=(typename Container::const_reference value);
|
||||
insert_iterator& operator*();
|
||||
insert_iterator& operator++();
|
||||
insert_iterator& operator++(int);
|
||||
@@ -325,11 +325,11 @@ template <class T, size_t N> T* end(T (&array)[N]);
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
struct _LIBCPP_VISIBLE input_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE output_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE forward_iterator_tag : public input_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE random_access_iterator_tag : public bidirectional_iterator_tag {};
|
||||
struct input_iterator_tag {};
|
||||
struct output_iterator_tag {};
|
||||
struct forward_iterator_tag : public input_iterator_tag {};
|
||||
struct bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
|
||||
|
||||
template <class _Tp>
|
||||
struct __has_iterator_category
|
||||
@@ -372,11 +372,11 @@ struct __iterator_traits<_Iter, true>
|
||||
// the client expects instead of failing at compile time.
|
||||
|
||||
template <class _Iter>
|
||||
struct _LIBCPP_VISIBLE iterator_traits
|
||||
struct iterator_traits
|
||||
: __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};
|
||||
|
||||
template<class _Tp>
|
||||
struct _LIBCPP_VISIBLE iterator_traits<_Tp*>
|
||||
struct iterator_traits<_Tp*>
|
||||
{
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef typename remove_const<_Tp>::type value_type;
|
||||
@@ -407,7 +407,7 @@ struct __is_random_access_iterator : public __has_iterator_category_convertible_
|
||||
|
||||
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
|
||||
class _Pointer = _Tp*, class _Reference = _Tp&>
|
||||
struct _LIBCPP_VISIBLE iterator
|
||||
struct iterator
|
||||
{
|
||||
typedef _Tp value_type;
|
||||
typedef _Distance difference_type;
|
||||
@@ -482,7 +482,7 @@ distance(_InputIter __first, _InputIter __last)
|
||||
}
|
||||
|
||||
template <class _ForwardIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_ForwardIter
|
||||
next(_ForwardIter __x,
|
||||
typename iterator_traits<_ForwardIter>::difference_type __n = 1,
|
||||
@@ -493,7 +493,7 @@ next(_ForwardIter __x,
|
||||
}
|
||||
|
||||
template <class _BidiretionalIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_BidiretionalIter
|
||||
prev(_BidiretionalIter __x,
|
||||
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
|
||||
@@ -504,7 +504,7 @@ prev(_BidiretionalIter __x,
|
||||
}
|
||||
|
||||
template <class _Iter>
|
||||
class _LIBCPP_VISIBLE reverse_iterator
|
||||
class reverse_iterator
|
||||
: public iterator<typename iterator_traits<_Iter>::iterator_category,
|
||||
typename iterator_traits<_Iter>::value_type,
|
||||
typename iterator_traits<_Iter>::difference_type,
|
||||
@@ -611,7 +611,7 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
|
||||
}
|
||||
|
||||
template <class _Container>
|
||||
class _LIBCPP_VISIBLE back_insert_iterator
|
||||
class back_insert_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
void,
|
||||
void,
|
||||
@@ -624,12 +624,12 @@ public:
|
||||
typedef _Container container_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(&__x) {}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value)
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::const_reference __value)
|
||||
{container->push_back(__value); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{container->push_back(_STD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator operator++(int) {return *this;}
|
||||
@@ -644,7 +644,7 @@ back_inserter(_Container& __x)
|
||||
}
|
||||
|
||||
template <class _Container>
|
||||
class _LIBCPP_VISIBLE front_insert_iterator
|
||||
class front_insert_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
void,
|
||||
void,
|
||||
@@ -657,12 +657,12 @@ public:
|
||||
typedef _Container container_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(&__x) {}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value)
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::const_reference __value)
|
||||
{container->push_front(__value); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{container->push_front(_STD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator operator++(int) {return *this;}
|
||||
@@ -677,7 +677,7 @@ front_inserter(_Container& __x)
|
||||
}
|
||||
|
||||
template <class _Container>
|
||||
class _LIBCPP_VISIBLE insert_iterator
|
||||
class insert_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
void,
|
||||
void,
|
||||
@@ -692,12 +692,12 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator(_Container& __x, typename _Container::iterator __i)
|
||||
: container(&__x), iter(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value)
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::const_reference __value)
|
||||
{iter = container->insert(iter, __value); ++iter; return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{iter = container->insert(iter, _STD::move(__value)); ++iter; return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int) {return *this;}
|
||||
@@ -713,7 +713,7 @@ inserter(_Container& __x, typename _Container::iterator __i)
|
||||
|
||||
template <class _Tp, class _CharT = char,
|
||||
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
|
||||
class _LIBCPP_VISIBLE istream_iterator
|
||||
class istream_iterator
|
||||
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
|
||||
{
|
||||
public:
|
||||
@@ -752,7 +752,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE ostream_iterator
|
||||
class ostream_iterator
|
||||
: public iterator<output_iterator_tag, void, void, void, void>
|
||||
{
|
||||
public:
|
||||
@@ -781,7 +781,7 @@ public:
|
||||
};
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE istreambuf_iterator
|
||||
class istreambuf_iterator
|
||||
: public iterator<input_iterator_tag, _CharT,
|
||||
typename _Traits::off_type, _CharT*,
|
||||
_CharT>
|
||||
@@ -806,7 +806,6 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
|
||||
};
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __test_for_eof()
|
||||
{
|
||||
if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
|
||||
@@ -821,7 +820,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) throw()
|
||||
: __sbuf_(__p.__sbuf_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _CharT operator*() const {return __sbuf_->sgetc();}
|
||||
_LIBCPP_INLINE_VISIBILITY _CharT operator*() const {return __sbuf_->sgetc();}
|
||||
_LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}
|
||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
|
||||
{
|
||||
@@ -853,7 +852,7 @@ bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
|
||||
{return !__a.equal(__b);}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE ostreambuf_iterator
|
||||
class ostreambuf_iterator
|
||||
: public iterator<output_iterator_tag, void, void, void, void>
|
||||
{
|
||||
public:
|
||||
@@ -881,7 +880,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Iter>
|
||||
class _LIBCPP_VISIBLE move_iterator
|
||||
class move_iterator
|
||||
{
|
||||
private:
|
||||
_Iter __i;
|
||||
@@ -891,7 +890,7 @@ public:
|
||||
typedef typename iterator_traits<iterator_type>::value_type value_type;
|
||||
typedef typename iterator_traits<iterator_type>::difference_type difference_type;
|
||||
typedef typename iterator_traits<iterator_type>::pointer pointer;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
typedef value_type&& reference;
|
||||
#else
|
||||
typedef typename iterator_traits<iterator_type>::reference reference;
|
||||
@@ -1616,10 +1615,10 @@ operator+(typename __debug_iter<_Container, _Iter>::difference_type __n,
|
||||
|
||||
#endif // _LIBCPP_DEBUG
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
#if defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
begin(_C& __c) -> decltype(__c.begin())
|
||||
{
|
||||
@@ -1627,7 +1626,7 @@ begin(_C& __c) -> decltype(__c.begin())
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
begin(const _C& __c) -> decltype(__c.begin())
|
||||
{
|
||||
@@ -1635,7 +1634,7 @@ begin(const _C& __c) -> decltype(__c.begin())
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
end(_C& __c) -> decltype(__c.end())
|
||||
{
|
||||
@@ -1643,17 +1642,17 @@ end(_C& __c) -> decltype(__c.end())
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
end(const _C& __c) -> decltype(__c.end())
|
||||
{
|
||||
return __c.end();
|
||||
}
|
||||
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
#else // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::iterator
|
||||
begin(_C& __c)
|
||||
{
|
||||
@@ -1661,7 +1660,7 @@ begin(_C& __c)
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::const_iterator
|
||||
begin(const _C& __c)
|
||||
{
|
||||
@@ -1669,7 +1668,7 @@ begin(const _C& __c)
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::iterator
|
||||
end(_C& __c)
|
||||
{
|
||||
@@ -1677,17 +1676,17 @@ end(_C& __c)
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::const_iterator
|
||||
end(const _C& __c)
|
||||
{
|
||||
return __c.end();
|
||||
}
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
#endif // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
|
||||
template <class _T, size_t _N>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_T*
|
||||
begin(_T (&__array)[_N])
|
||||
{
|
||||
@@ -1695,7 +1694,7 @@ begin(_T (&__array)[_N])
|
||||
}
|
||||
|
||||
template <class _T, size_t _N>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_T*
|
||||
end(_T (&__array)[_N])
|
||||
{
|
||||
|
@@ -425,7 +425,7 @@ protected:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits
|
||||
class numeric_limits
|
||||
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
|
||||
{
|
||||
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
|
||||
@@ -471,7 +471,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits<const _Tp>
|
||||
class numeric_limits<const _Tp>
|
||||
: private numeric_limits<_Tp>
|
||||
{
|
||||
typedef numeric_limits<_Tp> __base;
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits<volatile _Tp>
|
||||
class numeric_limits<volatile _Tp>
|
||||
: private numeric_limits<_Tp>
|
||||
{
|
||||
typedef numeric_limits<_Tp> __base;
|
||||
@@ -563,7 +563,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits<const volatile _Tp>
|
||||
class numeric_limits<const volatile _Tp>
|
||||
: private numeric_limits<_Tp>
|
||||
{
|
||||
typedef numeric_limits<_Tp> __base;
|
||||
|
166
include/list
166
include/list
@@ -187,7 +187,6 @@ struct __list_node_base
|
||||
pointer __prev_;
|
||||
pointer __next_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_node_base()
|
||||
: __prev_(static_cast<pointer>(this)),
|
||||
__next_(static_cast<pointer>(this))
|
||||
@@ -206,7 +205,7 @@ template <class, class> class __list_imp;
|
||||
template <class, class> class __list_const_iterator;
|
||||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
class _LIBCPP_VISIBLE __list_iterator
|
||||
class __list_iterator
|
||||
{
|
||||
typedef typename pointer_traits<_VoidPtr>::template
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
@@ -217,7 +216,6 @@ class _LIBCPP_VISIBLE __list_iterator
|
||||
|
||||
__node_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __list_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
|
||||
template<class, class> friend class list;
|
||||
@@ -236,31 +234,23 @@ public:
|
||||
pointer;
|
||||
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &(operator*());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_iterator& operator++() {__ptr_ = __ptr_->__next_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_iterator operator++(int) {__list_iterator __t(*this); ++(*this); return __t;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_iterator& operator--() {__ptr_ = __ptr_->__prev_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_iterator operator--(int) {__list_iterator __t(*this); --(*this); return __t;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __list_iterator& __x, const __list_iterator& __y)
|
||||
friend bool operator==(const __list_iterator& __x, const __list_iterator& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __list_iterator& __x, const __list_iterator& __y)
|
||||
friend bool operator!=(const __list_iterator& __x, const __list_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
};
|
||||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
class _LIBCPP_VISIBLE __list_const_iterator
|
||||
class __list_const_iterator
|
||||
{
|
||||
typedef typename pointer_traits<_VoidPtr>::template
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
@@ -271,7 +261,6 @@ class _LIBCPP_VISIBLE __list_const_iterator
|
||||
|
||||
__node_pointer __ptr_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __list_const_iterator(__node_pointer __p) : __ptr_(__p) {}
|
||||
|
||||
template<class, class> friend class list;
|
||||
@@ -289,29 +278,20 @@ public:
|
||||
pointer;
|
||||
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator(__list_iterator<_Tp, _VoidPtr> __p) : __ptr_(__p.__ptr_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __ptr_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &(operator*());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator& operator++() {__ptr_ = __ptr_->__next_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator operator++(int) {__list_const_iterator __t(*this); ++(*this); return __t;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator& operator--() {__ptr_ = __ptr_->__prev_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__list_const_iterator operator--(int) {__list_const_iterator __t(*this); --(*this); return __t;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __list_const_iterator& __x, const __list_const_iterator& __y)
|
||||
friend bool operator==(const __list_const_iterator& __x, const __list_const_iterator& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __list_const_iterator& __x, const __list_const_iterator& __y)
|
||||
friend bool operator!=(const __list_const_iterator& __x, const __list_const_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
};
|
||||
|
||||
@@ -347,13 +327,9 @@ protected:
|
||||
__node_base __end_;
|
||||
__compressed_pair<size_type, __node_allocator> __size_alloc_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type& __sz() {return __size_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const size_type& __sz() const {return __size_alloc_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node_allocator& __node_alloc() {return __size_alloc_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __node_allocator& __node_alloc() const {return __size_alloc_.second();}
|
||||
|
||||
static void __unlink_nodes(__node_base& __f, __node_base& __l);
|
||||
@@ -362,46 +338,35 @@ protected:
|
||||
__list_imp(const allocator_type& __a);
|
||||
~__list_imp();
|
||||
void clear();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __sz() == 0;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return iterator(__end_.__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return const_iterator(__end_.__next_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return iterator(static_cast<__node_pointer> (&__end_));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return const_iterator(static_cast<__node_const_pointer>(&__end_));}
|
||||
|
||||
void swap(__list_imp& __c);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __list_imp& __c)
|
||||
{__copy_assign_alloc(__c, integral_constant<bool,
|
||||
__node_alloc_traits::propagate_on_container_copy_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__list_imp& __c)
|
||||
{__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)
|
||||
{__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)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __list_imp& __c, true_type)
|
||||
{
|
||||
if (__node_alloc() != __c.__node_alloc())
|
||||
@@ -409,24 +374,21 @@ private:
|
||||
__node_alloc() = __c.__node_alloc();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __list_imp& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __list_imp& __c, true_type)
|
||||
{
|
||||
__node_alloc() = _STD::move(__c.__node_alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __list_imp& __c, false_type)
|
||||
{}
|
||||
};
|
||||
|
||||
// Unlink nodes [__f, __l]
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
__list_imp<_Tp, _Alloc>::__unlink_nodes(__node_base& __f, __node_base& __l)
|
||||
{
|
||||
@@ -435,14 +397,14 @@ __list_imp<_Tp, _Alloc>::__unlink_nodes(__node_base& __f, __node_base& __l)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__list_imp<_Tp, _Alloc>::__list_imp()
|
||||
: __size_alloc_(0)
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a)
|
||||
: __size_alloc_(0, __node_allocator(__a))
|
||||
{
|
||||
@@ -497,7 +459,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc = allocator<_Tp> >
|
||||
class _LIBCPP_VISIBLE list
|
||||
class list
|
||||
: private __list_imp<_Tp, _Alloc>
|
||||
{
|
||||
typedef __list_imp<_Tp, _Alloc> base;
|
||||
@@ -522,9 +484,7 @@ public:
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
list() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
list(const allocator_type& __a) : base(__a) {}
|
||||
list(size_type __n);
|
||||
list(size_type __n, const value_type& __x);
|
||||
@@ -541,12 +501,11 @@ public:
|
||||
list& operator=(const list& __c);
|
||||
list(initializer_list<value_type> __il);
|
||||
list(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
list(list&& __c);
|
||||
list(list&& __c, const allocator_type& __a);
|
||||
list& operator=(list&& __c);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
list& operator=(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end()); return *this;}
|
||||
|
||||
@@ -554,67 +513,45 @@ public:
|
||||
void assign(_InpIter __f, _InpIter __l,
|
||||
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
||||
void assign(size_type __n, const value_type& __x);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end());}
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return base::__sz();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return base::empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return numeric_limits<difference_type>::max();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return base::end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return base::begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return base::end();}
|
||||
|
||||
_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
|
||||
const_reverse_iterator crbegin() const {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const {return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference front() {return base::__end_.__next_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference front() const {return base::__end_.__next_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference back() {return base::__end_.__prev_->__value_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference back() const {return base::__end_.__prev_->__value_;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push_front(value_type&& __x);
|
||||
void push_back(value_type&& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
void emplace_front(_Args&&... __args);
|
||||
template <class... _Args>
|
||||
void emplace_back(_Args&&... __args);
|
||||
template <class... _Args>
|
||||
iterator emplace(const_iterator __p, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
iterator insert(const_iterator __p, value_type&& __x);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void push_front(const value_type& __x);
|
||||
void push_back(const value_type& __x);
|
||||
@@ -624,13 +561,10 @@ public:
|
||||
template <class _InpIter>
|
||||
iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
|
||||
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, initializer_list<value_type> __il)
|
||||
{return insert(__p, __il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(list& __c) {base::swap(__c);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {base::clear();}
|
||||
|
||||
void pop_front();
|
||||
@@ -643,22 +577,19 @@ public:
|
||||
void resize(size_type __n, const value_type& __x);
|
||||
|
||||
void splice(const_iterator __p, list& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
|
||||
#endif
|
||||
void splice(const_iterator __p, list& __c, const_iterator __i);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void splice(const_iterator __p, list&& __c, const_iterator __i)
|
||||
{splice(__p, __c, __i);}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
|
||||
{splice(__p, __c, __f, __l);}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void remove(const value_type& __x);
|
||||
template <class _Pred> void remove_if(_Pred __pred);
|
||||
@@ -666,17 +597,15 @@ public:
|
||||
template <class _BinaryPred>
|
||||
void unique(_BinaryPred __binary_pred);
|
||||
void merge(list& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void merge(list&& __c) {merge(__c);}
|
||||
#endif
|
||||
template <class _Comp>
|
||||
void merge(list& __c, _Comp __comp);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Comp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void sort();
|
||||
template <class _Comp>
|
||||
void sort(_Comp __comp);
|
||||
@@ -695,7 +624,7 @@ private:
|
||||
|
||||
// Link in nodes [__f, __l] just prior to __p
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
list<_Tp, _Alloc>::__link_nodes(__node& __p, __node& __f, __node& __l)
|
||||
{
|
||||
@@ -706,7 +635,7 @@ list<_Tp, _Alloc>::__link_nodes(__node& __p, __node& __f, __node& __l)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename list<_Tp, _Alloc>::iterator
|
||||
list<_Tp, _Alloc>::__iterator(size_type __n)
|
||||
{
|
||||
@@ -718,7 +647,7 @@ template <class _Tp, class _Alloc>
|
||||
list<_Tp, _Alloc>::list(size_type __n)
|
||||
{
|
||||
for (; __n > 0; --__n)
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
emplace_back();
|
||||
#else
|
||||
push_back(value_type());
|
||||
@@ -795,7 +724,7 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
list<_Tp, _Alloc>&
|
||||
list<_Tp, _Alloc>::operator=(const list& __c)
|
||||
{
|
||||
@@ -807,10 +736,10 @@ list<_Tp, _Alloc>::operator=(const list& __c)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
list<_Tp, _Alloc>::list(list&& __c)
|
||||
: base(allocator_type(_STD::move(__c.__node_alloc())))
|
||||
{
|
||||
@@ -818,7 +747,7 @@ list<_Tp, _Alloc>::list(list&& __c)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
|
||||
: base(__a)
|
||||
{
|
||||
@@ -832,7 +761,7 @@ list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
list<_Tp, _Alloc>&
|
||||
list<_Tp, _Alloc>::operator=(list&& __c)
|
||||
{
|
||||
@@ -863,7 +792,7 @@ list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
|
||||
splice(end(), __c);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class _InpIter>
|
||||
@@ -896,7 +825,7 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_Alloc
|
||||
list<_Tp, _Alloc>::get_allocator() const
|
||||
{
|
||||
@@ -1047,7 +976,7 @@ list<_Tp, _Alloc>::push_back(const value_type& __x)
|
||||
__hold.release();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
@@ -1075,8 +1004,6 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
|
||||
__hold.release();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class... _Args>
|
||||
void
|
||||
@@ -1120,8 +1047,6 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
|
||||
return iterator(__hold.release());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
typename list<_Tp, _Alloc>::iterator
|
||||
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
||||
@@ -1136,7 +1061,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
||||
return iterator(__hold.release());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
void
|
||||
@@ -1385,7 +1310,7 @@ list<_Tp, _Alloc>::remove_if(_Pred __pred)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
list<_Tp, _Alloc>::unique()
|
||||
{
|
||||
@@ -1408,7 +1333,7 @@ list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
list<_Tp, _Alloc>::merge(list& __c)
|
||||
{
|
||||
@@ -1452,7 +1377,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
list<_Tp, _Alloc>::sort()
|
||||
{
|
||||
@@ -1461,7 +1386,7 @@ list<_Tp, _Alloc>::sort()
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class _Comp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
list<_Tp, _Alloc>::sort(_Comp __comp)
|
||||
{
|
||||
@@ -1470,6 +1395,7 @@ list<_Tp, _Alloc>::sort(_Comp __comp)
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class _Comp>
|
||||
inline
|
||||
typename list<_Tp, _Alloc>::iterator
|
||||
list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp)
|
||||
{
|
||||
@@ -1545,7 +1471,7 @@ list<_Tp, _Alloc>::reverse()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1553,7 +1479,7 @@ operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1561,7 +1487,7 @@ operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1569,7 +1495,7 @@ operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1577,7 +1503,7 @@ operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1585,7 +1511,7 @@ operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
@@ -1593,7 +1519,7 @@ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
|
||||
{
|
||||
|
136
include/locale
136
include/locale
@@ -198,7 +198,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
#if __APPLE__
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_sprintf(char* __restrict __str,
|
||||
const char* __restrict __format, _Tp __v)
|
||||
@@ -207,7 +207,7 @@ __nolocale_sprintf(char* __restrict __str,
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, _Tp __v)
|
||||
@@ -216,7 +216,7 @@ __nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, int __prec, _Tp __v)
|
||||
@@ -225,7 +225,7 @@ __nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_asprintf(char** __ret, const char* __restrict __format, _Tp __v)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ __nolocale_asprintf(char** __ret, const char* __restrict __format, _Tp __v)
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_asprintf(char** __ret, const char* __restrict __format, int __prec,
|
||||
_Tp __v)
|
||||
@@ -242,7 +242,7 @@ __nolocale_asprintf(char** __ret, const char* __restrict __format, int __prec,
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_sscanf(const char* __restrict __str,
|
||||
const char* __restrict __format, _Tp* __v)
|
||||
@@ -250,14 +250,14 @@ __nolocale_sscanf(const char* __restrict __str,
|
||||
return sscanf_l(__str, 0, __format, __v);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_isxdigit(int __c)
|
||||
{
|
||||
return isxdigit_l(__c, 0);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
__nolocale_isdigit(int __c)
|
||||
{
|
||||
@@ -265,8 +265,7 @@ __nolocale_isdigit(int __c)
|
||||
}
|
||||
|
||||
#else // __APPLE__
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
inline int
|
||||
__nolocale_sprintf(char* __restrict __str,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
@@ -276,8 +275,7 @@ __nolocale_sprintf(char* __restrict __str,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
inline int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
@@ -287,8 +285,7 @@ __nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
inline int
|
||||
__nolocale_asprintf(char** __ret,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
@@ -298,8 +295,7 @@ __nolocale_asprintf(char** __ret,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
inline int
|
||||
__nolocale_sscanf(const char* __restrict __str,
|
||||
const char* __restrict __format, ...)
|
||||
{
|
||||
@@ -309,15 +305,12 @@ __nolocale_sscanf(const char* __restrict __str,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
inline int
|
||||
__nolocale_isxdigit(int __c)
|
||||
{
|
||||
return isxdigit(__c);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
inline int
|
||||
__nolocale_isdigit(int __c)
|
||||
{
|
||||
return isdigit(__c);
|
||||
@@ -591,7 +584,7 @@ extern template class __num_get<char>;
|
||||
extern template class __num_get<wchar_t>;
|
||||
|
||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE num_get
|
||||
class num_get
|
||||
: public locale::facet,
|
||||
private __num_get<_CharT>
|
||||
{
|
||||
@@ -683,7 +676,6 @@ public:
|
||||
static locale::id id;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~num_get() {}
|
||||
|
||||
virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
|
||||
@@ -1343,7 +1335,7 @@ extern template class __num_put<char>;
|
||||
extern template class __num_put<wchar_t>;
|
||||
|
||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE num_put
|
||||
class num_put
|
||||
: public locale::facet,
|
||||
private __num_put<_CharT>
|
||||
{
|
||||
@@ -1414,7 +1406,6 @@ public:
|
||||
static locale::id id;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~num_put() {}
|
||||
|
||||
virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl,
|
||||
@@ -1749,7 +1740,7 @@ __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
|
||||
return __r;
|
||||
}
|
||||
|
||||
class _LIBCPP_VISIBLE time_base
|
||||
class time_base
|
||||
{
|
||||
public:
|
||||
enum dateorder {no_order, dmy, mdy, ymd, ydm};
|
||||
@@ -1771,7 +1762,7 @@ protected:
|
||||
};
|
||||
|
||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE time_get
|
||||
class time_get
|
||||
: public locale::facet,
|
||||
public time_base,
|
||||
private __time_get_c_storage<_CharT>
|
||||
@@ -1842,7 +1833,6 @@ public:
|
||||
static locale::id id;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~time_get() {}
|
||||
|
||||
virtual dateorder do_date_order() const;
|
||||
@@ -2416,7 +2406,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE time_get_byname
|
||||
class time_get_byname
|
||||
: public time_get<_CharT, _InputIterator>,
|
||||
private __time_get_storage<_CharT>
|
||||
{
|
||||
@@ -2426,35 +2416,24 @@ public:
|
||||
typedef _CharT char_type;
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit time_get_byname(const char* __nm, size_t __refs = 0)
|
||||
: time_get<_CharT, _InputIterator>(__refs),
|
||||
__time_get_storage<_CharT>(__nm) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit time_get_byname(const string& __nm, size_t __refs = 0)
|
||||
: time_get<_CharT, _InputIterator>(__refs),
|
||||
__time_get_storage<_CharT>(__nm) {}
|
||||
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~time_get_byname() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual dateorder do_date_order() const {return this->__do_date_order();}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type* __weeks() const {return this->__weeks_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type* __months() const {return this->__months_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type* __am_pm() const {return this->__am_pm_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type& __c() const {return this->__c_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type& __r() const {return this->__r_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type& __x() const {return this->__x_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual const string_type& __X() const {return this->__X_;}
|
||||
};
|
||||
|
||||
@@ -2476,7 +2455,7 @@ protected:
|
||||
};
|
||||
|
||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE time_put
|
||||
class time_put
|
||||
: public locale::facet,
|
||||
private __time_put
|
||||
{
|
||||
@@ -2501,16 +2480,13 @@ public:
|
||||
static locale::id id;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~time_put() {}
|
||||
virtual iter_type do_put(iter_type __s, ios_base&, char_type, const tm* __tm,
|
||||
char __fmt, char __mod) const;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit time_put(const char* __nm, size_t __refs)
|
||||
: locale::facet(__refs),
|
||||
__time_put(__nm) {}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit time_put(const string& __nm, size_t __refs)
|
||||
: locale::facet(__refs),
|
||||
__time_put(__nm) {}
|
||||
@@ -2575,7 +2551,7 @@ extern template class time_put<char>;
|
||||
extern template class time_put<wchar_t>;
|
||||
|
||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE time_put_byname
|
||||
class time_put_byname
|
||||
: public time_put<_CharT, _OutputIterator>
|
||||
{
|
||||
public:
|
||||
@@ -2588,7 +2564,6 @@ public:
|
||||
: time_put<_CharT, _OutputIterator>(__nm, __refs) {}
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~time_put_byname() {}
|
||||
};
|
||||
|
||||
@@ -2597,7 +2572,7 @@ extern template class time_put_byname<wchar_t>;
|
||||
|
||||
// money_base
|
||||
|
||||
class _LIBCPP_VISIBLE money_base
|
||||
class money_base
|
||||
{
|
||||
public:
|
||||
enum part {none, space, symbol, sign, value};
|
||||
@@ -2609,7 +2584,7 @@ public:
|
||||
// moneypunct
|
||||
|
||||
template <class _CharT, bool _International = false>
|
||||
class _LIBCPP_VISIBLE moneypunct
|
||||
class moneypunct
|
||||
: public locale::facet,
|
||||
public money_base
|
||||
{
|
||||
@@ -2617,7 +2592,6 @@ public:
|
||||
typedef _CharT char_type;
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit moneypunct(size_t __refs = 0)
|
||||
: locale::facet(__refs) {}
|
||||
|
||||
@@ -2635,27 +2609,17 @@ public:
|
||||
static const bool intl = _International;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~moneypunct() {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_decimal_point() const {return numeric_limits<char_type>::max();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_thousands_sep() const {return numeric_limits<char_type>::max();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string do_grouping() const {return string();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_curr_symbol() const {return string_type();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_positive_sign() const {return string_type();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_negative_sign() const {return string_type(1, '-');}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual int do_frac_digits() const {return 0;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_pos_format() const
|
||||
{pattern __p = {symbol, sign, none, value}; return __p;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_neg_format() const
|
||||
{pattern __p = {symbol, sign, none, value}; return __p;}
|
||||
};
|
||||
@@ -2672,8 +2636,7 @@ extern template class moneypunct<wchar_t, true>;
|
||||
// moneypunct_byname
|
||||
|
||||
template <class _CharT, bool _International = false>
|
||||
class _LIBCPP_VISIBLE moneypunct_byname
|
||||
: public moneypunct<_CharT, _International>
|
||||
class moneypunct_byname : public moneypunct<_CharT, _International>
|
||||
{
|
||||
public:
|
||||
typedef money_base::pattern pattern;
|
||||
@@ -2689,26 +2652,16 @@ public:
|
||||
: moneypunct<_CharT, _International>(__refs) {init(__nm.c_str());}
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~moneypunct_byname() {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_decimal_point() const {return __decimal_point_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_thousands_sep() const {return __thousands_sep_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string do_grouping() const {return __grouping_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_curr_symbol() const {return __curr_symbol_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_positive_sign() const {return __positive_sign_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_negative_sign() const {return __negative_sign_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual int do_frac_digits() const {return __frac_digits_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_pos_format() const {return __pos_format_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_neg_format() const {return __neg_format_;}
|
||||
|
||||
private:
|
||||
@@ -2793,7 +2746,7 @@ extern template class __money_get<char>;
|
||||
extern template class __money_get<wchar_t>;
|
||||
|
||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE money_get
|
||||
class money_get
|
||||
: public locale::facet,
|
||||
private __money_get<_CharT>
|
||||
{
|
||||
@@ -2824,7 +2777,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~money_get() {}
|
||||
|
||||
virtual iter_type do_get(iter_type __b, iter_type __e, bool __intl,
|
||||
@@ -3325,7 +3277,7 @@ extern template class __money_put<char>;
|
||||
extern template class __money_put<wchar_t>;
|
||||
|
||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||
class _LIBCPP_VISIBLE money_put
|
||||
class money_put
|
||||
: public locale::facet,
|
||||
private __money_put<_CharT>
|
||||
{
|
||||
@@ -3355,7 +3307,6 @@ public:
|
||||
static locale::id id;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~money_put() {}
|
||||
|
||||
virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __iob,
|
||||
@@ -3477,7 +3428,7 @@ extern template class money_put<wchar_t>;
|
||||
|
||||
// messages
|
||||
|
||||
class _LIBCPP_VISIBLE messages_base
|
||||
class messages_base
|
||||
{
|
||||
public:
|
||||
typedef nl_catd catalog;
|
||||
@@ -3486,7 +3437,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
class _LIBCPP_VISIBLE messages
|
||||
class messages
|
||||
: public locale::facet,
|
||||
public messages_base
|
||||
{
|
||||
@@ -3520,7 +3471,6 @@ public:
|
||||
static locale::id id;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~messages() {}
|
||||
|
||||
virtual catalog do_open(const basic_string<char>&, const locale&) const;
|
||||
@@ -3567,7 +3517,7 @@ extern template class messages<char>;
|
||||
extern template class messages<wchar_t>;
|
||||
|
||||
template <class _CharT>
|
||||
class _LIBCPP_VISIBLE messages_byname
|
||||
class messages_byname
|
||||
: public messages<_CharT>
|
||||
{
|
||||
public:
|
||||
@@ -3583,7 +3533,6 @@ public:
|
||||
: messages<_CharT>(__refs) {}
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~messages_byname() {}
|
||||
};
|
||||
|
||||
@@ -3593,7 +3542,7 @@ extern template class messages_byname<wchar_t>;
|
||||
template<class _Codecvt, class _Elem = wchar_t,
|
||||
class _Wide_alloc = allocator<_Elem>,
|
||||
class _Byte_alloc = allocator<char> >
|
||||
class _LIBCPP_VISIBLE wstring_convert
|
||||
class wstring_convert
|
||||
{
|
||||
public:
|
||||
typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
|
||||
@@ -3615,41 +3564,33 @@ public:
|
||||
wstring_convert(_Codecvt* __pcvt, state_type __state);
|
||||
wstring_convert(const byte_string& __byte_err,
|
||||
const wide_string& __wide_err = wide_string());
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
wstring_convert(wstring_convert&& __wc);
|
||||
#endif
|
||||
~wstring_convert();
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
wide_string from_bytes(char __byte)
|
||||
{return from_bytes(&__byte, &__byte+1);}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
wide_string from_bytes(const char* __ptr)
|
||||
{return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr));}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
wide_string from_bytes(const byte_string& __str)
|
||||
{return from_bytes(__str.data(), __str.data() + __str.size());}
|
||||
wide_string from_bytes(const char* __first, const char* __last);
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
byte_string to_bytes(_Elem __wchar)
|
||||
{return to_bytes(&__wchar, &__wchar+1);}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
byte_string to_bytes(const _Elem* __wptr)
|
||||
{return to_bytes(__wptr, __wptr + char_traits<_Elem>::length(__wptr));}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
byte_string to_bytes(const wide_string& __wstr)
|
||||
{return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());}
|
||||
byte_string to_bytes(const _Elem* __first, const _Elem* __last);
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
size_t converted() const {return __cvtcount_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
state_type state() const {return __cvtstate_;}
|
||||
};
|
||||
|
||||
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
|
||||
inline _LIBCPP_ALWAYS_INLINE
|
||||
inline
|
||||
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
wstring_convert(_Codecvt* __pcvt)
|
||||
: __cvtptr_(__pcvt), __cvtstate_(), __cvtcount_(0)
|
||||
@@ -3657,7 +3598,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
}
|
||||
|
||||
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
|
||||
inline _LIBCPP_ALWAYS_INLINE
|
||||
inline
|
||||
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
wstring_convert(_Codecvt* __pcvt, state_type __state)
|
||||
: __cvtptr_(__pcvt), __cvtstate_(__state), __cvtcount_(0)
|
||||
@@ -3673,10 +3614,10 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
__cvtptr_ = new _Codecvt;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
|
||||
inline _LIBCPP_ALWAYS_INLINE
|
||||
inline
|
||||
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
wstring_convert(wstring_convert&& __wc)
|
||||
: __byte_err_string_(_STD::move(__wc.__byte_err_string_)),
|
||||
@@ -3687,7 +3628,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
__wc.__cvtptr_ = nullptr;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
|
||||
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::~wstring_convert()
|
||||
@@ -3844,7 +3785,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
||||
}
|
||||
|
||||
template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
|
||||
class _LIBCPP_VISIBLE wbuffer_convert
|
||||
class wbuffer_convert
|
||||
: public basic_streambuf<_Elem, _Tr>
|
||||
{
|
||||
public:
|
||||
@@ -3879,9 +3820,7 @@ public:
|
||||
state_type __state = state_type());
|
||||
~wbuffer_convert();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
streambuf* rdbuf() const {return __bufptr_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
streambuf* rdbuf(streambuf* __bytebuf)
|
||||
{
|
||||
streambuf* __r = __bufptr_;
|
||||
@@ -3889,7 +3828,6 @@ public:
|
||||
return __r;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
state_type state() const {return __st_;}
|
||||
|
||||
protected:
|
||||
|
321
include/map
321
include/map
File diff suppressed because it is too large
Load Diff
237
include/memory
237
include/memory
@@ -531,7 +531,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// allocator_arg_t
|
||||
|
||||
struct _LIBCPP_VISIBLE allocator_arg_t { };
|
||||
struct allocator_arg_t { };
|
||||
|
||||
extern const allocator_arg_t allocator_arg;
|
||||
|
||||
@@ -548,7 +548,7 @@ addressof(_Tp& __x)
|
||||
template <class _Tp> class allocator;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE allocator<void>
|
||||
class allocator<void>
|
||||
{
|
||||
public:
|
||||
typedef void* pointer;
|
||||
@@ -783,7 +783,7 @@ struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, false>
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Ptr>
|
||||
struct _LIBCPP_VISIBLE pointer_traits
|
||||
struct pointer_traits
|
||||
{
|
||||
typedef _Ptr pointer;
|
||||
typedef typename __pointer_traits_element_type<pointer>::type element_type;
|
||||
@@ -799,14 +799,13 @@ struct _LIBCPP_VISIBLE pointer_traits
|
||||
private:
|
||||
struct __nat {};
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer pointer_to(typename conditional<is_void<element_type>::value,
|
||||
__nat, element_type>::type& __r)
|
||||
{return pointer::pointer_to(__r);}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE pointer_traits<_Tp*>
|
||||
struct pointer_traits<_Tp*>
|
||||
{
|
||||
typedef _Tp* pointer;
|
||||
typedef _Tp element_type;
|
||||
@@ -821,7 +820,6 @@ struct _LIBCPP_VISIBLE pointer_traits<_Tp*>
|
||||
private:
|
||||
struct __nat {};
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer pointer_to(typename conditional<is_void<element_type>::value,
|
||||
__nat, element_type>::type& __r)
|
||||
{return _STD::addressof(__r);}
|
||||
@@ -1293,7 +1291,7 @@ struct __has_select_on_container_copy_construction
|
||||
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
||||
template <class _Alloc>
|
||||
struct _LIBCPP_VISIBLE allocator_traits
|
||||
struct allocator_traits
|
||||
{
|
||||
typedef _Alloc allocator_type;
|
||||
typedef typename allocator_type::value_type value_type;
|
||||
@@ -1324,46 +1322,38 @@ struct _LIBCPP_VISIBLE allocator_traits
|
||||
{typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer allocate(allocator_type& __a, size_type __n)
|
||||
{return __a.allocate(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
|
||||
{return allocate(__a, __n, __hint,
|
||||
__has_allocate_hint<allocator_type, size_type, const_void_pointer>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void deallocate(allocator_type& __a, pointer __p, size_type __n)
|
||||
{__a.deallocate(__p, __n);}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
|
||||
{__construct(__has_construct<allocator_type, pointer, _Args...>(),
|
||||
__a, __p, _STD::forward<_Args>(__args)...);}
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void construct(allocator_type& __a, _Tp* __p)
|
||||
{
|
||||
::new ((void*)__p) _Tp();
|
||||
}
|
||||
template <class _Tp, class _A0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0)
|
||||
{
|
||||
::new ((void*)__p) _Tp(__a0);
|
||||
}
|
||||
template <class _Tp, class _A0, class _A1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0,
|
||||
const _A1& __a1)
|
||||
{
|
||||
::new ((void*)__p) _Tp(__a0, __a1);
|
||||
}
|
||||
template <class _Tp, class _A0, class _A1, class _A2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0,
|
||||
const _A1& __a1, const _A2& __a2)
|
||||
{
|
||||
@@ -1372,15 +1362,12 @@ struct _LIBCPP_VISIBLE allocator_traits
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void destroy(allocator_type& __a, _Tp* __p)
|
||||
{__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type max_size(const allocator_type& __a)
|
||||
{return __max_size(__has_max_size<const allocator_type>(), __a);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static allocator_type
|
||||
select_on_container_copy_construction(const allocator_type& __a)
|
||||
{return select_on_container_copy_construction(
|
||||
@@ -1389,22 +1376,18 @@ struct _LIBCPP_VISIBLE allocator_traits
|
||||
|
||||
private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer allocate(allocator_type& __a, size_type __n,
|
||||
const_void_pointer __hint, true_type)
|
||||
{return __a.allocate(__n, __hint);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static pointer allocate(allocator_type& __a, size_type __n,
|
||||
const_void_pointer __hint, false_type)
|
||||
{return __a.allocate(__n);}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)
|
||||
{__a.construct(__p, _STD::forward<_Args>(__args)...);}
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)
|
||||
{
|
||||
::new ((void*)__p) _Tp(_STD::forward<_Args>(__args)...);
|
||||
@@ -1412,28 +1395,22 @@ private:
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __destroy(true_type, allocator_type& __a, _Tp* __p)
|
||||
{__a.destroy(__p);}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __destroy(false_type, allocator_type&, _Tp* __p)
|
||||
{
|
||||
__p->~_Tp();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __max_size(true_type, const allocator_type& __a)
|
||||
{return __a.max_size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __max_size(false_type, const allocator_type&)
|
||||
{return numeric_limits<size_type>::max();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static allocator_type
|
||||
select_on_container_copy_construction(true_type, const allocator_type& __a)
|
||||
{return __a.select_on_container_copy_construction();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static allocator_type
|
||||
select_on_container_copy_construction(false_type, const allocator_type& __a)
|
||||
{return __a;}
|
||||
@@ -1466,12 +1443,12 @@ struct __uses_allocator<_Tp, _Alloc, false>
|
||||
};
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator
|
||||
struct uses_allocator
|
||||
: public __uses_allocator<_Tp, _Alloc>
|
||||
{
|
||||
};
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
#if defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
|
||||
// uses-allocator construction
|
||||
|
||||
@@ -1489,12 +1466,12 @@ struct __uses_alloc_ctor
|
||||
: integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
|
||||
{};
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
#endif // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
|
||||
// allocator
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE allocator
|
||||
class allocator
|
||||
{
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
@@ -1515,7 +1492,7 @@ public:
|
||||
{return static_cast<pointer>(::operator new(__n * sizeof(_Tp)));}
|
||||
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) {::operator delete((void*)__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Up, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
@@ -1523,7 +1500,7 @@ public:
|
||||
{
|
||||
::new((void*)__p) _Up(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#else // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
construct(pointer __p)
|
||||
@@ -1591,7 +1568,7 @@ public:
|
||||
{
|
||||
::new((void*)__p) _Tp(__a0, __a1);
|
||||
}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}
|
||||
};
|
||||
|
||||
@@ -1604,7 +1581,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) throw() {return false;}
|
||||
|
||||
template <class _OutputIterator, class _Tp>
|
||||
class _LIBCPP_VISIBLE raw_storage_iterator
|
||||
class raw_storage_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
_Tp, // purposefully not C++03
|
||||
ptrdiff_t, // purposefully not C++03
|
||||
@@ -1657,7 +1634,7 @@ struct auto_ptr_ref
|
||||
};
|
||||
|
||||
template<class _Tp>
|
||||
class _LIBCPP_VISIBLE auto_ptr
|
||||
class auto_ptr
|
||||
{
|
||||
private:
|
||||
_Tp* __ptr_;
|
||||
@@ -1701,7 +1678,7 @@ public:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE auto_ptr<void>
|
||||
class auto_ptr<void>
|
||||
{
|
||||
public:
|
||||
typedef void element_type;
|
||||
@@ -1755,10 +1732,10 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: __first_(_STD::forward<_T1_param>(__t1)), __second_(_STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
: __first_(_STD::forward<_T1>(__p.first())), __second_(_STD::forward<_T2>(__p.second())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() {return __first_;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const {return __first_;}
|
||||
@@ -1798,10 +1775,10 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: _T1(_STD::forward<_T1_param>(__t1)), __second_(_STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
: _T1(_STD::move(__p.first())), __second_(_STD::forward<_T2>(__p.second())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const {return *this;}
|
||||
@@ -1840,10 +1817,10 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: _T2(_STD::forward<_T2_param>(__t2)), __first_(_STD::forward<_T1_param>(__t1)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
: _T2(_STD::forward<_T2>(__p.second())), __first_(_STD::move(__p.first())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() {return __first_;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const {return __first_;}
|
||||
@@ -1881,10 +1858,10 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
|
||||
: _T1(_STD::forward<_T1_param>(__t1)), _T2(_STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
|
||||
: _T1(_STD::move(__p.first())), _T2(_STD::move(__p.second())) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const {return *this;}
|
||||
@@ -1920,10 +1897,10 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
|
||||
: base(_STD::forward<_T1_param>(__t1), _STD::forward<_T2_param>(__t2)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__compressed_pair(__compressed_pair&& __p)
|
||||
: base(_STD::move(__p)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() {return base::first();}
|
||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const {return base::first();}
|
||||
@@ -1941,7 +1918,7 @@ swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
|
||||
{__x.swap(__y);}
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE default_delete
|
||||
struct default_delete
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY default_delete() {}
|
||||
template <class _Up>
|
||||
@@ -1955,7 +1932,7 @@ struct _LIBCPP_VISIBLE default_delete
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE default_delete<_Tp[]>
|
||||
struct default_delete<_Tp[]>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const
|
||||
{
|
||||
@@ -1967,7 +1944,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _Tp, class _Dp = default_delete<_Tp> >
|
||||
class _LIBCPP_VISIBLE unique_ptr
|
||||
class unique_ptr
|
||||
{
|
||||
public:
|
||||
typedef _Tp element_type;
|
||||
@@ -1976,21 +1953,21 @@ public:
|
||||
private:
|
||||
__compressed_pair<pointer, deleter_type> __ptr_;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unique_ptr(const unique_ptr&);
|
||||
unique_ptr& operator=(const unique_ptr&);
|
||||
template <class _Up, class _Ep>
|
||||
unique_ptr(const unique_ptr<_Up, _Ep>&);
|
||||
template <class _Up, class _Ep>
|
||||
unique_ptr& operator=(const unique_ptr<_Up, _Ep>&);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
unique_ptr(unique_ptr&);
|
||||
template <class _Up, class _Ep>
|
||||
unique_ptr(unique_ptr<_Up, _Ep>&);
|
||||
unique_ptr& operator=(unique_ptr&);
|
||||
template <class _Up, class _Ep>
|
||||
unique_ptr& operator=(unique_ptr<_Up, _Ep>&);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
struct __nat {int __for_bool_;};
|
||||
|
||||
@@ -2016,7 +1993,7 @@ public:
|
||||
"unique_ptr constructed with null function pointer deleter");
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename conditional<
|
||||
is_reference<deleter_type>::value,
|
||||
deleter_type,
|
||||
@@ -2077,7 +2054,7 @@ public:
|
||||
__ptr_.second() = _STD::forward<_Ep>(__u.get_deleter());
|
||||
return *this;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
|
||||
{
|
||||
@@ -2108,7 +2085,7 @@ public:
|
||||
operator=(auto_ptr<_Up> __p)
|
||||
{reset(__p.release()); return *this;}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t)
|
||||
@@ -2144,7 +2121,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp, class _Dp>
|
||||
class _LIBCPP_VISIBLE unique_ptr<_Tp[], _Dp>
|
||||
class unique_ptr<_Tp[], _Dp>
|
||||
{
|
||||
public:
|
||||
typedef _Tp element_type;
|
||||
@@ -2153,17 +2130,17 @@ public:
|
||||
private:
|
||||
__compressed_pair<pointer, deleter_type> __ptr_;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unique_ptr(const unique_ptr&);
|
||||
unique_ptr& operator=(const unique_ptr&);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
unique_ptr(unique_ptr&);
|
||||
template <class _Up>
|
||||
unique_ptr(unique_ptr<_Up>&);
|
||||
unique_ptr& operator=(unique_ptr&);
|
||||
template <class _Up>
|
||||
unique_ptr& operator=(unique_ptr<_Up>&);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
struct __nat {int __for_bool_;};
|
||||
|
||||
@@ -2182,7 +2159,7 @@ public:
|
||||
static_assert(!is_pointer<deleter_type>::value,
|
||||
"unique_ptr constructed with null function pointer deleter");
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P,
|
||||
class = typename enable_if<is_same<_P, pointer>::value>::type
|
||||
>
|
||||
@@ -2233,7 +2210,7 @@ public:
|
||||
__ptr_.second() = _STD::forward<deleter_type>(__u.get_deleter());
|
||||
return *this;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p)
|
||||
: __ptr_(__p)
|
||||
@@ -2263,7 +2240,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t)
|
||||
@@ -2286,7 +2263,7 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P,
|
||||
class = typename enable_if<is_same<_P, pointer>::value>::type
|
||||
>
|
||||
@@ -2311,7 +2288,7 @@ public:
|
||||
if (__tmp)
|
||||
__ptr_.second()(__tmp);
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer())
|
||||
{
|
||||
pointer __tmp = __ptr_.first();
|
||||
@@ -2319,12 +2296,12 @@ public:
|
||||
if (__tmp)
|
||||
__ptr_.second()(__tmp);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) {__ptr_.swap(__u.__ptr_);}
|
||||
private:
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_MOVE
|
||||
template <class _Up>
|
||||
explicit unique_ptr(_Up);
|
||||
template <class _Up>
|
||||
@@ -2338,7 +2315,7 @@ private:
|
||||
is_convertible<_Up, pointer>::value,
|
||||
__nat
|
||||
>::type = __nat());
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
};
|
||||
|
||||
template <class _Tp, class _Dp>
|
||||
@@ -2379,10 +2356,9 @@ operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {re
|
||||
template <class> struct hash;
|
||||
|
||||
template<class _Tp>
|
||||
struct _LIBCPP_VISIBLE hash<_Tp*>
|
||||
struct hash<_Tp*>
|
||||
: public unary_function<_Tp*, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(_Tp* __v) const
|
||||
{
|
||||
const size_t* const __p = reinterpret_cast<const size_t*>(&__v);
|
||||
@@ -2391,11 +2367,10 @@ struct _LIBCPP_VISIBLE hash<_Tp*>
|
||||
};
|
||||
|
||||
template <class _Tp, class _Dp>
|
||||
struct _LIBCPP_VISIBLE hash<unique_ptr<_Tp, _Dp> >
|
||||
struct hash<unique_ptr<_Tp, _Dp> >
|
||||
{
|
||||
typedef unique_ptr<_Tp, _Dp> argument_type;
|
||||
typedef size_t result_type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type operator()(const argument_type& __ptr) const
|
||||
{
|
||||
typedef typename argument_type::pointer pointer;
|
||||
@@ -2454,7 +2429,6 @@ private:
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s)
|
||||
: __alloc_(__a), __s_(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p) {__alloc_traits::deallocate(__alloc_, __p, __s_);}
|
||||
};
|
||||
|
||||
@@ -2508,7 +2482,7 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
|
||||
__h.release();
|
||||
}
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
|
||||
class bad_weak_ptr
|
||||
: public std::exception
|
||||
{
|
||||
public:
|
||||
@@ -2530,13 +2504,11 @@ private:
|
||||
virtual void __on_zero_shared() = 0;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __shared_count(long __refs = 0)
|
||||
: __shared_owners_(__refs) {}
|
||||
|
||||
void __add_shared();
|
||||
void __release_shared();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
long use_count() const {return __shared_owners_ + 1;}
|
||||
};
|
||||
|
||||
@@ -2546,7 +2518,6 @@ class __shared_weak_count
|
||||
long __shared_weak_owners_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __shared_weak_count(long __refs = 0)
|
||||
: __shared_count(__refs),
|
||||
__shared_weak_owners_(__refs) {}
|
||||
@@ -2558,7 +2529,6 @@ public:
|
||||
void __add_weak();
|
||||
void __release_shared();
|
||||
void __release_weak();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
long use_count() const {return __shared_count::use_count();}
|
||||
__shared_weak_count* lock();
|
||||
|
||||
@@ -2575,7 +2545,6 @@ class __shared_ptr_pointer
|
||||
{
|
||||
__compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
|
||||
: __data_(__compressed_pair<_Tp, _Dp>(__p, _STD::move(__d)), _STD::move(__a)) {}
|
||||
|
||||
@@ -2624,33 +2593,27 @@ class __shared_ptr_emplace
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a)
|
||||
: __data_(_STD::move(__a)) {}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
|
||||
: __data_(_STD::move(__a), _Tp(_STD::forward<_Args>(__args)...)) {}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a)
|
||||
: __data_(__a) {}
|
||||
|
||||
template <class _A0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a, _A0& __a0)
|
||||
: __data_(__a, _Tp(__a0)) {}
|
||||
|
||||
template <class _A0, class _A1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1)
|
||||
: __data_(__a, _Tp(__a0, __a1)) {}
|
||||
|
||||
template <class _A0, class _A1, class _A2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1, _A2& __a2)
|
||||
: __data_(__a, _Tp(__a0, __a1, __a2)) {}
|
||||
|
||||
@@ -2660,7 +2623,6 @@ private:
|
||||
virtual void __on_zero_shared();
|
||||
virtual void __on_zero_shared_weak();
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp* get() {return &__data_.second();}
|
||||
};
|
||||
|
||||
@@ -2683,7 +2645,7 @@ __shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak()
|
||||
template<class _Tp> class enable_shared_from_this;
|
||||
|
||||
template<class _Tp>
|
||||
class _LIBCPP_VISIBLE shared_ptr
|
||||
class shared_ptr
|
||||
{
|
||||
public:
|
||||
typedef _Tp element_type;
|
||||
@@ -2705,19 +2667,19 @@ public:
|
||||
template<class _Yp>
|
||||
shared_ptr(const shared_ptr<_Yp>& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat());
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
shared_ptr(shared_ptr&& __r);
|
||||
template<class _Yp> shared_ptr(shared_ptr<_Yp>&& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat());
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type= __nat());
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template<class _Yp> shared_ptr(auto_ptr<_Yp>&& __r);
|
||||
#else
|
||||
template<class _Yp> shared_ptr(auto_ptr<_Yp> __r);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
private:
|
||||
template <class _Yp, class _Dp> shared_ptr(const unique_ptr<_Yp, _Dp>& __r);// = delete;
|
||||
public:
|
||||
@@ -2725,30 +2687,30 @@ public:
|
||||
typename enable_if<!is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
|
||||
template <class _Yp, class _Dp> shared_ptr(unique_ptr<_Yp, _Dp>&&,
|
||||
typename enable_if<is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
template <class _Yp, class _Dp> shared_ptr(unique_ptr<_Yp, _Dp>,
|
||||
typename enable_if<!is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
|
||||
template <class _Yp, class _Dp> shared_ptr(unique_ptr<_Yp, _Dp>,
|
||||
typename enable_if<is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
~shared_ptr();
|
||||
|
||||
shared_ptr& operator=(const shared_ptr& __r);
|
||||
template<class _Yp> shared_ptr& operator=(const shared_ptr<_Yp>& __r);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
shared_ptr& operator=(shared_ptr&& __r);
|
||||
template<class _Yp> shared_ptr& operator=(shared_ptr<_Yp>&& __r);
|
||||
template<class _Yp> shared_ptr& operator=(auto_ptr<_Yp>&& __r);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
template<class _Yp> shared_ptr& operator=(auto_ptr<_Yp> __r);
|
||||
#endif
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
private:
|
||||
template <class _Yp, class _Dp> shared_ptr& operator=(const unique_ptr<_Yp, _Dp>& __r);// = delete;
|
||||
public:
|
||||
template <class _Yp, class _Dp> shared_ptr& operator=(unique_ptr<_Yp, _Dp>&& __r);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
template <class _Yp, class _Dp> shared_ptr& operator=(unique_ptr<_Yp, _Dp> __r);
|
||||
#endif
|
||||
|
||||
@@ -2758,32 +2720,20 @@ public:
|
||||
template<class _Yp, class _Dp> void reset(_Yp* __p, _Dp __d);
|
||||
template<class _Yp, class _Dp, class _Alloc> void reset(_Yp* __p, _Dp __d, _Alloc __a);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
element_type* get() const {return __ptr_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename add_lvalue_reference<element_type>::type operator*() const {return *__ptr_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
element_type* operator->() const {return __ptr_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
long use_count() const {return __cntrl_ ? __cntrl_->use_count() : 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool unique() const {return use_count() == 1;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __cntrl_ == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*explicit*/ operator bool() const {return get() != 0;}
|
||||
template <class _U>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool owner_before(shared_ptr<_U> const& __p) const
|
||||
template <class _U> bool owner_before(shared_ptr<_U> const& __p) const
|
||||
{return __cntrl_ < __p.__cntrl_;}
|
||||
template <class _U>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool owner_before(weak_ptr<_U> const& __p) const
|
||||
template <class _U> bool owner_before(weak_ptr<_U> const& __p) const
|
||||
{return __cntrl_ < __p.__cntrl_;}
|
||||
|
||||
#ifndef _LIBCPP_NO_RTTI
|
||||
template <class _Dp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Dp* __get_deleter() const
|
||||
{return (_Dp*)(__cntrl_ ? __cntrl_->__get_deleter(typeid(_Dp)) : 0);}
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
@@ -2834,7 +2784,6 @@ public:
|
||||
private:
|
||||
|
||||
template <class _Yp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__enable_weak_this(const enable_shared_from_this<_Yp>* __e)
|
||||
{
|
||||
@@ -2842,11 +2791,10 @@ private:
|
||||
__e->__weak_this_ = *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __enable_weak_this(const void*) {}
|
||||
|
||||
template <class _Up> friend class _LIBCPP_VISIBLE shared_ptr;
|
||||
template <class _Up> friend class _LIBCPP_VISIBLE weak_ptr;
|
||||
template <class _Up> friend class shared_ptr;
|
||||
template <class _Up> friend class weak_ptr;
|
||||
};
|
||||
|
||||
template<class _Tp>
|
||||
@@ -3006,7 +2954,7 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
|
||||
__cntrl_->__add_shared();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -3030,11 +2978,11 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
|
||||
__r.__cntrl_ = 0;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r)
|
||||
#else
|
||||
shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r)
|
||||
@@ -3049,7 +2997,7 @@ shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r)
|
||||
|
||||
template<class _Tp>
|
||||
template <class _Yp, class _Dp>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
|
||||
#else
|
||||
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
|
||||
@@ -3065,7 +3013,7 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
|
||||
|
||||
template<class _Tp>
|
||||
template <class _Yp, class _Dp>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
|
||||
#else
|
||||
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
|
||||
@@ -3292,7 +3240,7 @@ shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -3333,7 +3281,7 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
@@ -3355,7 +3303,7 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template<class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -3556,7 +3504,7 @@ get_deleter(const shared_ptr<_Tp>& __p)
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _Tp>
|
||||
class _LIBCPP_VISIBLE weak_ptr
|
||||
class weak_ptr
|
||||
{
|
||||
public:
|
||||
typedef _Tp element_type;
|
||||
@@ -3581,22 +3529,16 @@ public:
|
||||
void swap(weak_ptr& __r);
|
||||
void reset();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
long use_count() const {return __cntrl_ ? __cntrl_->use_count() : 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool expired() const {return __cntrl_ == 0 || __cntrl_->use_count() == 0;}
|
||||
shared_ptr<_Tp> lock() const;
|
||||
template<class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool owner_before(const shared_ptr<_Up>& __r) const
|
||||
template<class _Up> bool owner_before(const shared_ptr<_Up>& __r) const
|
||||
{return __cntrl_ < __r.__cntrl_;}
|
||||
template<class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool owner_before(const weak_ptr<_Up>& __r) const
|
||||
template<class _Up> bool owner_before(const weak_ptr<_Up>& __r) const
|
||||
{return __cntrl_ < __r.__cntrl_;}
|
||||
|
||||
template <class _Up> friend class _LIBCPP_VISIBLE weak_ptr;
|
||||
template <class _Up> friend class _LIBCPP_VISIBLE shared_ptr;
|
||||
template <class _Up> friend class weak_ptr;
|
||||
template <class _Up> friend class shared_ptr;
|
||||
};
|
||||
|
||||
template<class _Tp>
|
||||
@@ -3731,65 +3673,52 @@ weak_ptr<_Tp>::lock() const
|
||||
template <class _Tp> struct owner_less;
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE owner_less<shared_ptr<_Tp> >
|
||||
struct owner_less<shared_ptr<_Tp> >
|
||||
: binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
|
||||
{
|
||||
typedef bool result_type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
|
||||
{return __x.owner_before(__y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
|
||||
{return __x.owner_before(__y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
|
||||
{return __x.owner_before(__y);}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE owner_less<weak_ptr<_Tp> >
|
||||
struct owner_less<weak_ptr<_Tp> >
|
||||
: binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
|
||||
{
|
||||
typedef bool result_type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
|
||||
{return __x.owner_before(__y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
|
||||
{return __x.owner_before(__y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
|
||||
{return __x.owner_before(__y);}
|
||||
};
|
||||
|
||||
template<class _Tp>
|
||||
class _LIBCPP_VISIBLE enable_shared_from_this
|
||||
class enable_shared_from_this
|
||||
{
|
||||
mutable weak_ptr<_Tp> __weak_this_;
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
enable_shared_from_this() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
enable_shared_from_this(enable_shared_from_this const&) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
enable_shared_from_this& operator=(enable_shared_from_this const&) {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~enable_shared_from_this() {}
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp> shared_from_this() {return shared_ptr<_Tp>(__weak_this_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp const> shared_from_this() const {return shared_ptr<const _Tp>(__weak_this_);}
|
||||
|
||||
template <class _Up> friend class shared_ptr;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE hash<shared_ptr<_Tp> >
|
||||
struct hash<shared_ptr<_Tp> >
|
||||
{
|
||||
typedef shared_ptr<_Tp> argument_type;
|
||||
typedef size_t result_type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type operator()(const argument_type& __ptr) const
|
||||
{
|
||||
return hash<_Tp*>()(__ptr.get());
|
||||
@@ -3797,7 +3726,7 @@ struct _LIBCPP_VISIBLE hash<shared_ptr<_Tp> >
|
||||
};
|
||||
|
||||
//enum class
|
||||
struct _LIBCPP_VISIBLE pointer_safety
|
||||
struct pointer_safety
|
||||
{
|
||||
enum _
|
||||
{
|
||||
@@ -3808,9 +3737,7 @@ struct _LIBCPP_VISIBLE pointer_safety
|
||||
|
||||
_ __v_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer_safety(_ __v) : __v_(__v) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
operator int() const {return __v_;}
|
||||
};
|
||||
|
||||
|
@@ -180,7 +180,7 @@ template<class Callable, class ...Args>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE recursive_mutex
|
||||
class recursive_mutex
|
||||
{
|
||||
pthread_mutex_t __m_;
|
||||
|
||||
@@ -198,11 +198,10 @@ public:
|
||||
void unlock();
|
||||
|
||||
typedef pthread_mutex_t* native_handle_type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
native_handle_type native_handle() {return &__m_;}
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE timed_mutex
|
||||
class timed_mutex
|
||||
{
|
||||
mutex __m_;
|
||||
condition_variable __cv_;
|
||||
@@ -219,7 +218,6 @@ public:
|
||||
void lock();
|
||||
bool try_lock();
|
||||
template <class _Rep, class _Period>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
||||
{return try_lock_until(chrono::monotonic_clock::now() + __d);}
|
||||
template <class _Clock, class _Duration>
|
||||
@@ -244,7 +242,7 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
|
||||
return false;
|
||||
}
|
||||
|
||||
class _LIBCPP_VISIBLE recursive_timed_mutex
|
||||
class recursive_timed_mutex
|
||||
{
|
||||
mutex __m_;
|
||||
condition_variable __cv_;
|
||||
@@ -262,7 +260,6 @@ public:
|
||||
void lock();
|
||||
bool try_lock();
|
||||
template <class _Rep, class _Period>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
||||
{return try_lock_until(chrono::monotonic_clock::now() + __d);}
|
||||
template <class _Clock, class _Duration>
|
||||
@@ -409,7 +406,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& ...__l2)
|
||||
}
|
||||
|
||||
template <class _L0, class _L1, class ..._L2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
lock(_L0& __l0, _L1& __l1, _L2& ...__l2)
|
||||
{
|
||||
@@ -432,9 +429,8 @@ template<class _Callable>
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
struct _LIBCPP_VISIBLE once_flag
|
||||
struct once_flag
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// constexpr
|
||||
once_flag() {}
|
||||
|
||||
@@ -460,15 +456,12 @@ class __call_once_param
|
||||
{
|
||||
_F __f_;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
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()()
|
||||
{
|
||||
__f_();
|
||||
|
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
void __throw_bad_alloc(); // not in C++ spec
|
||||
|
||||
struct _LIBCPP_VISIBLE nothrow_t {};
|
||||
struct nothrow_t {};
|
||||
extern _LIBCPP_VISIBLE const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) throw();
|
||||
|
@@ -138,7 +138,7 @@ template <class charT, class traits, class T>
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ostream
|
||||
class basic_ostream
|
||||
: virtual public basic_ios<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -153,12 +153,12 @@ public:
|
||||
explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb);
|
||||
virtual ~basic_ostream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ostream(basic_ostream&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.7.2.3 Assign/swap
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ostream& operator=(basic_ostream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ostream& __rhs);
|
||||
@@ -203,7 +203,7 @@ protected:
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ostream<_CharT, _Traits>::sentry
|
||||
class basic_ostream<_CharT, _Traits>::sentry
|
||||
{
|
||||
bool __ok_;
|
||||
basic_ostream<_CharT, _Traits>& __os_;
|
||||
@@ -261,7 +261,7 @@ basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<char_type, traits_
|
||||
this->init(__sb);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -279,7 +279,7 @@ basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT, _Traits>::~basic_ostream()
|
||||
@@ -1206,7 +1206,7 @@ flush(basic_ostream<_CharT, _Traits>& __os)
|
||||
return __os;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Stream, class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1222,7 +1222,7 @@ operator<<(_Stream&& __os, const _Tp& __x)
|
||||
return __os;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
|
134
include/queue
134
include/queue
@@ -167,7 +167,7 @@ bool
|
||||
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
||||
|
||||
template <class _Tp, class _Container = deque<_Tp> >
|
||||
class _LIBCPP_VISIBLE queue
|
||||
class queue
|
||||
{
|
||||
public:
|
||||
typedef _Container container_type;
|
||||
@@ -180,86 +180,63 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue() : c() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit queue(const container_type& __c) : c(__c) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
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
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit queue(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(const queue& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__q.c, __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(const container_type& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__c, __a) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(container_type&& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_STD::move(__c), __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_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
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference front() {return c.front();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference front() const {return c.front();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference back() {return c.back();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference back() const {return c.back();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(const value_type& __v) {c.push_back(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push(value_type&& __v) {c.push_back(_STD::move(__v));}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop() {c.pop_front();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(queue& __q)
|
||||
{
|
||||
using _STD::swap;
|
||||
@@ -268,19 +245,17 @@ public:
|
||||
|
||||
template <class _T1, class _C1>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
|
||||
|
||||
template <class _T1, class _C1>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -288,7 +263,7 @@ operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -296,7 +271,7 @@ operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -304,7 +279,7 @@ operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -312,7 +287,7 @@ operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -320,7 +295,7 @@ operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -328,7 +303,7 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -336,14 +311,14 @@ swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<queue<_Tp, _Container>, _Alloc>
|
||||
struct uses_allocator<queue<_Tp, _Container>, _Alloc>
|
||||
: public uses_allocator<_Container, _Alloc>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container = vector<_Tp>,
|
||||
class _Compare = less<typename _Container::value_type> >
|
||||
class _LIBCPP_VISIBLE priority_queue
|
||||
class priority_queue
|
||||
{
|
||||
public:
|
||||
typedef _Container container_type;
|
||||
@@ -358,11 +333,10 @@ protected:
|
||||
value_compare comp;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit priority_queue(const value_compare& __comp = value_compare())
|
||||
: c(), comp(__comp) {}
|
||||
priority_queue(const value_compare& __comp, const container_type& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
explicit priority_queue(const value_compare& __comp, container_type&& __c);
|
||||
#endif
|
||||
template <class _InputIter>
|
||||
@@ -371,13 +345,13 @@ public:
|
||||
template <class _InputIter>
|
||||
priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp, const container_type& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
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
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
explicit priority_queue(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -395,7 +369,7 @@ public:
|
||||
priority_queue(const priority_queue& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
priority_queue(const value_compare& __comp, container_type&& __c,
|
||||
const _Alloc& __a,
|
||||
@@ -405,29 +379,24 @@ public:
|
||||
priority_queue(priority_queue&& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference top() const {return c.front();}
|
||||
|
||||
void push(const value_type& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push(value_type&& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args> void emplace(_Args&&... __args);
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop();
|
||||
|
||||
void swap(priority_queue& __q);
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp,
|
||||
const container_type& __c)
|
||||
: c(__c),
|
||||
@@ -436,10 +405,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
container_type&& __c)
|
||||
: c(_STD::move(__c)),
|
||||
@@ -448,11 +417,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp)
|
||||
: c(__f, __l),
|
||||
@@ -463,7 +432,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp,
|
||||
const container_type& __c)
|
||||
@@ -474,11 +443,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp,
|
||||
container_type&& __c)
|
||||
@@ -490,7 +459,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q)
|
||||
: c(_STD::move(__q.c)),
|
||||
comp(_STD::move(__q.comp))
|
||||
@@ -506,11 +475,11 @@ priority_queue<_Tp, _Container, _Compare>::operator=(priority_queue&& __q)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type*)
|
||||
@@ -520,7 +489,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -532,7 +501,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
const container_type& __c,
|
||||
const _Alloc& __a,
|
||||
@@ -546,7 +515,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -557,11 +526,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue&
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
container_type&& __c,
|
||||
const _Alloc& __a,
|
||||
@@ -575,7 +544,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -586,10 +555,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
|
||||
{
|
||||
@@ -597,10 +566,10 @@ priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
|
||||
{
|
||||
@@ -608,11 +577,9 @@ priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
|
||||
{
|
||||
@@ -620,11 +587,10 @@ priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::pop()
|
||||
{
|
||||
@@ -633,7 +599,7 @@ priority_queue<_Tp, _Container, _Compare>::pop()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
|
||||
{
|
||||
@@ -643,7 +609,7 @@ priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(priority_queue<_Tp, _Container, _Compare>& __x,
|
||||
priority_queue<_Tp, _Container, _Compare>& __y)
|
||||
@@ -652,7 +618,7 @@ swap(priority_queue<_Tp, _Container, _Compare>& __x,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
|
||||
struct uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
|
||||
: public uses_allocator<_Container, _Alloc>
|
||||
{
|
||||
};
|
||||
|
894
include/random
894
include/random
File diff suppressed because it is too large
Load Diff
@@ -220,7 +220,7 @@ public:
|
||||
};
|
||||
|
||||
template <intmax_t _Num, intmax_t _Den = 1>
|
||||
class _LIBCPP_VISIBLE ratio
|
||||
class ratio
|
||||
{
|
||||
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
|
||||
static_assert(_Den != 0, "ratio divide by 0");
|
||||
@@ -260,7 +260,7 @@ typedef ratio< 1000000000000000LL, 1LL> peta;
|
||||
typedef ratio<1000000000000000000LL, 1LL> exa;
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_multiply
|
||||
struct ratio_multiply
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_d2 = __static_gcd<_R1::num, _R2::den>::value;
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_divide
|
||||
struct ratio_divide
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_add
|
||||
struct ratio_add
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_subtract
|
||||
struct ratio_subtract
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
|
||||
@@ -334,11 +334,11 @@ public:
|
||||
// ratio_equal
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_equal
|
||||
struct ratio_equal
|
||||
: public integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_not_equal
|
||||
struct ratio_not_equal
|
||||
: public integral_constant<bool, !ratio_equal<_R1, _R2>::value> {};
|
||||
|
||||
// ratio_less
|
||||
@@ -397,19 +397,19 @@ struct __ratio_less<_R1, _R2, -1LL, -1LL>
|
||||
};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_less
|
||||
struct ratio_less
|
||||
: public integral_constant<bool, __ratio_less<_R1, _R2>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_less_equal
|
||||
struct ratio_less_equal
|
||||
: public integral_constant<bool, !ratio_less<_R2, _R1>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_greater
|
||||
struct ratio_greater
|
||||
: public integral_constant<bool, ratio_less<_R2, _R1>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_greater_equal
|
||||
struct ratio_greater_equal
|
||||
: public integral_constant<bool, !ratio_less<_R1, _R2>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
|
298
include/regex
298
include/regex
@@ -717,6 +717,10 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
|
||||
} // std
|
||||
*/
|
||||
|
||||
// temporary!
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
|
||||
#include <__config>
|
||||
#include <stdexcept>
|
||||
#include <__locale>
|
||||
@@ -751,7 +755,7 @@ enum syntax_option_type
|
||||
egrep = 1 << 8
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type
|
||||
operator~(syntax_option_type __x)
|
||||
@@ -759,7 +763,7 @@ operator~(syntax_option_type __x)
|
||||
return syntax_option_type(~int(__x));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type
|
||||
operator&(syntax_option_type __x, syntax_option_type __y)
|
||||
@@ -767,7 +771,7 @@ operator&(syntax_option_type __x, syntax_option_type __y)
|
||||
return syntax_option_type(int(__x) & int(__y));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type
|
||||
operator|(syntax_option_type __x, syntax_option_type __y)
|
||||
@@ -775,7 +779,7 @@ operator|(syntax_option_type __x, syntax_option_type __y)
|
||||
return syntax_option_type(int(__x) | int(__y));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type
|
||||
operator^(syntax_option_type __x, syntax_option_type __y)
|
||||
@@ -783,7 +787,7 @@ operator^(syntax_option_type __x, syntax_option_type __y)
|
||||
return syntax_option_type(int(__x) ^ int(__y));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type&
|
||||
operator&=(syntax_option_type& __x, syntax_option_type __y)
|
||||
@@ -792,7 +796,7 @@ operator&=(syntax_option_type& __x, syntax_option_type __y)
|
||||
return __x;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type&
|
||||
operator|=(syntax_option_type& __x, syntax_option_type __y)
|
||||
@@ -801,7 +805,7 @@ operator|=(syntax_option_type& __x, syntax_option_type __y)
|
||||
return __x;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
syntax_option_type&
|
||||
operator^=(syntax_option_type& __x, syntax_option_type __y)
|
||||
@@ -830,7 +834,7 @@ enum match_flag_type
|
||||
__no_update_pos = 1 << 11
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type
|
||||
operator~(match_flag_type __x)
|
||||
@@ -838,7 +842,7 @@ operator~(match_flag_type __x)
|
||||
return match_flag_type(~int(__x));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type
|
||||
operator&(match_flag_type __x, match_flag_type __y)
|
||||
@@ -846,7 +850,7 @@ operator&(match_flag_type __x, match_flag_type __y)
|
||||
return match_flag_type(int(__x) & int(__y));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type
|
||||
operator|(match_flag_type __x, match_flag_type __y)
|
||||
@@ -854,7 +858,7 @@ operator|(match_flag_type __x, match_flag_type __y)
|
||||
return match_flag_type(int(__x) | int(__y));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type
|
||||
operator^(match_flag_type __x, match_flag_type __y)
|
||||
@@ -862,7 +866,7 @@ operator^(match_flag_type __x, match_flag_type __y)
|
||||
return match_flag_type(int(__x) ^ int(__y));
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type&
|
||||
operator&=(match_flag_type& __x, match_flag_type __y)
|
||||
@@ -871,7 +875,7 @@ operator&=(match_flag_type& __x, match_flag_type __y)
|
||||
return __x;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type&
|
||||
operator|=(match_flag_type& __x, match_flag_type __y)
|
||||
@@ -880,7 +884,7 @@ operator|=(match_flag_type& __x, match_flag_type __y)
|
||||
return __x;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
/*constexpr*/
|
||||
match_flag_type&
|
||||
operator^=(match_flag_type& __x, match_flag_type __y)
|
||||
@@ -918,12 +922,11 @@ class _LIBCPP_EXCEPTION_ABI regex_error
|
||||
public:
|
||||
explicit regex_error(regex_constants::error_type __ecode);
|
||||
virtual ~regex_error() throw();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
regex_constants::error_type code() const {return __code_;}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
struct _LIBCPP_VISIBLE regex_traits
|
||||
struct regex_traits
|
||||
{
|
||||
public:
|
||||
typedef _CharT char_type;
|
||||
@@ -940,37 +943,30 @@ private:
|
||||
public:
|
||||
regex_traits();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_t length(const char_type* __p)
|
||||
{return char_traits<char_type>::length(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type translate(char_type __c) const {return __c;}
|
||||
char_type translate_nocase(char_type __c) const;
|
||||
template <class _ForwardIterator>
|
||||
string_type
|
||||
transform(_ForwardIterator __f, _ForwardIterator __l) const;
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type
|
||||
transform_primary( _ForwardIterator __f, _ForwardIterator __l) const
|
||||
{return __transform_primary(__f, __l, char_type());}
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type
|
||||
lookup_collatename(_ForwardIterator __f, _ForwardIterator __l) const
|
||||
{return __lookup_collatename(__f, __l, char_type());}
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_class_type
|
||||
lookup_classname(_ForwardIterator __f, _ForwardIterator __l,
|
||||
bool __icase = false) const
|
||||
{return __lookup_classname(__f, __l, __icase, char_type());}
|
||||
bool isctype(char_type __c, char_class_type __m) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int value(char_type __ch, int __radix) const
|
||||
{return __value(__ch, __radix);}
|
||||
locale_type imbue(locale_type __l);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
locale_type getloc()const {return __loc_;}
|
||||
|
||||
private:
|
||||
@@ -1000,7 +996,6 @@ private:
|
||||
bool __icase, wchar_t) const;
|
||||
|
||||
static int __value(unsigned char __ch, int __radix);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int __value(char __ch, int __radix) const
|
||||
{return __value(static_cast<unsigned char>(__ch), __radix);}
|
||||
int __value(wchar_t __ch, int __radix) const;
|
||||
@@ -1220,7 +1215,7 @@ regex_traits<_CharT>::__value(unsigned char __ch, int __radix)
|
||||
}
|
||||
|
||||
template <class _CharT>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
int
|
||||
regex_traits<_CharT>::__value(wchar_t __ch, int __radix) const
|
||||
{
|
||||
@@ -1261,12 +1256,23 @@ struct __state
|
||||
const __node<_CharT>* __node_;
|
||||
regex_constants::match_flag_type __flags_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__state()
|
||||
: __do_(0), __first_(nullptr), __current_(nullptr), __last_(nullptr),
|
||||
__node_(nullptr), __flags_() {}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
ostream&
|
||||
operator<<(ostream& os, const __state<_CharT>& c)
|
||||
{
|
||||
os << c.__do_;
|
||||
if (c.__node_)
|
||||
os << ", " << c.__node_->speak();
|
||||
else
|
||||
os << ", null";
|
||||
return os;
|
||||
}
|
||||
|
||||
// __node
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1277,15 +1283,13 @@ class __node
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual ~__node() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual void __exec(__state&) const {};
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
virtual void __exec_split(bool, __state&) const {};
|
||||
|
||||
virtual string speak() const {return "__node";}
|
||||
};
|
||||
|
||||
// __end_state
|
||||
@@ -1297,10 +1301,11 @@ class __end_state
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__end_state() {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const {return "end state";}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1319,13 +1324,10 @@ class __has_one_state
|
||||
__node<_CharT>* __first_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __has_one_state(__node<_CharT>* __s)
|
||||
: __first_(__s) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node<_CharT>* first() const {return __first_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__node<_CharT>*& first() {return __first_;}
|
||||
};
|
||||
|
||||
@@ -1338,7 +1340,6 @@ class __owns_one_state
|
||||
typedef __has_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __owns_one_state(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
@@ -1362,11 +1363,12 @@ class __empty_state
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __empty_state(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const {return "empty state";}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1388,11 +1390,12 @@ class __empty_non_own_state
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __empty_non_own_state(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const {return "empty non-owning state";}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1414,11 +1417,12 @@ class __repeat_one_loop
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __repeat_one_loop(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const {return "repeat loop";}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1440,15 +1444,12 @@ class __owns_two_states
|
||||
base* __second_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __owns_two_states(__node<_CharT>* __s1, base* __s2)
|
||||
: base(__s1), __second_(__s2) {}
|
||||
|
||||
virtual ~__owns_two_states();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
base* second() const {return __second_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
base*& second() {return __second_;}
|
||||
};
|
||||
|
||||
@@ -1476,7 +1477,6 @@ class __loop
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __loop(unsigned __loop_id,
|
||||
__node<_CharT>* __s1, __owns_one_state<_CharT>* __s2,
|
||||
unsigned __mexp_begin, unsigned __mexp_end,
|
||||
@@ -1490,8 +1490,17 @@ public:
|
||||
virtual void __exec(__state& __s) const;
|
||||
virtual void __exec_split(bool __second, __state& __s) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "loop "<< __loop_id_ << " {" << __min_ << ',' << __max_ << "}";
|
||||
if (!__greedy_)
|
||||
os << " not";
|
||||
os << " greedy";
|
||||
return os.str();
|
||||
}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __init_repeat(__state& __s) const
|
||||
{
|
||||
__s.__loop_data_[__loop_id_].second = __s.__current_;
|
||||
@@ -1575,13 +1584,19 @@ class __alternate
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __alternate(__owns_one_state<_CharT>* __s1,
|
||||
__owns_one_state<_CharT>* __s2)
|
||||
: base(__s1, __s2) {}
|
||||
|
||||
virtual void __exec(__state& __s) const;
|
||||
virtual void __exec_split(bool __second, __state& __s) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "__alternate";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1614,11 +1629,17 @@ class __begin_marked_subexpression
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __begin_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
|
||||
: base(__s), __mexp_(__mexp) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "begin marked expr " << __mexp_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1642,11 +1663,17 @@ class __end_marked_subexpression
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __end_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
|
||||
: base(__s), __mexp_(__mexp) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "end marked expr " << __mexp_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1671,11 +1698,17 @@ class __back_ref
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __back_ref(unsigned __mexp, __node<_CharT>* __s)
|
||||
: base(__s), __mexp_(__mexp) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "__back_ref " << __mexp_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1719,12 +1752,18 @@ class __back_ref_icase
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __back_ref_icase(const _Traits& __traits, unsigned __mexp,
|
||||
__node<_CharT>* __s)
|
||||
: base(__s), __traits_(__traits), __mexp_(__mexp) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "__back_ref_icase " << __mexp_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -1774,12 +1813,18 @@ class __back_ref_collate
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __back_ref_collate(const _Traits& __traits, unsigned __mexp,
|
||||
__node<_CharT>* __s)
|
||||
: base(__s), __traits_(__traits), __mexp_(__mexp) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "__back_ref_collate " << __mexp_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -1829,12 +1874,21 @@ class __word_boundary
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __word_boundary(const _Traits& __traits, bool __invert,
|
||||
__node<_CharT>* __s)
|
||||
: base(__s), __traits_(__traits), __invert_(__invert) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
if (!__invert_)
|
||||
os << "__word_boundary";
|
||||
else
|
||||
os << "not __word_boundary";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -1897,11 +1951,17 @@ class __r_anchor
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__r_anchor(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "right anchor";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1931,11 +1991,17 @@ class __match_any
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_any(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "match any";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -1966,11 +2032,17 @@ class __match_any_but_newline
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_any_but_newline(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "match any but newline";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
// __match_char
|
||||
@@ -1988,11 +2060,17 @@ class __match_char
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_char(_CharT __c, __node<_CharT>* __s)
|
||||
: base(__s), __c_(__c) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "match char " << __c_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
@@ -2028,11 +2106,17 @@ class __match_char_icase
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
|
||||
: base(__s), __traits_(__traits), __c_(__traits.translate_nocase(__c)) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "match char icase " << __c_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -2069,11 +2153,17 @@ class __match_char_collate
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
|
||||
: base(__s), __traits_(__traits), __c_(__traits.translate(__c)) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "match char icase " << __c_;
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -2121,7 +2211,6 @@ class __bracket_expression
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bracket_expression(const _Traits& __traits, __node<_CharT>* __s,
|
||||
bool __negate, bool __icase, bool __collate)
|
||||
: base(__s), __traits_(__traits), __mask_(), __neg_mask_(),
|
||||
@@ -2130,10 +2219,8 @@ public:
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool __negated() const {return __negate_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_char(_CharT __c)
|
||||
{
|
||||
if (__icase_)
|
||||
@@ -2143,7 +2230,6 @@ public:
|
||||
else
|
||||
__chars_.push_back(__c);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_neg_char(_CharT __c)
|
||||
{
|
||||
if (__icase_)
|
||||
@@ -2153,7 +2239,6 @@ public:
|
||||
else
|
||||
__neg_chars_.push_back(__c);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_range(string_type __b, string_type __e)
|
||||
{
|
||||
if (__collate_)
|
||||
@@ -2190,7 +2275,6 @@ public:
|
||||
__ranges_.push_back(make_pair(_STD::move(__b), _STD::move(__e)));
|
||||
}
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_digraph(_CharT __c1, _CharT __c2)
|
||||
{
|
||||
if (__icase_)
|
||||
@@ -2202,15 +2286,19 @@ public:
|
||||
else
|
||||
__digraphs_.push_back(make_pair(__c1, __c2));
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_equivalence(const string_type& __s)
|
||||
{__equivalences_.push_back(__s);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_class(ctype_base::mask __mask)
|
||||
{__mask_ |= __mask;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __add_neg_class(ctype_base::mask __mask)
|
||||
{__neg_mask_ |= __mask;}
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
os << "__bracket_expression ";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -2374,7 +2462,7 @@ __exit:
|
||||
template <class, class> class __lookahead;
|
||||
|
||||
template <class _CharT, class _Traits = regex_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_regex
|
||||
class basic_regex
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -2409,17 +2497,14 @@ public:
|
||||
static const/*expr*/ regex_constants::syntax_option_type egrep = regex_constants::egrep;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex()
|
||||
: __flags_(), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__parse(__p, __p + __traits_.length(__p));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(const value_type* __p, size_t __len, flag_type __f)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
@@ -2427,20 +2512,17 @@ public:
|
||||
// basic_regex(const basic_regex&) = default;
|
||||
// basic_regex(basic_regex&&) = default;
|
||||
template <class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__parse(__p.begin(), __p.end());}
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(_ForwardIterator __first, _ForwardIterator __last,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__parse(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(initializer_list<value_type> __il,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
@@ -2451,35 +2533,27 @@ public:
|
||||
|
||||
// basic_regex& operator=(const basic_regex&) = default;
|
||||
// basic_regex& operator=(basic_regex&&) = default;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& operator=(const value_type* __p)
|
||||
{return assign(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& operator=(initializer_list<value_type> __il)
|
||||
{return assign(__il);}
|
||||
template <class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
|
||||
{return assign(__p);}
|
||||
|
||||
// assign:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& assign(const basic_regex& __that)
|
||||
{return *this = __that;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
|
||||
{return assign(__p, __p + __traits_.length(__p), __f);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& assign(const value_type* __p, size_t __len, flag_type __f)
|
||||
{return assign(__p, __p + __len, __f);}
|
||||
template <class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& assign(const basic_string<value_type, _ST, _SA>& __s,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
{return assign(__s.begin(), __s.end(), __f);}
|
||||
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_input_iterator <_InputIterator>::value &&
|
||||
@@ -2494,7 +2568,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __member_init(flag_type __f)
|
||||
{
|
||||
__flags_ = __f;
|
||||
@@ -2507,7 +2580,6 @@ private:
|
||||
public:
|
||||
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_forward_iterator<_ForwardIterator>::value,
|
||||
@@ -2520,33 +2592,27 @@ public:
|
||||
__parse(__first, __last);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex& assign(initializer_list<value_type> __il,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
{return assign(__il.begin(), __il.end(), __f);}
|
||||
|
||||
// const operations:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unsigned mark_count() const {return __marked_count_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
flag_type flags() const {return __flags_;}
|
||||
|
||||
// locale:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
locale_type imbue(locale_type __loc)
|
||||
{
|
||||
__member_init(ECMAScript);
|
||||
__start_.reset();
|
||||
return __traits_.imbue(__loc);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
locale_type getloc() const {return __traits_.getloc();}
|
||||
|
||||
// swap:
|
||||
void swap(basic_regex& __r);
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unsigned __loop_count() const {return __loop_count_;}
|
||||
|
||||
template <class _ForwardIterator>
|
||||
@@ -2689,17 +2755,14 @@ private:
|
||||
__parse_awk_escape(_ForwardIterator __first, _ForwardIterator __last,
|
||||
basic_string<_CharT>* __str = nullptr);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __push_l_anchor() {__left_anchor_ = true;}
|
||||
void __push_r_anchor();
|
||||
void __push_match_any();
|
||||
void __push_match_any_but_newline();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __push_greedy_inf_repeat(size_t __min, __owns_one_state<_CharT>* __s,
|
||||
unsigned __mexp_begin = 0, unsigned __mexp_end = 0)
|
||||
{__push_loop(__min, numeric_limits<size_t>::max(), __s,
|
||||
__mexp_begin, __mexp_end);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __push_nongreedy_inf_repeat(size_t __min, __owns_one_state<_CharT>* __s,
|
||||
unsigned __mexp_begin = 0, unsigned __mexp_end = 0)
|
||||
{__push_loop(__min, numeric_limits<size_t>::max(), __s,
|
||||
@@ -2832,11 +2895,20 @@ class __lookahead
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s)
|
||||
: base(__s), __exp_(__exp), __invert_(__invert) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
|
||||
virtual string speak() const
|
||||
{
|
||||
ostringstream os;
|
||||
if (__invert_)
|
||||
os << "not lookahead";
|
||||
else
|
||||
os << "lookahead";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -4672,7 +4744,7 @@ typedef basic_regex<wchar_t> wregex;
|
||||
// sub_match
|
||||
|
||||
template <class _BidirectionalIterator>
|
||||
class _LIBCPP_VISIBLE sub_match
|
||||
class sub_match
|
||||
: public pair<_BidirectionalIterator, _BidirectionalIterator>
|
||||
{
|
||||
public:
|
||||
@@ -4683,23 +4755,17 @@ public:
|
||||
|
||||
bool matched;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
difference_type length() const
|
||||
{return matched ? _STD::distance(this->first, this->second) : 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type str() const
|
||||
{return matched ? string_type(this->first, this->second) : string_type();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
operator string_type() const
|
||||
{return str();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(const sub_match& __s) const
|
||||
{return str().compare(__s.str());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(const string_type& __s) const
|
||||
{return str().compare(__s);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(const value_type* __s) const
|
||||
{return str().compare(__s);}
|
||||
};
|
||||
@@ -5092,7 +5158,7 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
|
||||
}
|
||||
|
||||
template <class _BidirectionalIterator, class _Allocator>
|
||||
class _LIBCPP_VISIBLE match_results
|
||||
class match_results
|
||||
{
|
||||
public:
|
||||
typedef _Allocator allocator_type;
|
||||
@@ -5119,44 +5185,33 @@ public:
|
||||
explicit match_results(const allocator_type& __a = allocator_type());
|
||||
// match_results(const match_results&) = default;
|
||||
// match_results& operator=(const match_results&) = default;
|
||||
#ifdef _LIBCPP_MOVE
|
||||
// match_results(match_results&& __m) = default;
|
||||
// match_results& operator=(match_results&& __m) = default;
|
||||
#endif // _LIBCPP_MOVE
|
||||
// ~match_results() = default;
|
||||
|
||||
// size:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __matches_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __matches_.max_size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return size() == 0;}
|
||||
|
||||
// element access:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
difference_type length(size_type __sub = 0) const
|
||||
{return (*this)[__sub].length();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
difference_type position(size_type __sub = 0) const
|
||||
{return _STD::distance(__position_start_, (*this)[__sub].first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type str(size_type __sub = 0) const
|
||||
{return (*this)[__sub].str();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference operator[](size_type __n) const
|
||||
{return __n < __matches_.size() ? __matches_[__n] : __unmatched_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference prefix() const {return __prefix_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference suffix() const {return __suffix_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return empty() ? __matches_.end() : __matches_.begin() + 1;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __matches_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return empty() ? __matches_.end() : __matches_.begin() + 1;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __matches_.end();}
|
||||
|
||||
// format:
|
||||
@@ -5166,13 +5221,11 @@ public:
|
||||
const char_type* __fmt_last,
|
||||
regex_constants::match_flag_type __flags = regex_constants::format_default) const;
|
||||
template <class _OutputIter, class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_OutputIter
|
||||
format(_OutputIter __out, const basic_string<char_type, _ST, _SA>& __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::format_default) const
|
||||
{return format(__out, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
|
||||
template <class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string<char_type, _ST, _SA>
|
||||
format(const basic_string<char_type, _ST, _SA>& __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::format_default) const
|
||||
@@ -5182,7 +5235,6 @@ public:
|
||||
__flags);
|
||||
return __r;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type
|
||||
format(const char_type* __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::format_default) const
|
||||
@@ -5194,14 +5246,12 @@ public:
|
||||
}
|
||||
|
||||
// allocator:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __matches_.get_allocator();}
|
||||
|
||||
// swap:
|
||||
void swap(match_results& __m);
|
||||
|
||||
template <class _B, class _A>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __assign(_BidirectionalIterator __f, _BidirectionalIterator __l,
|
||||
const match_results<_B, _A>& __m, bool __no_update_pos)
|
||||
{
|
||||
@@ -5869,7 +5919,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
|
||||
template <class _BidirectionalIterator,
|
||||
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
|
||||
class _Traits = regex_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE regex_iterator
|
||||
class regex_iterator
|
||||
{
|
||||
public:
|
||||
typedef basic_regex<_CharT, _Traits> regex_type;
|
||||
@@ -5893,16 +5943,12 @@ public:
|
||||
regex_constants::match_flag_type __m = regex_constants::match_default);
|
||||
|
||||
bool operator==(const regex_iterator& __x) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const regex_iterator& __x) const {return !(*this == __x);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return __match_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return &__match_;}
|
||||
|
||||
regex_iterator& operator++();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
regex_iterator operator++(int)
|
||||
{
|
||||
regex_iterator __t(*this);
|
||||
@@ -5981,7 +6027,7 @@ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
|
||||
template <class _BidirectionalIterator,
|
||||
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
|
||||
class _Traits = regex_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE regex_token_iterator
|
||||
class regex_token_iterator
|
||||
{
|
||||
public:
|
||||
typedef basic_regex<_CharT, _Traits> regex_type;
|
||||
@@ -6026,16 +6072,12 @@ public:
|
||||
regex_token_iterator& operator=(const regex_token_iterator&);
|
||||
|
||||
bool operator==(const regex_token_iterator& __x) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const regex_token_iterator& __x) const {return !(*this == __x);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type& operator*() const {return *__result_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type* operator->() const {return __result_;}
|
||||
|
||||
regex_token_iterator& operator++();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
regex_token_iterator operator++(int)
|
||||
{
|
||||
regex_token_iterator __t(*this);
|
||||
|
@@ -107,7 +107,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
#if defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
|
||||
// scoped_allocator_adaptor
|
||||
|
||||
@@ -181,14 +181,12 @@ private:
|
||||
|
||||
protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage() {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)),
|
||||
@@ -198,7 +196,6 @@ protected:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, const _OuterA2&>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other)
|
||||
: outer_allocator_type(__other.outer_allocator()),
|
||||
@@ -208,7 +205,6 @@ protected:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other)
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())),
|
||||
@@ -218,28 +214,22 @@ protected:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__o)),
|
||||
__inner_(__i)
|
||||
{
|
||||
}
|
||||
__scoped_allocator_storage(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__o)),
|
||||
__inner_(__i)
|
||||
{
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator() {return __inner_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const {return __inner_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator()
|
||||
{return static_cast<outer_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
{return static_cast<const outer_allocator_type&>(*this);}
|
||||
|
||||
scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
select_on_container_copy_construction() const
|
||||
{
|
||||
return scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
|
||||
@@ -262,14 +252,12 @@ class __scoped_allocator_storage<_OuterAlloc>
|
||||
protected:
|
||||
typedef scoped_allocator_adaptor<_OuterAlloc> inner_allocator_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage() {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)) {}
|
||||
|
||||
@@ -277,7 +265,6 @@ protected:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, const _OuterA2&>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
const __scoped_allocator_storage<_OuterA2>& __other)
|
||||
: outer_allocator_type(__other.outer_allocator()) {}
|
||||
@@ -286,26 +273,20 @@ protected:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2>&& __other)
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator()
|
||||
{return static_cast<inner_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const
|
||||
{return static_cast<const inner_allocator_type&>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator()
|
||||
{return static_cast<outer_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
{return static_cast<const outer_allocator_type&>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor<outer_allocator_type>
|
||||
select_on_container_copy_construction() const
|
||||
{return scoped_allocator_adaptor<outer_allocator_type>(
|
||||
@@ -342,7 +323,6 @@ template <class _Alloc, bool = __has_outer_allocator<_Alloc>::value>
|
||||
struct __outermost
|
||||
{
|
||||
typedef _Alloc type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type& operator()(type& __a) const {return __a;}
|
||||
};
|
||||
|
||||
@@ -354,13 +334,12 @@ struct __outermost<_Alloc, true>
|
||||
decltype(_STD::declval<_Alloc>().outer_allocator())
|
||||
>::type _OuterAlloc;
|
||||
typedef typename __outermost<_OuterAlloc>::type type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type& operator()(_Alloc& __a) const
|
||||
{return __outermost<_OuterAlloc>()(__a.outer_allocator());}
|
||||
};
|
||||
|
||||
template <class _OuterAlloc, class... _InnerAllocs>
|
||||
class _LIBCPP_VISIBLE scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
|
||||
class scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
|
||||
: public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
|
||||
{
|
||||
typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
|
||||
@@ -402,13 +381,11 @@ public:
|
||||
> other;
|
||||
};
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor() {}
|
||||
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)
|
||||
: base(_STD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
|
||||
@@ -417,7 +394,6 @@ public:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, const _OuterA2&>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other)
|
||||
: base(__other) {}
|
||||
@@ -425,52 +401,41 @@ public:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other)
|
||||
: base(_STD::move(__other)) {}
|
||||
|
||||
// ~scoped_allocator_adaptor() = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator()
|
||||
{return base::inner_allocator();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const
|
||||
{return base::inner_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator()
|
||||
{return base::outer_allocator();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
{return base::outer_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n)
|
||||
{return allocator_traits<outer_allocator_type>::
|
||||
allocate(outer_allocator(), __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n, const_void_pointer __hint)
|
||||
{return allocator_traits<outer_allocator_type>::
|
||||
allocate(outer_allocator(), __n, __hint);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void deallocate(pointer __p, size_type __n)
|
||||
{allocator_traits<outer_allocator_type>::
|
||||
deallocate(outer_allocator(), __p, __n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const
|
||||
{return allocator_traits<outer_allocator_type>::max_size(outer_allocator());}
|
||||
{allocator_traits<outer_allocator_type>::max_size(outer_allocator());}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void construct(_Tp* __p, _Args&& ...__args)
|
||||
{__construct(__uses_alloc_ctor<_Tp, inner_allocator_type, _Args...>(),
|
||||
__p, _STD::forward<_Args>(__args)...);}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void destroy(_Tp* __p)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -478,7 +443,6 @@ public:
|
||||
destroy(_OM()(outer_allocator()), __p);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const
|
||||
{return base::select_on_container_copy_construction();}
|
||||
|
||||
@@ -488,13 +452,11 @@ private:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i)
|
||||
: base(_STD::forward<_OuterA2>(__o), __i) {}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct(integral_constant<int, 0>, _Tp* __p, _Args&& ...__args)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -507,7 +469,6 @@ private:
|
||||
}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct(integral_constant<int, 1>, _Tp* __p, _Args&& ...__args)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -522,7 +483,6 @@ private:
|
||||
}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct(integral_constant<int, 2>, _Tp* __p, _Args&& ...__args)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -566,7 +526,7 @@ operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
return !(__a == __b);
|
||||
}
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
#endif // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
188
include/set
188
include/set
@@ -310,7 +310,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Key, class _Compare = less<_Key>,
|
||||
class _Allocator = allocator<_Key> >
|
||||
class _LIBCPP_VISIBLE set
|
||||
class set
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -339,14 +339,11 @@ public:
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit set(const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const value_compare& __comp, const allocator_type& __a)
|
||||
: __tree_(__comp, __a) {}
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(_InputIterator __f, _InputIterator __l,
|
||||
const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
@@ -355,7 +352,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(_InputIterator __f, _InputIterator __l, const value_compare& __comp,
|
||||
const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -363,42 +359,36 @@ public:
|
||||
insert(__f, __l);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const set& __s)
|
||||
: __tree_(__s.__tree_)
|
||||
{
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
set(set&& __s)
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit set(const allocator_type& __a)
|
||||
: __tree_(__a) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const set& __s, const allocator_type& __a)
|
||||
: __tree_(__s.__tree_.value_comp(), __a)
|
||||
{
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
set(set&& __s, const allocator_type& __a);
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
{
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(initializer_list<value_type> __il, const value_compare& __comp,
|
||||
const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -406,145 +396,103 @@ public:
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set& operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
__tree_.__assign_unique(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
set& operator=(set&& __s)
|
||||
{
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
|
||||
_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
|
||||
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
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
|
||||
// modifiers:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_Args&&... __args)
|
||||
{return __tree_.__emplace_unique(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __tree_.__emplace_hint_unique(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
pair<iterator,bool> insert(const value_type& __v)
|
||||
{return __tree_.__insert_unique(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
pair<iterator,bool> insert(value_type&& __v)
|
||||
{return __tree_.__insert_unique(_STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, const value_type& __v)
|
||||
{return __tree_.__insert_unique(__p, __v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, value_type&& __v)
|
||||
{return __tree_.__insert_unique(__p, _STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(_InputIterator __f, _InputIterator __l)
|
||||
{
|
||||
for (const_iterator __e = cend(); __f != __l; ++__f)
|
||||
__tree_.__insert_unique(__e, *__f);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k)
|
||||
{return __tree_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f, __l);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(set& __s) {__tree_.swap(__s.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_compare key_comp() const {return __tree_.value_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare value_comp() const {return __tree_.value_comp();}
|
||||
|
||||
// set operations:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const key_type& __k)
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator lower_bound(const key_type& __k) const
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator upper_bound(const key_type& __k)
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator upper_bound(const key_type& __k) const
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator,iterator> equal_range(const key_type& __k)
|
||||
{return __tree_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
|
||||
{return __tree_.__equal_range_unique(__k);}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
|
||||
@@ -558,10 +506,10 @@ set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -570,7 +518,7 @@ operator==(const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -579,7 +527,7 @@ operator< (const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -588,7 +536,7 @@ operator!=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -597,7 +545,7 @@ operator> (const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -606,7 +554,7 @@ operator>=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -616,7 +564,7 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
|
||||
// specialized algorithms:
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(set<_Key, _Compare, _Allocator>& __x,
|
||||
set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -626,7 +574,7 @@ swap(set<_Key, _Compare, _Allocator>& __x,
|
||||
|
||||
template <class _Key, class _Compare = less<_Key>,
|
||||
class _Allocator = allocator<_Key> >
|
||||
class _LIBCPP_VISIBLE multiset
|
||||
class multiset
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -656,14 +604,11 @@ public:
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multiset(const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const value_compare& __comp, const allocator_type& __a)
|
||||
: __tree_(__comp, __a) {}
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(_InputIterator __f, _InputIterator __l,
|
||||
const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
@@ -672,7 +617,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(_InputIterator __f, _InputIterator __l,
|
||||
const value_compare& __comp, const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -680,7 +624,6 @@ public:
|
||||
insert(__f, __l);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const multiset& __s)
|
||||
: __tree_(__s.__tree_.value_comp(),
|
||||
__alloc_traits::select_on_container_copy_construction(__s.__tree_.__alloc()))
|
||||
@@ -688,32 +631,27 @@ public:
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
multiset(multiset&& __s)
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
explicit multiset(const allocator_type& __a)
|
||||
: __tree_(__a) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const multiset& __s, const allocator_type& __a)
|
||||
: __tree_(__s.__tree_.value_comp(), __a)
|
||||
{
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
multiset(multiset&& __s, const allocator_type& __a);
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
{
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(initializer_list<value_type> __il, const value_compare& __comp,
|
||||
const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -721,144 +659,102 @@ public:
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset& operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
__tree_.__assign_multi(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
multiset& operator=(multiset&& __s)
|
||||
{
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
|
||||
_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
|
||||
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
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
|
||||
// modifiers:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_Args&&... __args)
|
||||
{return __tree_.__emplace_multi(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __tree_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const value_type& __v)
|
||||
{return __tree_.__insert_multi(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(value_type&& __v)
|
||||
{return __tree_.__insert_multi(_STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, const value_type& __v)
|
||||
{return __tree_.__insert_multi(__p, __v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, value_type&& __v)
|
||||
{return __tree_.__insert_multi(_STD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(_InputIterator __f, _InputIterator __l)
|
||||
{
|
||||
for (const_iterator __e = cend(); __f != __l; ++__f)
|
||||
__tree_.__insert_multi(__e, *__f);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __tree_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f, __l);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(multiset& __s) {__tree_.swap(__s.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_compare key_comp() const {return __tree_.value_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare value_comp() const {return __tree_.value_comp();}
|
||||
|
||||
// set operations:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const key_type& __k)
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator lower_bound(const key_type& __k) const
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator upper_bound(const key_type& __k)
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator upper_bound(const key_type& __k) const
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator,iterator> equal_range(const key_type& __k)
|
||||
{return __tree_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
|
||||
{return __tree_.__equal_range_multi(__k);}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
|
||||
@@ -872,10 +768,10 @@ multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_t
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -884,7 +780,7 @@ operator==(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -893,7 +789,7 @@ operator< (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -902,7 +798,7 @@ operator!=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -911,7 +807,7 @@ operator> (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -920,7 +816,7 @@ operator>=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -929,7 +825,7 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(multiset<_Key, _Compare, _Allocator>& __x,
|
||||
multiset<_Key, _Compare, _Allocator>& __y)
|
||||
|
@@ -182,7 +182,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
// basic_stringbuf
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_stringbuf
|
||||
class basic_stringbuf
|
||||
: public basic_streambuf<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -206,12 +206,12 @@ public:
|
||||
explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
explicit basic_stringbuf(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_stringbuf(basic_stringbuf&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.8.1.2 Assign and swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_stringbuf& operator=(basic_stringbuf&& __rhs);
|
||||
#endif
|
||||
void swap(basic_stringbuf& __rhs);
|
||||
@@ -250,7 +250,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type&
|
||||
str(__s);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
|
||||
@@ -298,7 +298,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
void
|
||||
@@ -525,7 +525,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
|
||||
// basic_istringstream
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_istringstream
|
||||
class basic_istringstream
|
||||
: public basic_istream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -546,12 +546,12 @@ public:
|
||||
explicit basic_istringstream(ios_base::openmode __wch = ios_base::in);
|
||||
explicit basic_istringstream(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::in);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_istringstream(basic_istringstream&& __rhs);
|
||||
|
||||
// 27.8.2.2 Assign and swap:
|
||||
basic_istringstream& operator=(basic_istringstream&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(basic_istringstream& __rhs);
|
||||
|
||||
// 27.8.2.3 Members:
|
||||
@@ -577,7 +577,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const stri
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -597,7 +597,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -644,7 +644,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
||||
// basic_ostringstream
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_ostringstream
|
||||
class basic_ostringstream
|
||||
: public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -665,12 +665,12 @@ public:
|
||||
explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
|
||||
explicit basic_ostringstream(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ostringstream(basic_ostringstream&& __rhs);
|
||||
|
||||
// 27.8.2.2 Assign and swap:
|
||||
basic_ostringstream& operator=(basic_ostringstream&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(basic_ostringstream& __rhs);
|
||||
|
||||
// 27.8.2.3 Members:
|
||||
@@ -696,7 +696,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const stri
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -716,7 +716,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -763,7 +763,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
||||
// basic_stringstream
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_stringstream
|
||||
class basic_stringstream
|
||||
: public basic_iostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -784,12 +784,12 @@ public:
|
||||
explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
explicit basic_stringstream(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_stringstream(basic_stringstream&& __rhs);
|
||||
|
||||
// 27.8.2.2 Assign and swap:
|
||||
basic_stringstream& operator=(basic_stringstream&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(basic_stringstream& __rhs);
|
||||
|
||||
// 27.8.2.3 Members:
|
||||
@@ -815,7 +815,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -835,7 +835,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&&
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
|
@@ -92,7 +92,7 @@ bool
|
||||
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
||||
|
||||
template <class _Tp, class _Container = deque<_Tp> >
|
||||
class _LIBCPP_VISIBLE stack
|
||||
class stack
|
||||
{
|
||||
public:
|
||||
typedef _Container container_type;
|
||||
@@ -105,76 +105,54 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack() : c() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit stack(const container_type& __c) : c(__c) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
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
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit stack(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(const container_type& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__c, __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(const stack& __s, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__s.c, __a) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(container_type&& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_STD::move(__c), __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __s, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_STD::move(__s.c), __a) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference top() {return c.back();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference top() const {return c.back();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(const value_type& __v) {c.push_back(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push(value_type&& __v) {c.push_back(_STD::move(__v));}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void emplace(_Args&&... __args)
|
||||
template <class... _Args> void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop() {c.pop_back();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(stack& __s)
|
||||
{
|
||||
using _STD::swap;
|
||||
@@ -193,7 +171,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -201,7 +179,7 @@ operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -209,7 +187,7 @@ operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -217,7 +195,7 @@ operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -225,7 +203,7 @@ operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -233,7 +211,7 @@ operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -241,7 +219,7 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -249,7 +227,7 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<stack<_Tp, _Container>, _Alloc>
|
||||
struct uses_allocator<stack<_Tp, _Container>, _Alloc>
|
||||
: public uses_allocator<_Container, _Alloc>
|
||||
{
|
||||
};
|
||||
|
@@ -117,7 +117,7 @@ protected:
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_streambuf
|
||||
class basic_streambuf
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
|
@@ -442,7 +442,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
// fpos
|
||||
|
||||
template <class _StateT>
|
||||
class _LIBCPP_VISIBLE fpos
|
||||
class fpos
|
||||
{
|
||||
private:
|
||||
_StateT __st_;
|
||||
@@ -479,7 +479,7 @@ bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)
|
||||
// char_traits
|
||||
|
||||
template <class _CharT>
|
||||
struct _LIBCPP_VISIBLE char_traits
|
||||
struct char_traits
|
||||
{
|
||||
typedef _CharT char_type;
|
||||
typedef int int_type;
|
||||
@@ -591,7 +591,7 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
|
||||
// char_traits<char>
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE char_traits<char>
|
||||
struct char_traits<char>
|
||||
{
|
||||
typedef char char_type;
|
||||
typedef int int_type;
|
||||
@@ -628,7 +628,7 @@ struct _LIBCPP_VISIBLE char_traits<char>
|
||||
// char_traits<wchar_t>
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE char_traits<wchar_t>
|
||||
struct char_traits<wchar_t>
|
||||
{
|
||||
typedef wchar_t char_type;
|
||||
typedef wint_t int_type;
|
||||
@@ -665,7 +665,7 @@ struct _LIBCPP_VISIBLE char_traits<wchar_t>
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE char_traits<char16_t>
|
||||
struct char_traits<char16_t>
|
||||
{
|
||||
typedef char16_t char_type;
|
||||
typedef uint_least16_t int_type;
|
||||
@@ -771,7 +771,7 @@ char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
|
||||
}
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE char_traits<char32_t>
|
||||
struct char_traits<char32_t>
|
||||
{
|
||||
typedef char32_t char_type;
|
||||
typedef uint_least32_t int_type;
|
||||
@@ -933,7 +933,7 @@ __basic_string_common<__b>::__throw_out_of_range() const
|
||||
extern template class __basic_string_common<true>;
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_string
|
||||
class basic_string
|
||||
: private __basic_string_common<true>
|
||||
{
|
||||
public:
|
||||
@@ -1031,10 +1031,10 @@ public:
|
||||
explicit basic_string(const allocator_type& __a);
|
||||
basic_string(const basic_string& __str);
|
||||
basic_string(const basic_string& __str, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_string(basic_string&& __str);
|
||||
basic_string(basic_string&& __str, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
basic_string(const_pointer __s);
|
||||
basic_string(const_pointer __s, const allocator_type& __a);
|
||||
basic_string(const_pointer __s, size_type __n);
|
||||
@@ -1053,12 +1053,11 @@ public:
|
||||
~basic_string();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const basic_string& __str) {return assign(__str);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(basic_string&& __str) {swap(__str); return *this;}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const_pointer __s) {return assign(__s);}
|
||||
basic_string& operator=(value_type __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
|
||||
|
||||
#ifndef _LIBCPP_DEBUG
|
||||
@@ -1093,7 +1092,6 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
|
||||
|
||||
void reserve(size_type res_arg = 0);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void shrink_to_fit() {reserve();}
|
||||
void clear();
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return size() == 0;}
|
||||
@@ -1129,7 +1127,6 @@ public:
|
||||
basic_string&
|
||||
>::type
|
||||
append(_ForwardIterator __first, _ForwardIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
|
||||
|
||||
void push_back(value_type __c);
|
||||
@@ -1159,7 +1156,6 @@ public:
|
||||
basic_string&
|
||||
>::type
|
||||
assign(_ForwardIterator __first, _ForwardIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
|
||||
|
||||
basic_string& insert(size_type __pos1, const basic_string& __str);
|
||||
@@ -1184,7 +1180,6 @@ public:
|
||||
iterator
|
||||
>::type
|
||||
insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __pos, initializer_list<value_type> __il)
|
||||
{return insert(__pos, __il.begin(), __il.end());}
|
||||
|
||||
@@ -1208,7 +1203,6 @@ public:
|
||||
basic_string&
|
||||
>::type
|
||||
replace(iterator __i1, iterator __i2, _InputIterator __j1, _InputIterator __j2);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(iterator __i1, iterator __i2, initializer_list<value_type> __il)
|
||||
{return replace(__i1, __i2, __il.begin(), __il.end());}
|
||||
|
||||
@@ -1527,7 +1521,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
|
||||
__init(__str.__get_long_pointer(), __str.__get_long_size());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -1551,7 +1545,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
void
|
||||
@@ -3429,7 +3423,7 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs)
|
||||
return __r;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -3489,7 +3483,7 @@ operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs)
|
||||
return _STD::move(__lhs);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
// swap
|
||||
|
||||
@@ -3557,7 +3551,7 @@ template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_string<_CharT, _Traits, _Allocator>::npos;
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
struct _LIBCPP_VISIBLE hash<basic_string<_CharT, _Traits, _Allocator> >
|
||||
struct hash<basic_string<_CharT, _Traits, _Allocator> >
|
||||
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
|
||||
{
|
||||
size_t
|
||||
|
@@ -135,7 +135,7 @@ private:
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE strstreambuf
|
||||
class strstreambuf
|
||||
: public streambuf
|
||||
{
|
||||
public:
|
||||
@@ -149,10 +149,10 @@ public:
|
||||
strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0);
|
||||
strstreambuf(const unsigned char* __gnext, streamsize __n);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
strstreambuf(strstreambuf&& __rhs);
|
||||
strstreambuf& operator=(strstreambuf&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~strstreambuf();
|
||||
|
||||
@@ -187,25 +187,20 @@ private:
|
||||
void __init(char* __gnext, streamsize __n, char* __pbeg);
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE istrstream
|
||||
class istrstream
|
||||
: public istream
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit istrstream(const char* __s)
|
||||
: istream(&__sb_), __sb_(__s, 0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit istrstream(char* __s)
|
||||
: istream(&__sb_), __sb_(__s, 0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream(const char* __s, streamsize __n)
|
||||
: istream(&__sb_), __sb_(__s, __n) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream(char* __s, streamsize __n)
|
||||
: istream(&__sb_), __sb_(__s, __n) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
istrstream(istrstream&& __rhs)
|
||||
: istream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
@@ -213,48 +208,41 @@ public:
|
||||
istream::set_rdbuf(&__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream& operator=(istrstream&& __rhs)
|
||||
{
|
||||
istream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~istrstream();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(istrstream& __rhs)
|
||||
{
|
||||
istream::swap(__rhs);
|
||||
__sb_.swap(__rhs.__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char *str() {return __sb_.str();}
|
||||
|
||||
private:
|
||||
strstreambuf __sb_;
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE ostrstream
|
||||
class ostrstream
|
||||
: public ostream
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream()
|
||||
: ostream(&__sb_) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
|
||||
: ostream(&__sb_),
|
||||
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
ostrstream(ostrstream&& __rhs)
|
||||
: ostream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
@@ -262,38 +250,32 @@ public:
|
||||
ostream::set_rdbuf(&__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream& operator=(ostrstream&& __rhs)
|
||||
{
|
||||
ostream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~ostrstream();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(ostrstream& __rhs)
|
||||
{
|
||||
ostream::swap(__rhs);
|
||||
__sb_.swap(__rhs.__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char* str() {return __sb_.str();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int pcount() const {return __sb_.pcount();}
|
||||
|
||||
private:
|
||||
strstreambuf __sb_; // exposition only
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE strstream
|
||||
class strstream
|
||||
: public iostream
|
||||
{
|
||||
public:
|
||||
@@ -304,17 +286,14 @@ public:
|
||||
typedef char_traits<char>::off_type off_type;
|
||||
|
||||
// constructors/destructor
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream()
|
||||
: iostream(&__sb_) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
: iostream(&__sb_),
|
||||
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
strstream(strstream&& __rhs)
|
||||
: iostream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
@@ -322,18 +301,16 @@ public:
|
||||
iostream::set_rdbuf(&__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream& operator=(strstream&& __rhs)
|
||||
{
|
||||
iostream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~strstream();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(strstream& __rhs)
|
||||
{
|
||||
iostream::swap(__rhs);
|
||||
@@ -341,13 +318,9 @@ public:
|
||||
}
|
||||
|
||||
// Members:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int pcount() const {return __sb_.pcount();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char* str() {return __sb_.str();}
|
||||
|
||||
private:
|
||||
|
@@ -229,14 +229,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// is_error_code_enum
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE is_error_code_enum
|
||||
template <class _Tp> struct is_error_code_enum
|
||||
: public false_type {};
|
||||
|
||||
// is_error_condition_enum
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE is_error_condition_enum
|
||||
template <class _Tp> struct is_error_condition_enum
|
||||
: public false_type {};
|
||||
|
||||
// Some error codes are not present on all platforms, so we provide equivalents
|
||||
@@ -344,19 +342,15 @@ enum _ {
|
||||
|
||||
_ __v_;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
errc(_ __v) : __v_(__v) {}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
operator int() const {return __v_;}
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_condition_enum<errc>
|
||||
template <> struct is_error_condition_enum<errc>
|
||||
: true_type { };
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_condition_enum<errc::_>
|
||||
template <> struct is_error_condition_enum<errc::_>
|
||||
: true_type { };
|
||||
|
||||
class error_condition;
|
||||
@@ -366,7 +360,7 @@ class error_code;
|
||||
|
||||
class __do_message;
|
||||
|
||||
class _LIBCPP_VISIBLE error_category
|
||||
class error_category
|
||||
{
|
||||
public:
|
||||
virtual ~error_category();
|
||||
@@ -405,7 +399,7 @@ public:
|
||||
const error_category& generic_category();
|
||||
const error_category& system_category();
|
||||
|
||||
class _LIBCPP_VISIBLE error_condition
|
||||
class error_condition
|
||||
{
|
||||
int __val_;
|
||||
const error_category* __cat_;
|
||||
@@ -475,7 +469,7 @@ operator<(const error_condition& __x, const error_condition& __y)
|
||||
|
||||
// error_code
|
||||
|
||||
class _LIBCPP_VISIBLE error_code
|
||||
class error_code
|
||||
{
|
||||
int __val_;
|
||||
const error_category* __cat_;
|
||||
@@ -594,10 +588,9 @@ bool
|
||||
operator!=(const error_condition& __x, const error_condition& __y) {return !(__x == __y);}
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<error_code>
|
||||
struct hash<error_code>
|
||||
: public unary_function<error_code, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const error_code& __ec) const
|
||||
{
|
||||
return static_cast<size_t>(__ec.value());
|
||||
@@ -606,7 +599,7 @@ struct _LIBCPP_VISIBLE hash<error_code>
|
||||
|
||||
// system_error
|
||||
|
||||
class _LIBCPP_VISIBLE system_error
|
||||
class system_error
|
||||
: public runtime_error
|
||||
{
|
||||
error_code __ec_;
|
||||
|
140
include/thread
140
include/thread
@@ -103,71 +103,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp>
|
||||
class __thread_specific_ptr
|
||||
{
|
||||
pthread_key_t __key_;
|
||||
|
||||
__thread_specific_ptr(const __thread_specific_ptr&);
|
||||
__thread_specific_ptr& operator=(const __thread_specific_ptr&);
|
||||
|
||||
static void __at_thread_exit(void*);
|
||||
public:
|
||||
typedef _Tp* pointer;
|
||||
|
||||
__thread_specific_ptr();
|
||||
~__thread_specific_ptr();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer get() const {return static_cast<_Tp*>(pthread_getspecific(__key_));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator*() const {return *get();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return get();}
|
||||
pointer release();
|
||||
void reset(pointer __p = nullptr);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
void
|
||||
__thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
|
||||
{
|
||||
delete static_cast<pointer>(__p);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
|
||||
{
|
||||
int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
|
||||
if (__ec)
|
||||
throw system_error(error_code(__ec, system_category()),
|
||||
"__thread_specific_ptr construction failed");
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
__thread_specific_ptr<_Tp>::~__thread_specific_ptr()
|
||||
{
|
||||
pthread_key_delete(__key_);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
typename __thread_specific_ptr<_Tp>::pointer
|
||||
__thread_specific_ptr<_Tp>::release()
|
||||
{
|
||||
pointer __p = get();
|
||||
pthread_setspecific(__key_, 0);
|
||||
return __p;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
void
|
||||
__thread_specific_ptr<_Tp>::reset(pointer __p)
|
||||
{
|
||||
pointer __p_old = get();
|
||||
pthread_setspecific(__key_, __p);
|
||||
delete __p_old;
|
||||
}
|
||||
|
||||
class thread;
|
||||
class __thread_id;
|
||||
|
||||
@@ -178,7 +113,7 @@ __thread_id get_id();
|
||||
|
||||
} // this_thread
|
||||
|
||||
class _LIBCPP_VISIBLE __thread_id
|
||||
class __thread_id
|
||||
{
|
||||
// FIXME: pthread_t is a pointer on Darwin but a long on Linux.
|
||||
// NULL is the no-thread value on Darwin. Someone needs to check
|
||||
@@ -186,50 +121,40 @@ class _LIBCPP_VISIBLE __thread_id
|
||||
pthread_t __id_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__thread_id() : __id_(0) {}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(__thread_id __x, __thread_id __y)
|
||||
friend bool operator==(__thread_id __x, __thread_id __y)
|
||||
{return __x.__id_ == __y.__id_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(__thread_id __x, __thread_id __y)
|
||||
friend bool operator!=(__thread_id __x, __thread_id __y)
|
||||
{return !(__x == __y);}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator< (__thread_id __x, __thread_id __y)
|
||||
friend bool operator< (__thread_id __x, __thread_id __y)
|
||||
{return __x.__id_ < __y.__id_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator<=(__thread_id __x, __thread_id __y)
|
||||
friend bool operator<=(__thread_id __x, __thread_id __y)
|
||||
{return !(__y < __x);}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator> (__thread_id __x, __thread_id __y)
|
||||
friend bool operator> (__thread_id __x, __thread_id __y)
|
||||
{return __y < __x ;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator>=(__thread_id __x, __thread_id __y)
|
||||
friend bool operator>=(__thread_id __x, __thread_id __y)
|
||||
{return !(__x < __y);}
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id)
|
||||
{return __os << __id.__id_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__thread_id(pthread_t __id) : __id_(__id) {}
|
||||
|
||||
friend __thread_id this_thread::get_id();
|
||||
friend class _LIBCPP_VISIBLE thread;
|
||||
friend class thread;
|
||||
};
|
||||
|
||||
template<class _Tp> struct hash;
|
||||
|
||||
template<>
|
||||
struct _LIBCPP_VISIBLE hash<__thread_id>
|
||||
struct hash<__thread_id>
|
||||
: public unary_function<__thread_id, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(__thread_id __v) const
|
||||
{
|
||||
const size_t* const __p = reinterpret_cast<const size_t*>(&__v);
|
||||
@@ -240,7 +165,7 @@ struct _LIBCPP_VISIBLE hash<__thread_id>
|
||||
namespace this_thread
|
||||
{
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__thread_id
|
||||
get_id()
|
||||
{
|
||||
@@ -249,7 +174,7 @@ get_id()
|
||||
|
||||
} // this_thread
|
||||
|
||||
class _LIBCPP_VISIBLE thread
|
||||
class thread
|
||||
{
|
||||
pthread_t __t_;
|
||||
|
||||
@@ -264,7 +189,6 @@ public:
|
||||
typedef __thread_id id;
|
||||
typedef pthread_t native_handle_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
thread() : __t_(0) {}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _F, class ..._Args,
|
||||
@@ -279,52 +203,26 @@ public:
|
||||
#endif
|
||||
~thread();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
thread(thread&& __t) : __t_(__t.__t_) {__t.__t_ = 0;}
|
||||
thread& operator=(thread&& __t);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(thread& __t) {_STD::swap(__t_, __t.__t_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool joinable() const {return __t_ != 0;}
|
||||
void join();
|
||||
void detach();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
id get_id() const {return __t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
native_handle_type native_handle() {return __t_;}
|
||||
|
||||
static unsigned hardware_concurrency();
|
||||
};
|
||||
|
||||
class __assoc_sub_state;
|
||||
|
||||
class __thread_struct_imp;
|
||||
|
||||
class __thread_struct
|
||||
{
|
||||
__thread_struct_imp* __p_;
|
||||
|
||||
__thread_struct(const __thread_struct&);
|
||||
__thread_struct& operator=(const __thread_struct&);
|
||||
public:
|
||||
__thread_struct();
|
||||
~__thread_struct();
|
||||
|
||||
void notify_all_at_thread_exit(condition_variable*, mutex*);
|
||||
void __make_ready_at_thread_exit(__assoc_sub_state*);
|
||||
};
|
||||
|
||||
__thread_specific_ptr<__thread_struct>& __thread_local_data();
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
{
|
||||
__thread_local_data().reset(new __thread_struct);
|
||||
std::unique_ptr<_F> __p(static_cast<_F*>(__vp));
|
||||
(*__p)();
|
||||
return nullptr;
|
||||
@@ -362,9 +260,9 @@ thread::thread(_F __f)
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
thread&
|
||||
thread::operator=(thread&& __t)
|
||||
{
|
||||
@@ -375,9 +273,9 @@ thread::operator=(thread&& __t)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void swap(thread& __x, thread& __y) {__x.swap(__y);}
|
||||
|
||||
namespace this_thread
|
||||
@@ -409,7 +307,7 @@ sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
|
||||
}
|
||||
|
||||
template <class _Duration>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t)
|
||||
{
|
||||
@@ -417,7 +315,7 @@ sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t)
|
||||
sleep_for(__t - monotonic_clock::now());
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void yield() {sched_yield();}
|
||||
|
||||
} // this_thread
|
||||
|
101
include/tuple
101
include/tuple
@@ -122,13 +122,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
// tuple_size
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...>>
|
||||
class tuple_size<tuple<_Tp...>>
|
||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||
{
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<const tuple<_Tp...>>
|
||||
class tuple_size<const tuple<_Tp...>>
|
||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||
{
|
||||
};
|
||||
@@ -136,14 +136,14 @@ class _LIBCPP_VISIBLE tuple_size<const tuple<_Tp...>>
|
||||
// tuple_element
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, tuple<_Tp...>>
|
||||
class tuple_element<_Ip, tuple<_Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef typename tuple_element<_Ip, __tuple_types<_Tp...>>::type type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const tuple<_Tp...>>
|
||||
class tuple_element<_Ip, const tuple<_Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef const typename tuple_element<_Ip, __tuple_types<_Tp...>>::type type;
|
||||
@@ -155,7 +155,7 @@ template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value>
|
||||
class __tuple_leaf;
|
||||
|
||||
template <size_t _Ip, class _Hp, bool _Ep>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y)
|
||||
{
|
||||
swap(__x.get(), __y.get());
|
||||
@@ -193,21 +193,18 @@ public:
|
||||
{static_assert(!is_reference<_Hp>::value,
|
||||
"Attempted to default construct a reference element in a tuple");}
|
||||
|
||||
template <class _Tp,
|
||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(_Tp&& __t)
|
||||
: value(_STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_reference<_Hp>::value ||
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
is_same<typename remove_reference<_Tp>::type,
|
||||
reference_wrapper<
|
||||
typename remove_reference<_Hp>::type
|
||||
>
|
||||
>::value) ||
|
||||
(is_rvalue_reference<_Hp>::value &&
|
||||
!is_lvalue_reference<_Tp>::value),
|
||||
>::value),
|
||||
"Attempted to construct a reference element in a tuple with an rvalue");}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
@@ -252,10 +249,6 @@ public:
|
||||
>::value),
|
||||
"Attempted to construct a reference element in a tuple with an rvalue");}
|
||||
|
||||
__tuple_leaf(const __tuple_leaf& __t)
|
||||
: value(__t.get())
|
||||
{static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
|
||||
@@ -304,8 +297,7 @@ public:
|
||||
__tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
|
||||
: _Hp(__a) {}
|
||||
|
||||
template <class _Tp,
|
||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(_Tp&& __t)
|
||||
: _Hp(_STD::forward<_Tp>(__t)) {}
|
||||
@@ -349,9 +341,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const {return static_cast<const _Hp&>(*this);}
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __swallow(_Tp&&...) {}
|
||||
template <class ..._Tp> void __swallow(_Tp&&...) {}
|
||||
|
||||
// __tuple_impl
|
||||
|
||||
@@ -363,7 +353,6 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
{
|
||||
template <size_t ..._Uf, class ..._Tf,
|
||||
size_t ..._Ul, class ..._Tl, class ..._Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit
|
||||
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
||||
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
||||
@@ -374,7 +363,6 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
|
||||
template <class _Alloc, size_t ..._Uf, class ..._Tf,
|
||||
size_t ..._Ul, class ..._Tl, class ..._Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit
|
||||
__tuple_impl(allocator_arg_t, const _Alloc& __a,
|
||||
__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
||||
@@ -391,7 +379,6 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
__tuple_convertible<_Tuple, tuple<_Tp...>>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tuple_impl(_Tuple&& __t)
|
||||
: __tuple_leaf<_Indx, _Tp>(_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
|
||||
@@ -403,7 +390,6 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
__tuple_convertible<_Tuple, tuple<_Tp...>>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
|
||||
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(), __a,
|
||||
@@ -412,7 +398,6 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
{}
|
||||
|
||||
template <class _Tuple>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__tuple_assignable<_Tuple, tuple<_Tp...>>::value,
|
||||
@@ -425,7 +410,6 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(__tuple_impl& __t)
|
||||
{
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
|
||||
@@ -433,7 +417,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple
|
||||
class tuple
|
||||
{
|
||||
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
|
||||
|
||||
@@ -445,7 +429,6 @@ class _LIBCPP_VISIBLE tuple
|
||||
const typename tuple_element<_Jp, tuple<_Up...>>::type& get(const tuple<_Up...>&);
|
||||
public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit tuple(const _Tp& ... __t)
|
||||
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
|
||||
@@ -455,7 +438,6 @@ public:
|
||||
) {}
|
||||
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
|
||||
: base_(allocator_arg_t(), __a,
|
||||
typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
@@ -479,7 +461,6 @@ public:
|
||||
>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit
|
||||
tuple(_Up&&... __u)
|
||||
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
||||
@@ -502,7 +483,6 @@ public:
|
||||
>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
|
||||
: base_(allocator_arg_t(), __a,
|
||||
typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
||||
@@ -517,7 +497,6 @@ public:
|
||||
__tuple_convertible<_Tuple, tuple>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(_Tuple&& __t)
|
||||
: base_(_STD::forward<_Tuple>(__t)) {}
|
||||
|
||||
@@ -527,7 +506,6 @@ public:
|
||||
__tuple_convertible<_Tuple, tuple>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
|
||||
: base_(allocator_arg_t(), __a, _STD::forward<_Tuple>(__t)) {}
|
||||
|
||||
@@ -537,7 +515,6 @@ public:
|
||||
__tuple_assignable<_Tuple, tuple>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple&
|
||||
operator=(_Tuple&& __t)
|
||||
{
|
||||
@@ -545,29 +522,22 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(tuple& __t) {base_.swap(__t.base_);}
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE tuple<>
|
||||
class tuple<>
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple() {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&, const tuple&) {}
|
||||
template <class _U>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(array<_U, 0>) {}
|
||||
template <class _Alloc, class _U>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&, array<_U, 0>) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(tuple&) {}
|
||||
};
|
||||
|
||||
@@ -579,7 +549,7 @@ swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u) {__t.swap(__u);}
|
||||
// get
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
get(tuple<_Tp...>& __t)
|
||||
{
|
||||
@@ -588,7 +558,7 @@ get(tuple<_Tp...>& __t)
|
||||
}
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
const typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
get(const tuple<_Tp...>& __t)
|
||||
{
|
||||
@@ -599,7 +569,7 @@ get(const tuple<_Tp...>& __t)
|
||||
// tie
|
||||
|
||||
template <class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp&...>
|
||||
tie(_Tp&... __t)
|
||||
{
|
||||
@@ -609,13 +579,10 @@ tie(_Tp&... __t)
|
||||
template <class _Up>
|
||||
struct __ignore_t
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__ignore_t() {}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__ignore_t(_Tp&&) {}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __ignore_t& operator=(_Tp&&) const {return *this;}
|
||||
};
|
||||
|
||||
@@ -642,7 +609,7 @@ struct __make_tuple_return
|
||||
};
|
||||
|
||||
template <class... _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<typename __make_tuple_return<_Tp>::type...>
|
||||
make_tuple(_Tp&&... __t)
|
||||
{
|
||||
@@ -650,7 +617,7 @@ make_tuple(_Tp&&... __t)
|
||||
}
|
||||
|
||||
template <class... _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp&&...>
|
||||
forward_as_tuple(_Tp&&... __t)
|
||||
{
|
||||
@@ -661,7 +628,6 @@ template <size_t _I>
|
||||
struct __tuple_equal
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Up& __y)
|
||||
{
|
||||
return __tuple_equal<_I - 1>()(__x, __y) && get<_I-1>(__x) == get<_I-1>(__y);
|
||||
@@ -672,7 +638,6 @@ template <>
|
||||
struct __tuple_equal<0>
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp&, const _Up&)
|
||||
{
|
||||
return true;
|
||||
@@ -680,7 +645,7 @@ struct __tuple_equal<0>
|
||||
};
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -688,7 +653,7 @@ operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -699,7 +664,6 @@ template <size_t _I>
|
||||
struct __tuple_less
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Up& __y)
|
||||
{
|
||||
return __tuple_less<_I-1>()(__x, __y) ||
|
||||
@@ -711,7 +675,6 @@ template <>
|
||||
struct __tuple_less<0>
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp&, const _Up&)
|
||||
{
|
||||
return false;
|
||||
@@ -719,7 +682,7 @@ struct __tuple_less<0>
|
||||
};
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -727,7 +690,7 @@ operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -735,7 +698,7 @@ operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -743,7 +706,7 @@ operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -753,7 +716,7 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
// tuple_cat
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
@@ -761,7 +724,7 @@ __tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, const tuple<_Up..
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -770,7 +733,7 @@ tuple_cat(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
@@ -778,7 +741,7 @@ __tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, const tuple<_Up...>& _
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(tuple<_Tp...>&& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -787,7 +750,7 @@ tuple_cat(tuple<_Tp...>&& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
@@ -795,7 +758,7 @@ __tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, tuple<_Up...>&& _
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(const tuple<_Tp...>& __x, tuple<_Up...>&& __y)
|
||||
{
|
||||
@@ -804,7 +767,7 @@ tuple_cat(const tuple<_Tp...>& __x, tuple<_Up...>&& __y)
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
@@ -812,7 +775,7 @@ __tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, _
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(tuple<_Tp...>&& __x, tuple<_Up...>&& __y)
|
||||
{
|
||||
@@ -821,7 +784,7 @@ tuple_cat(tuple<_Tp...>&& __x, tuple<_Up...>&& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<tuple<_Tp...>, _Alloc>
|
||||
struct uses_allocator<tuple<_Tp...>, _Alloc>
|
||||
: true_type {};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -53,39 +53,29 @@ struct hash<type_index>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE type_index
|
||||
class type_index
|
||||
{
|
||||
const type_info* __t_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type_index(const type_info& __y) : __t_(&__y) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_index& __y) const {return *__t_ == *__y.__t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_index& __y) const {return *__t_ != *__y.__t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator< (const type_index& __y) const {return __t_->before(*__y.__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator<=(const type_index& __y) const {return !__y.__t_->before(*__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator> (const type_index& __y) const {return __y.__t_->before(*__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator>=(const type_index& __y) const {return !__t_->before(*__y.__t_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t hash_code() const {return __t_->hash_code();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const {return __t_->name();}
|
||||
};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
||||
template <class _Tp> struct hash;
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<type_index>
|
||||
struct hash<type_index>
|
||||
: public unary_function<type_index, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(type_index __index) const {return __index.hash_code();}
|
||||
};
|
||||
|
||||
|
@@ -73,27 +73,21 @@ class _LIBCPP_EXCEPTION_ABI type_info
|
||||
protected:
|
||||
const char* __type_name;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit type_info(const char* __n)
|
||||
: __type_name(__n) {}
|
||||
|
||||
public:
|
||||
virtual ~type_info();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const {return __type_name;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool before(const type_info& __arg) const
|
||||
{return __type_name < __arg.__type_name;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t hash_code() const throw()
|
||||
{return *reinterpret_cast<const size_t*>(&__type_name);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_info& __arg) const
|
||||
{return __type_name == __arg.__type_name;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_info& __arg) const
|
||||
{return !operator==(__arg);}
|
||||
|
||||
|
@@ -288,16 +288,11 @@ class __unordered_map_hasher
|
||||
: private _Hash
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher() : _Hash() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher(const _Hash& __h) : _Hash(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Hash& hash_function() const {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const typename _Tp::first_type& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x);}
|
||||
};
|
||||
@@ -307,16 +302,11 @@ class __unordered_map_hasher<_Tp, _Hash, false>
|
||||
{
|
||||
_Hash __hash_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher() : __hash_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_hasher(const _Hash& __h) : __hash_(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Hash& hash_function() const {return __hash_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return __hash_(__x.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const typename _Tp::first_type& __x) const
|
||||
{return __hash_(__x);}
|
||||
};
|
||||
@@ -326,22 +316,15 @@ class __unordered_map_equal
|
||||
: private _Pred
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal() : _Pred() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal(const _Pred& __p) : _Pred(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Pred& key_eq() const {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x,
|
||||
const typename _Tp::first_type& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x, __y);}
|
||||
@@ -352,22 +335,15 @@ class __unordered_map_equal<_Tp, _Pred, false>
|
||||
{
|
||||
_Pred __pred_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal() : __pred_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__unordered_map_equal(const _Pred& __p) : __pred_(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Pred& key_eq() const {return __pred_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __pred_(__x.first, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
|
||||
{return __pred_(__x, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
|
||||
{return __pred_(__x.first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x,
|
||||
const typename _Tp::first_type& __y) const
|
||||
{return __pred_(__x, __y);}
|
||||
@@ -393,15 +369,13 @@ public:
|
||||
bool __first_constructed;
|
||||
bool __second_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_map_node_destructor(allocator_type& __na)
|
||||
: __na_(__na),
|
||||
__first_constructed(false),
|
||||
__second_constructed(false)
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
@@ -409,8 +383,7 @@ public:
|
||||
{
|
||||
__x.__value_constructed = false;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#else // _LIBCPP_MOVE
|
||||
__hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
@@ -418,9 +391,8 @@ public:
|
||||
{
|
||||
const_cast<bool&>(__x.__value_constructed) = false;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
if (__second_constructed)
|
||||
@@ -433,7 +405,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _HashIterator>
|
||||
class _LIBCPP_VISIBLE __hash_map_iterator
|
||||
class __hash_map_iterator
|
||||
{
|
||||
_HashIterator __i_;
|
||||
|
||||
@@ -453,20 +425,14 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return *operator->();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator& operator++() {++__i_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator operator++(int)
|
||||
{
|
||||
__hash_map_iterator __t(*this);
|
||||
@@ -474,22 +440,20 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
friend bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
{return __x.__i_ == __y.__i_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
friend bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
{return __x.__i_ != __y.__i_;}
|
||||
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> friend class unordered_map;
|
||||
template <class, class, class, class, class> friend class unordered_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
template <class> friend class __hash_map_const_iterator;
|
||||
};
|
||||
|
||||
template <class _HashIterator>
|
||||
class _LIBCPP_VISIBLE __hash_map_const_iterator
|
||||
class __hash_map_const_iterator
|
||||
{
|
||||
_HashIterator __i_;
|
||||
|
||||
@@ -509,24 +473,17 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(
|
||||
__hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
|
||||
: __i_(__i.__i_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return *operator->();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator& operator++() {++__i_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator operator++(int)
|
||||
{
|
||||
__hash_map_const_iterator __t(*this);
|
||||
@@ -534,22 +491,20 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
friend bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
{return __x.__i_ == __y.__i_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
friend bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
{return __x.__i_ != __y.__i_;}
|
||||
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class, class, class, class, class> friend class unordered_map;
|
||||
template <class, class, class, class, class> friend class unordered_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
};
|
||||
|
||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||
class _LIBCPP_VISIBLE unordered_map
|
||||
class unordered_map
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -598,7 +553,6 @@ public:
|
||||
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
|
||||
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_map() {} // = default;
|
||||
explicit unordered_map(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -619,10 +573,10 @@ public:
|
||||
explicit unordered_map(const allocator_type& __a);
|
||||
unordered_map(const unordered_map& __u);
|
||||
unordered_map(const unordered_map& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_map(unordered_map&& __u);
|
||||
unordered_map(unordered_map&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
unordered_map(initializer_list<value_type> __il);
|
||||
unordered_map(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
|
||||
@@ -631,187 +585,131 @@ public:
|
||||
const allocator_type& __a);
|
||||
// ~unordered_map() = default;
|
||||
// unordered_map& operator=(const unordered_map& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_map& operator=(unordered_map&& __u);
|
||||
#endif
|
||||
unordered_map& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
pair<iterator, bool> emplace()
|
||||
{return __table_.__emplace_unique();}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_A0&& __a0)
|
||||
{return __table_.__emplace_unique(_STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
pair<iterator, bool> emplace(_A0&& __a0, _Args&&... __args);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator)
|
||||
{return __table_.__emplace_unique().first;}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator, _A0&& __a0)
|
||||
{return __table_.__emplace_unique(_STD::forward<_A0>(__a0)).first;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator, _A0&& __a0, _Args&&... __args)
|
||||
{return emplace(_STD::forward<_A0>(__a0),
|
||||
_STD::forward<_Args>(__args)...).first;}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P,
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(_P&& __x)
|
||||
{return __table_.__insert_unique(_STD::forward<_P>(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator, const value_type& __x)
|
||||
{return insert(__x).first;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P,
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, _P&& __x)
|
||||
{return insert(_STD::forward<_P>(__x)).first;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_map& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const
|
||||
{return __table_.hash_function().hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const
|
||||
{return __table_.key_eq().key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
mapped_type& operator[](const key_type& __k);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
mapped_type& operator[](key_type&& __k);
|
||||
#endif
|
||||
|
||||
mapped_type& at(const key_type& __k);
|
||||
const mapped_type& at(const key_type& __k) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const
|
||||
{return __table_.bucket_size(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator begin(size_type __n) {return __table_.begin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator end(size_type __n) {return __table_.end(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void rehash(size_type __n) {__table_.rehash(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void reserve(size_type __n) {__table_.reserve(__n);}
|
||||
|
||||
private:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
__node_holder __construct_node(const key_type& __k);
|
||||
#endif
|
||||
};
|
||||
@@ -834,7 +732,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
const allocator_type& __a)
|
||||
: __table_(__a)
|
||||
@@ -889,10 +787,10 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
insert(__u.begin(), __u.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
unordered_map&& __u)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
@@ -914,7 +812,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
@@ -943,10 +841,10 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
|
||||
{
|
||||
@@ -954,10 +852,10 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -966,8 +864,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
@@ -988,8 +885,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
|
||||
return __h;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0,
|
||||
class // = typename enable_if<is_convertible<_A0, value_type>::value>::type
|
||||
@@ -1006,8 +901,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||
return __h;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
@@ -1023,8 +916,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... _
|
||||
return __r;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||
@@ -1039,11 +931,11 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type&
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -1065,7 +957,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
|
||||
return __r.first->second;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
_Tp&
|
||||
@@ -1080,7 +972,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
|
||||
return __r.first->second;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
_Tp&
|
||||
@@ -1107,7 +999,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::at(const key_type& __k) const
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -1135,7 +1027,7 @@ operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -1145,7 +1037,7 @@ operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
|
||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||
class _LIBCPP_VISIBLE unordered_multimap
|
||||
class unordered_multimap
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -1192,7 +1084,6 @@ public:
|
||||
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
|
||||
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multimap() {} // = default
|
||||
explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -1213,10 +1104,10 @@ public:
|
||||
explicit unordered_multimap(const allocator_type& __a);
|
||||
unordered_multimap(const unordered_multimap& __u);
|
||||
unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_multimap(unordered_multimap&& __u);
|
||||
unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
unordered_multimap(initializer_list<value_type> __il);
|
||||
unordered_multimap(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(),
|
||||
@@ -1226,173 +1117,120 @@ public:
|
||||
const allocator_type& __a);
|
||||
// ~unordered_multimap() = default;
|
||||
// unordered_multimap& operator=(const unordered_multimap& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_multimap& operator=(unordered_multimap&& __u);
|
||||
#endif
|
||||
unordered_multimap& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator emplace()
|
||||
{return __table_.__emplace_multi();}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_A0&& __a0)
|
||||
{return __table_.__emplace_multi(_STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator emplace(_A0&& __a0, _Args&&... __args);
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p)
|
||||
{return __table_.__emplace_hint_multi(__p.__i_);}
|
||||
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _A0&& __a0)
|
||||
{return __table_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
iterator emplace_hint(const_iterator __p, _A0&& __a0, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P,
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(_P&& __x)
|
||||
{return __table_.__insert_multi(_STD::forward<_P>(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, const value_type& __x)
|
||||
{return __table_.__insert_multi(__p.__i_, __x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _P,
|
||||
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, _P&& __x)
|
||||
{return __table_.__insert_multi(__p.__i_, _STD::forward<_P>(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_multimap& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const
|
||||
{return __table_.hash_function().hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const
|
||||
{return __table_.key_eq().key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const
|
||||
{return __table_.bucket_size(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator begin(size_type __n) {return __table_.begin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator end(size_type __n) {return __table_.end(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void rehash(size_type __n) {__table_.rehash(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void reserve(size_type __n) {__table_.reserve(__n);}
|
||||
|
||||
private:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _A0, class... _Args,
|
||||
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0, _Args&&... __args);
|
||||
template <class _A0,
|
||||
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
|
||||
__node_holder __construct_node(_A0&& __a0);
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // _LIBCPP_MOVE
|
||||
};
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
@@ -1443,7 +1281,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
const allocator_type& __a)
|
||||
: __table_(__a)
|
||||
@@ -1468,10 +1306,10 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
insert(__u.begin(), __u.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
unordered_multimap&& __u)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
@@ -1495,7 +1333,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
@@ -1524,10 +1362,10 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
|
||||
{
|
||||
@@ -1535,10 +1373,10 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multima
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -1547,8 +1385,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
@@ -1569,8 +1406,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
|
||||
return __h;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0,
|
||||
class // = typename enable_if<is_convertible<_A0, value_type>::value>::type
|
||||
@@ -1587,8 +1422,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0
|
||||
return __h;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _A0, class... _Args,
|
||||
class // = typename enable_if<is_convertible<_A0, key_type>::value>::type
|
||||
@@ -1618,12 +1451,11 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
|
||||
return __r;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -1633,7 +1465,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __fir
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -1665,7 +1497,7 @@ operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
|
@@ -271,7 +271,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE unordered_set
|
||||
class unordered_set
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -299,7 +299,6 @@ public:
|
||||
typedef typename __table::const_local_iterator local_iterator;
|
||||
typedef typename __table::const_local_iterator const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_set() {} // = default;
|
||||
explicit unordered_set(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -318,10 +317,10 @@ public:
|
||||
explicit unordered_set(const allocator_type& __a);
|
||||
unordered_set(const unordered_set& __u);
|
||||
unordered_set(const unordered_set& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_set(unordered_set&& __u);
|
||||
unordered_set(unordered_set&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
unordered_set(initializer_list<value_type> __il);
|
||||
unordered_set(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(),
|
||||
@@ -331,130 +330,86 @@ public:
|
||||
const allocator_type& __a);
|
||||
// ~unordered_set() = default;
|
||||
// unordered_set& operator=(const unordered_set& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_set& operator=(unordered_set&& __u);
|
||||
#endif
|
||||
unordered_set& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_Args&&... __args)
|
||||
{return __table_.__emplace_unique(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator, _Args&&... __args)
|
||||
{return __table_.__emplace_unique(_STD::forward<_Args>(__args)...).first;}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
pair<iterator, bool> insert(value_type&& __x)
|
||||
{return __table_.__insert_unique(_STD::move(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator, const value_type& __x)
|
||||
{return insert(__x).first;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator, value_type&& __x)
|
||||
{return insert(_STD::move(__x)).first;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_set& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const {return __table_.hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const {return __table_.key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator begin(size_type __n) {return __table_.begin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator end(size_type __n) {return __table_.end(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void rehash(size_type __n) {__table_.rehash(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void reserve(size_type __n) {__table_.reserve(__n);}
|
||||
};
|
||||
|
||||
@@ -505,7 +460,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
const allocator_type& __a)
|
||||
: __table_(__a)
|
||||
@@ -530,10 +485,10 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
insert(__u.begin(), __u.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
unordered_set&& __u)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
@@ -553,7 +508,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
@@ -582,10 +537,10 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>&
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
|
||||
{
|
||||
@@ -593,10 +548,10 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>&
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
initializer_list<value_type> __il)
|
||||
@@ -607,7 +562,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -617,7 +572,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -645,7 +600,7 @@ operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -655,7 +610,7 @@ operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
|
||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE unordered_multiset
|
||||
class unordered_multiset
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -683,7 +638,6 @@ public:
|
||||
typedef typename __table::const_local_iterator local_iterator;
|
||||
typedef typename __table::const_local_iterator const_local_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unordered_multiset() {} // = default
|
||||
explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -702,10 +656,10 @@ public:
|
||||
explicit unordered_multiset(const allocator_type& __a);
|
||||
unordered_multiset(const unordered_multiset& __u);
|
||||
unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_multiset(unordered_multiset&& __u);
|
||||
unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
unordered_multiset(initializer_list<value_type> __il);
|
||||
unordered_multiset(initializer_list<value_type> __il, size_type __n,
|
||||
const hasher& __hf = hasher(),
|
||||
@@ -715,128 +669,84 @@ public:
|
||||
const allocator_type& __a);
|
||||
// ~unordered_multiset() = default;
|
||||
// unordered_multiset& operator=(const unordered_multiset& __u) = default;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unordered_multiset& operator=(unordered_multiset&& __u);
|
||||
#endif
|
||||
unordered_multiset& operator=(initializer_list<value_type> __il);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const {return __table_.end();}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_Args&&... __args)
|
||||
{return __table_.__emplace_multi(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __table_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(value_type&& __x) {return __table_.__insert_multi(_STD::move(__x));}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __p, const value_type& __x)
|
||||
{return __table_.__insert_multi(__p, __x);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, value_type&& __x)
|
||||
{return __table_.__insert_multi(__p, _STD::move(__x));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __table_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __first, const_iterator __last)
|
||||
{return __table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unordered_multiset& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_function() const {return __table_.hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const {return __table_.key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator begin(size_type __n) {return __table_.begin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
local_iterator end(size_type __n) {return __table_.end(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float load_factor() const {return __table_.load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
float max_load_factor() const {return __table_.max_load_factor();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void rehash(size_type __n) {__table_.rehash(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void reserve(size_type __n) {__table_.reserve(__n);}
|
||||
};
|
||||
|
||||
@@ -888,7 +798,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
const allocator_type& __a)
|
||||
: __table_(__a)
|
||||
@@ -913,10 +823,10 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
insert(__u.begin(), __u.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
unordered_multiset&& __u)
|
||||
: __table_(_STD::move(__u.__table_))
|
||||
@@ -936,7 +846,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
@@ -965,10 +875,10 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
unordered_multiset&& __u)
|
||||
@@ -977,7 +887,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline
|
||||
@@ -991,7 +901,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -1001,7 +911,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -1033,7 +943,7 @@ operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
|
@@ -171,14 +171,14 @@ swap(_Tp (&__a)[_N], _Tp (&__b)[_N])
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
typename conditional
|
||||
<
|
||||
!has_nothrow_move_constructor<_Tp>::value && has_copy_constructor<_Tp>::value,
|
||||
const _Tp&,
|
||||
_Tp&&
|
||||
>::type
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
const _Tp&
|
||||
#endif
|
||||
move_if_noexcept(_Tp& __x)
|
||||
@@ -186,7 +186,7 @@ move_if_noexcept(_Tp& __x)
|
||||
return _STD::move(__x);
|
||||
}
|
||||
|
||||
struct _LIBCPP_VISIBLE piecewise_construct_t { };
|
||||
struct piecewise_construct_t { };
|
||||
//constexpr
|
||||
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
|
||||
|
||||
@@ -194,7 +194,7 @@ 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
|
||||
struct pair
|
||||
{
|
||||
typedef _T1 first_type;
|
||||
typedef _T2 second_type;
|
||||
@@ -207,7 +207,7 @@ struct _LIBCPP_VISIBLE pair
|
||||
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
|
||||
: first(__x), second(__y) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _U1, class _U2,
|
||||
class = typename enable_if<is_convertible<_U1, first_type >::value &&
|
||||
@@ -231,7 +231,6 @@ struct _LIBCPP_VISIBLE pair
|
||||
{}
|
||||
|
||||
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
|
||||
tuple<_Args2...> __second_args)
|
||||
: pair(__pc, __first_args, __second_args,
|
||||
@@ -241,7 +240,6 @@ struct _LIBCPP_VISIBLE pair
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if<__tuple_assignable<_Tuple, pair>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair&
|
||||
operator=(_Tuple&& __p)
|
||||
{
|
||||
@@ -255,11 +253,11 @@ struct _LIBCPP_VISIBLE pair
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY pair(const pair<_U1, _U2>& __p)
|
||||
: first(__p.first), second(__p.second) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void _LIBCPP_INLINE_VISIBILITY swap(pair& __p) {_STD::swap(*this, __p);}
|
||||
private:
|
||||
|
||||
@@ -328,7 +326,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
|
||||
swap(__x.second, __y.second);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp> class reference_wrapper;
|
||||
|
||||
@@ -351,7 +349,7 @@ struct __make_pair_return
|
||||
};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
pair<typename __make_pair_return<_T1>::type, typename __make_pair_return<_T2>::type>
|
||||
make_pair(_T1&& __t1, _T2&& __t2)
|
||||
{
|
||||
@@ -359,7 +357,7 @@ make_pair(_T1&& __t1, _T2&& __t2)
|
||||
(_STD::forward<_T1>(__t1), _STD::forward<_T2>(__t2));
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
|
||||
template <class _T1, class _T2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -369,41 +367,39 @@ make_pair(_T1 __x, _T2 __y)
|
||||
return pair<_T1, _T2>(__x, __y);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _T1, class _T2>
|
||||
class _LIBCPP_VISIBLE tuple_size<pair<_T1, _T2> >
|
||||
: public integral_constant<size_t, 2> {};
|
||||
class tuple_size<pair<_T1, _T2> > : public integral_constant<size_t, 2> {};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
class _LIBCPP_VISIBLE tuple_size<const pair<_T1, _T2> >
|
||||
: public integral_constant<size_t, 2> {};
|
||||
class tuple_size<const pair<_T1, _T2> > : public integral_constant<size_t, 2> {};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
class _LIBCPP_VISIBLE tuple_element<0, pair<_T1, _T2> >
|
||||
class tuple_element<0, pair<_T1, _T2> >
|
||||
{
|
||||
public:
|
||||
typedef _T1 type;
|
||||
};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
class _LIBCPP_VISIBLE tuple_element<1, pair<_T1, _T2> >
|
||||
class tuple_element<1, pair<_T1, _T2> >
|
||||
{
|
||||
public:
|
||||
typedef _T2 type;
|
||||
};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
class _LIBCPP_VISIBLE tuple_element<0, const pair<_T1, _T2> >
|
||||
class tuple_element<0, const pair<_T1, _T2> >
|
||||
{
|
||||
public:
|
||||
typedef const _T1 type;
|
||||
};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
class _LIBCPP_VISIBLE tuple_element<1, const pair<_T1, _T2> >
|
||||
class tuple_element<1, const pair<_T1, _T2> >
|
||||
{
|
||||
public:
|
||||
typedef const _T2 type;
|
||||
|
640
include/valarray
640
include/valarray
File diff suppressed because it is too large
Load Diff
@@ -330,22 +330,18 @@ protected:
|
||||
void __destruct_at_end(const_pointer __new_last, false_type);
|
||||
void __destruct_at_end(const_pointer __new_last, true_type);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __vector_base& __c)
|
||||
{__copy_assign_alloc(__c, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_copy_assignment::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__vector_base& __c)
|
||||
{__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)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_swap::value>());}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __vector_base& __c, true_type)
|
||||
{
|
||||
if (__alloc() != __c.__alloc())
|
||||
@@ -357,27 +353,22 @@ private:
|
||||
__alloc() = __c.__alloc();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __vector_base& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __vector_base& __c, true_type)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const __vector_base& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
|
||||
{}
|
||||
};
|
||||
@@ -428,7 +419,7 @@ __vector_base<_Tp, _Allocator>::~__vector_base()
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator = allocator<_Tp> >
|
||||
class _LIBCPP_VISIBLE vector
|
||||
class vector
|
||||
: private __vector_base<_Tp, _Allocator>
|
||||
{
|
||||
private:
|
||||
@@ -487,19 +478,17 @@ public:
|
||||
vector(initializer_list<value_type> __il);
|
||||
vector(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~vector() {__invalidate_all_iterators();}
|
||||
#endif
|
||||
|
||||
vector(const vector& __x);
|
||||
vector(const vector& __x, const allocator_type& __a);
|
||||
vector& operator=(const vector& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
vector(vector&& __x);
|
||||
vector(vector&& __x, const allocator_type& __a);
|
||||
vector& operator=(vector&& __x);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
vector& operator=(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end()); return *this;}
|
||||
|
||||
@@ -520,7 +509,6 @@ public:
|
||||
assign(_ForwardIterator __first, _ForwardIterator __last);
|
||||
|
||||
void assign(size_type __n, const_reference __u);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end());}
|
||||
|
||||
@@ -564,23 +552,19 @@ public:
|
||||
{return _STD::__to_raw_pointer(this->__begin_);}
|
||||
|
||||
void push_back(const_reference __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push_back(value_type&& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
void emplace_back(_Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop_back();
|
||||
|
||||
iterator insert(const_iterator __position, const_reference __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __position, value_type&& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
iterator emplace(const_iterator __position, _Args&&... __args);
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __position, size_type __n, const_reference __x);
|
||||
template <class _InputIterator>
|
||||
typename enable_if
|
||||
@@ -597,7 +581,6 @@ public:
|
||||
iterator
|
||||
>::type
|
||||
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __position, initializer_list<value_type> __il)
|
||||
{return insert(__position, __il.begin(), __il.end());}
|
||||
|
||||
@@ -968,7 +951,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -1060,7 +1043,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
|
||||
__c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -1300,7 +1283,7 @@ vector<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -1322,8 +1305,6 @@ vector<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
void
|
||||
@@ -1345,8 +1326,7 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -1422,7 +1402,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
|
||||
return __make_iter(__p);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename vector<_Tp, _Allocator>::iterator
|
||||
@@ -1454,8 +1434,6 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
|
||||
return __make_iter(__p);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
typename vector<_Tp, _Allocator>::iterator
|
||||
@@ -1487,8 +1465,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
|
||||
return __make_iter(__p);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
typename vector<_Tp, _Allocator>::iterator
|
||||
@@ -1695,7 +1672,7 @@ template <class _Allocator> class vector<bool, _Allocator>;
|
||||
template <class _Allocator> struct hash<vector<bool, _Allocator> >;
|
||||
|
||||
template <class _Allocator>
|
||||
class _LIBCPP_VISIBLE vector<bool, _Allocator>
|
||||
class vector<bool, _Allocator>
|
||||
: private __vector_base_common<true>
|
||||
{
|
||||
public:
|
||||
@@ -1784,12 +1761,11 @@ public:
|
||||
vector(initializer_list<value_type> __il);
|
||||
vector(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
vector(vector&& __v);
|
||||
vector(vector&& __v, const allocator_type& __a);
|
||||
vector& operator=(vector&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif // _LIBCPP_MOVE
|
||||
vector& operator=(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end()); return *this;}
|
||||
|
||||
@@ -1810,7 +1786,6 @@ public:
|
||||
assign(_ForwardIterator __first, _ForwardIterator __last);
|
||||
|
||||
void assign(size_type __n, const value_type& __x);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(initializer_list<value_type> __il)
|
||||
{assign(__il.begin(), __il.end());}
|
||||
|
||||
@@ -1870,7 +1845,6 @@ public:
|
||||
iterator
|
||||
>::type
|
||||
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __position, initializer_list<value_type> __il)
|
||||
{return insert(__position, __il.begin(), __il.end());}
|
||||
|
||||
@@ -1922,11 +1896,9 @@ private:
|
||||
{return iterator(const_cast<__storage_pointer>(__p.__seg_), __p.__ctz_);}
|
||||
#endif // _LIBCPP_DEBUG
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const vector& __v)
|
||||
{__copy_assign_alloc(__v, integral_constant<bool,
|
||||
__storage_traits::propagate_on_container_copy_assignment::value>());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const vector& __c, true_type)
|
||||
{
|
||||
if (__alloc() != __c.__alloc())
|
||||
@@ -1934,38 +1906,31 @@ private:
|
||||
__alloc() = __c.__alloc();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const vector& __c, false_type)
|
||||
{}
|
||||
|
||||
void __move_assign(vector& __c, false_type);
|
||||
void __move_assign(vector& __c, true_type);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(vector& __c)
|
||||
{__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)
|
||||
{
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(const vector& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y)
|
||||
{__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)
|
||||
{
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, false_type)
|
||||
{}
|
||||
|
||||
@@ -1976,7 +1941,7 @@ private:
|
||||
friend class __bit_iterator<vector, false>;
|
||||
friend class __bit_iterator<vector, true>;
|
||||
friend class __bit_array<vector>;
|
||||
friend struct _LIBCPP_VISIBLE hash<vector>;
|
||||
friend struct hash<vector>;
|
||||
};
|
||||
|
||||
template <class _Allocator>
|
||||
@@ -2307,8 +2272,7 @@ vector<bool, _Allocator>::operator=(const vector& __v)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<bool, _Allocator>::vector(vector&& __v)
|
||||
@@ -2373,8 +2337,7 @@ vector<bool, _Allocator>::__move_assign(vector& __c, true_type)
|
||||
__c.__begin_ = nullptr;
|
||||
__c.__cap() = __c.__size_ = 0;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Allocator>
|
||||
void
|
||||
@@ -2747,10 +2710,9 @@ vector<bool, _Allocator>::__hash_code() const
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
struct _LIBCPP_VISIBLE hash<vector<bool, _Allocator> >
|
||||
struct hash<vector<bool, _Allocator> >
|
||||
: public unary_function<vector<bool, _Allocator>, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const vector<bool, _Allocator>& __vec) const
|
||||
{return __vec.__hash_code();}
|
||||
};
|
||||
|
45
lib/buildit
45
lib/buildit
@@ -14,17 +14,7 @@ fi
|
||||
|
||||
if [ -z "$CXX" ]
|
||||
then
|
||||
CXX=clang++
|
||||
fi
|
||||
|
||||
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
fi
|
||||
|
||||
if [ -z $RC_ProjectSourceVersion ]
|
||||
then
|
||||
RC_ProjectSourceVersion=1
|
||||
CXX=g++
|
||||
fi
|
||||
|
||||
case $TRIPLE in
|
||||
@@ -34,35 +24,19 @@ case $TRIPLE in
|
||||
RC_CFLAGS="-arch i386 -arch x86_64"
|
||||
fi
|
||||
SOEXT=dylib
|
||||
if [ "$MACOSX_DEPLOYMENT_TARGET" == "10.6" ]
|
||||
then
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs -current_version 1 \
|
||||
-compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
||||
/usr/lib/libSystem.B.dylib"
|
||||
else
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs \
|
||||
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
${SDKROOT}/usr/lib/libc++abi.dylib \
|
||||
-lSystem \
|
||||
-Xarch_x86_64 -exported_symbols_list \
|
||||
-Xarch_x86_64 x86_64.exp \
|
||||
-Xarch_i386 -exported_symbols_list \
|
||||
-Xarch_i386 i386.exp \
|
||||
-exported_symbols_list libc++abi.exp \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp"
|
||||
fi
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs -current_version 1 \
|
||||
-compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
||||
/usr/lib/libSystem.B.dylib"
|
||||
;;
|
||||
*)
|
||||
RC_CFLAGS="-fPIC"
|
||||
SOEXT=so
|
||||
LDSHARED_FLAGS="-o libc++.so.1.0 \
|
||||
-shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
|
||||
-lpthread -lrt -lc"
|
||||
-lstdc++ -lc"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -77,8 +51,7 @@ for FILE in ../src/*.cpp; do
|
||||
$CXX -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE
|
||||
done
|
||||
|
||||
|
||||
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
$CXX *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
|
||||
#libtool -static -o libc++.a *.o
|
||||
|
||||
|
2458
lib/i386.exp
2458
lib/i386.exp
File diff suppressed because it is too large
Load Diff
@@ -1,150 +0,0 @@
|
||||
___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_v0
|
||||
__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
|
@@ -1,5 +0,0 @@
|
||||
# Remove the weak-def bit from these external symbols
|
||||
__ZT*
|
||||
__ZN*
|
||||
__ZS*
|
||||
|
2458
lib/x86_64.exp
2458
lib/x86_64.exp
File diff suppressed because it is too large
Load Diff
@@ -1,23 +0,0 @@
|
||||
//===------------------------- atomic.cpp ---------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "__mutex_base"
|
||||
#include "atomic"
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
mutex&
|
||||
__not_atomic_mut()
|
||||
{
|
||||
static mutex m;
|
||||
return m;
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
@@ -94,7 +94,7 @@ init_monotonic_clock()
|
||||
return &monotonic_full;
|
||||
}
|
||||
|
||||
#pragma GCC visibility pop
|
||||
#pragma GCC visiblity pop
|
||||
|
||||
monotonic_clock::time_point
|
||||
monotonic_clock::now()
|
||||
|
@@ -61,10 +61,4 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
|
||||
__throw_system_error(ec, "condition_variable timed_wait failed");
|
||||
}
|
||||
|
||||
void
|
||||
notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
|
||||
{
|
||||
__thread_local_data()->notify_all_at_thread_exit(&cond, lk.release());
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
294
src/future.cpp
294
src/future.cpp
@@ -1,294 +0,0 @@
|
||||
//===------------------------- future.cpp ---------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "future"
|
||||
#include "string"
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_HIDDEN __future_error_category
|
||||
: public __do_message
|
||||
{
|
||||
public:
|
||||
virtual const char* name() const;
|
||||
virtual string message(int ev) const;
|
||||
};
|
||||
|
||||
const char*
|
||||
__future_error_category::name() const
|
||||
{
|
||||
return "future";
|
||||
}
|
||||
|
||||
string
|
||||
__future_error_category::message(int ev) const
|
||||
{
|
||||
switch (ev)
|
||||
{
|
||||
case future_errc::broken_promise:
|
||||
return string("The associated promise has been destructed prior "
|
||||
"to the associated state becoming ready.");
|
||||
case future_errc::future_already_retrieved:
|
||||
return string("The future has already been retrieved from "
|
||||
"the promise or packaged_task.");
|
||||
case future_errc::promise_already_satisfied:
|
||||
return string("The state of the promise has already been set.");
|
||||
case future_errc::no_state:
|
||||
return string("Operation not permitted on an object without "
|
||||
"an associated state.");
|
||||
}
|
||||
return string("unspecified future_errc value\n");
|
||||
}
|
||||
|
||||
const error_category&
|
||||
future_category()
|
||||
{
|
||||
static __future_error_category __f;
|
||||
return __f;
|
||||
}
|
||||
|
||||
future_error::future_error(error_code __ec)
|
||||
: logic_error(__ec.message()),
|
||||
__ec_(__ec)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::__on_zero_shared()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::set_value()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
__state_ |= __constructed | ready;
|
||||
__lk.unlock();
|
||||
__cv_.notify_all();
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::set_value_at_thread_exit()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
__state_ |= __constructed;
|
||||
__thread_local_data()->__make_ready_at_thread_exit(this);
|
||||
__lk.unlock();
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::set_exception(exception_ptr __p)
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
__exception_ = __p;
|
||||
__state_ |= ready;
|
||||
__lk.unlock();
|
||||
__cv_.notify_all();
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::set_exception_at_thread_exit(exception_ptr __p)
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
if (__has_value())
|
||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||
__exception_ = __p;
|
||||
__thread_local_data()->__make_ready_at_thread_exit(this);
|
||||
__lk.unlock();
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::__make_ready()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
__state_ |= ready;
|
||||
__lk.unlock();
|
||||
__cv_.notify_all();
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::copy()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
__sub_wait(__lk);
|
||||
if (__exception_ != nullptr)
|
||||
rethrow_exception(__exception_);
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::wait()
|
||||
{
|
||||
unique_lock<mutex> __lk(__mut_);
|
||||
__sub_wait(__lk);
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::__sub_wait(unique_lock<mutex>& __lk)
|
||||
{
|
||||
if (!__is_ready())
|
||||
{
|
||||
if (__state_ & deferred)
|
||||
{
|
||||
__state_ &= ~deferred;
|
||||
__lk.unlock();
|
||||
__execute();
|
||||
}
|
||||
else
|
||||
while (!__is_ready())
|
||||
__cv_.wait(__lk);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
__assoc_sub_state::__execute()
|
||||
{
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
}
|
||||
|
||||
future<void>::future(__assoc_sub_state* __state)
|
||||
: __state_(__state)
|
||||
{
|
||||
if (__state_->__has_future_attached())
|
||||
throw future_error(make_error_code(future_errc::future_already_retrieved));
|
||||
__state_->__add_shared();
|
||||
__state_->__set_future_attached();
|
||||
}
|
||||
|
||||
future<void>::~future()
|
||||
{
|
||||
if (__state_)
|
||||
__state_->__release_shared();
|
||||
}
|
||||
|
||||
void
|
||||
future<void>::get()
|
||||
{
|
||||
unique_ptr<__shared_count, __release_shared_count> __(__state_);
|
||||
__assoc_sub_state* __s = __state_;
|
||||
__state_ = nullptr;
|
||||
__s->copy();
|
||||
}
|
||||
|
||||
promise<void>::promise()
|
||||
: __state_(new __assoc_sub_state)
|
||||
{
|
||||
}
|
||||
|
||||
promise<void>::~promise()
|
||||
{
|
||||
if (__state_)
|
||||
{
|
||||
if (!__state_->__has_value() && __state_->use_count() > 1)
|
||||
__state_->set_exception(make_exception_ptr(
|
||||
future_error(make_error_code(future_errc::broken_promise))
|
||||
));
|
||||
__state_->__release_shared();
|
||||
}
|
||||
}
|
||||
|
||||
future<void>
|
||||
promise<void>::get_future()
|
||||
{
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
return future<void>(__state_);
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_value()
|
||||
{
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
__state_->set_value();
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_exception(exception_ptr __p)
|
||||
{
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
__state_->set_exception(__p);
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_value_at_thread_exit()
|
||||
{
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
__state_->set_value_at_thread_exit();
|
||||
}
|
||||
|
||||
void
|
||||
promise<void>::set_exception_at_thread_exit(exception_ptr __p)
|
||||
{
|
||||
if (__state_ == nullptr)
|
||||
throw future_error(make_error_code(future_errc::no_state));
|
||||
__state_->set_exception_at_thread_exit(__p);
|
||||
}
|
||||
|
||||
shared_future<void>::~shared_future()
|
||||
{
|
||||
if (__state_)
|
||||
__state_->__release_shared();
|
||||
}
|
||||
|
||||
shared_future<void>&
|
||||
shared_future<void>::operator=(const shared_future& __rhs)
|
||||
{
|
||||
if (__rhs.__state_)
|
||||
__rhs.__state_->__add_shared();
|
||||
if (__state_)
|
||||
__state_->__release_shared();
|
||||
__state_ = __rhs.__state_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
atomic_future<void>::~atomic_future()
|
||||
{
|
||||
if (__state_)
|
||||
__state_->__release_shared();
|
||||
}
|
||||
|
||||
atomic_future<void>&
|
||||
atomic_future<void>::operator=(const atomic_future& __rhs)
|
||||
{
|
||||
if (this != &__rhs)
|
||||
{
|
||||
unique_lock<mutex> __this(__mut_, defer_lock);
|
||||
unique_lock<mutex> __that(__rhs.__mut_, defer_lock);
|
||||
_STD::lock(__this, __that);
|
||||
if (__rhs.__state_)
|
||||
__rhs.__state_->__add_shared();
|
||||
if (__state_)
|
||||
__state_->__release_shared();
|
||||
__state_ = __rhs.__state_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void
|
||||
atomic_future<void>::swap(atomic_future& __rhs)
|
||||
{
|
||||
if (this != &__rhs)
|
||||
{
|
||||
unique_lock<mutex> __this(__mut_, defer_lock);
|
||||
unique_lock<mutex> __that(__rhs.__mut_, defer_lock);
|
||||
_STD::lock(__this, __that);
|
||||
_STD::swap(__state_, __rhs.__state_);
|
||||
}
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
346
src/hash.cpp
346
src/hash.cpp
@@ -157,7 +157,7 @@ __next_prime(size_t n)
|
||||
// Select first potential prime >= n
|
||||
// Known a-priori n >= L
|
||||
size_t k0 = n / L;
|
||||
size_t in = std::lower_bound(indices, indices + M, n - k0 * L) - indices;
|
||||
size_t in = std::lower_bound(indices, indices + M, n % L) - indices;
|
||||
n = L * k0 + indices[in];
|
||||
while (true)
|
||||
{
|
||||
@@ -170,352 +170,302 @@ __next_prime(size_t n)
|
||||
// small prime.
|
||||
for (size_t j = 5; j < N - 1; ++j)
|
||||
{
|
||||
const std::size_t p = small_primes[j];
|
||||
const std::size_t q = n / p;
|
||||
if (q < p)
|
||||
return n;
|
||||
if (n == q * p)
|
||||
if (n % small_primes[j] == 0)
|
||||
goto next;
|
||||
if (n / small_primes[j] < small_primes[j])
|
||||
return n;
|
||||
}
|
||||
// n wasn't divisible by small primes, try potential primes
|
||||
{
|
||||
size_t i = 211;
|
||||
while (true)
|
||||
{
|
||||
std::size_t q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 10;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 8;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 8;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 6;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 4;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 2;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
i += 10;
|
||||
q = n / i;
|
||||
if (q < i)
|
||||
return n;
|
||||
if (n == q * i)
|
||||
if (n % i == 0)
|
||||
break;
|
||||
if (n / i < i)
|
||||
return n;
|
||||
|
||||
// This will loop i to the next "plane" of potential primes
|
||||
i += 2;
|
||||
|
@@ -81,7 +81,7 @@ __libcpp_nmstr::~__libcpp_nmstr()
|
||||
|
||||
}
|
||||
|
||||
#pragma GCC visibility pop
|
||||
#pragma GCC visiblity pop
|
||||
|
||||
namespace std // purposefully not using versioning namespace
|
||||
{
|
||||
|
@@ -100,7 +100,7 @@ strstreambuf::strstreambuf(const unsigned char* __gnext, streamsize __n)
|
||||
__init((char*)__gnext, __n, nullptr);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
strstreambuf::strstreambuf(strstreambuf&& __rhs)
|
||||
: streambuf(__rhs),
|
||||
@@ -132,7 +132,7 @@ strstreambuf::operator=(strstreambuf&& __rhs)
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
strstreambuf::~strstreambuf()
|
||||
{
|
||||
|
@@ -9,8 +9,6 @@
|
||||
|
||||
#include "thread"
|
||||
#include "exception"
|
||||
#include "vector"
|
||||
#include "future"
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
@@ -83,84 +81,4 @@ sleep_for(const chrono::nanoseconds& ns)
|
||||
|
||||
} // this_thread
|
||||
|
||||
__thread_specific_ptr<__thread_struct>&
|
||||
__thread_local_data()
|
||||
{
|
||||
static __thread_specific_ptr<__thread_struct> __p;
|
||||
return __p;
|
||||
}
|
||||
|
||||
// __thread_struct_imp
|
||||
|
||||
class __thread_struct_imp
|
||||
{
|
||||
typedef vector<__assoc_sub_state*> _AsyncStates;
|
||||
typedef vector<pair<condition_variable*, mutex*> > _Notify;
|
||||
|
||||
_AsyncStates async_states_;
|
||||
_Notify notify_;
|
||||
|
||||
__thread_struct_imp(const __thread_struct_imp&);
|
||||
__thread_struct_imp& operator=(const __thread_struct_imp&);
|
||||
public:
|
||||
__thread_struct_imp() {}
|
||||
~__thread_struct_imp();
|
||||
|
||||
void notify_all_at_thread_exit(condition_variable* cv, mutex* m);
|
||||
void __make_ready_at_thread_exit(__assoc_sub_state* __s);
|
||||
};
|
||||
|
||||
__thread_struct_imp::~__thread_struct_imp()
|
||||
{
|
||||
for (_Notify::iterator i = notify_.begin(), e = notify_.end();
|
||||
i != e; ++i)
|
||||
{
|
||||
i->second->unlock();
|
||||
i->first->notify_all();
|
||||
}
|
||||
for (_AsyncStates::iterator i = async_states_.begin(), e = async_states_.end();
|
||||
i != e; ++i)
|
||||
{
|
||||
(*i)->__make_ready();
|
||||
(*i)->__release_shared();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
__thread_struct_imp::notify_all_at_thread_exit(condition_variable* cv, mutex* m)
|
||||
{
|
||||
notify_.push_back(pair<condition_variable*, mutex*>(cv, m));
|
||||
}
|
||||
|
||||
void
|
||||
__thread_struct_imp::__make_ready_at_thread_exit(__assoc_sub_state* __s)
|
||||
{
|
||||
async_states_.push_back(__s);
|
||||
__s->__add_shared();
|
||||
}
|
||||
|
||||
// __thread_struct
|
||||
|
||||
__thread_struct::__thread_struct()
|
||||
: __p_(new __thread_struct_imp)
|
||||
{
|
||||
}
|
||||
|
||||
__thread_struct::~__thread_struct()
|
||||
{
|
||||
delete __p_;
|
||||
}
|
||||
|
||||
void
|
||||
__thread_struct::notify_all_at_thread_exit(condition_variable* cv, mutex* m)
|
||||
{
|
||||
__p_->notify_all_at_thread_exit(cv, m);
|
||||
}
|
||||
|
||||
void
|
||||
__thread_struct::__make_ready_at_thread_exit(__assoc_sub_state* __s)
|
||||
{
|
||||
__p_->__make_ready_at_thread_exit(__s);
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -7,9 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include <stdlib.h>
|
||||
#if __APPLE__
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
|
||||
#include "typeinfo"
|
||||
|
||||
@@ -40,11 +37,3 @@ std::bad_typeid::what() const throw()
|
||||
{
|
||||
return "std::bad_typeid";
|
||||
}
|
||||
|
||||
#if __APPLE__
|
||||
// On Darwin, the cxa_bad_* functions cannot be in the lower level library
|
||||
// because bad_cast and bad_typeid are defined in his higher level library
|
||||
void __cxxabiv1::__cxa_bad_typeid() { throw std::bad_typeid(); }
|
||||
void __cxxabiv1::__cxa_bad_cast() { throw std::bad_cast(); }
|
||||
#endif
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ test()
|
||||
assert(ia[i] == ib[i]);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class InIter, class OutIter>
|
||||
void
|
||||
@@ -56,7 +56,7 @@ test1()
|
||||
assert(*ib[i] == i);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -95,7 +95,7 @@ int main()
|
||||
test<const int*, random_access_iterator<int*> >();
|
||||
test<const int*, int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
test1<input_iterator<std::unique_ptr<int>*>, output_iterator<std::unique_ptr<int>*> >();
|
||||
test1<input_iterator<std::unique_ptr<int>*>, input_iterator<std::unique_ptr<int>*> >();
|
||||
test1<input_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
|
||||
@@ -130,5 +130,5 @@ int main()
|
||||
test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ test()
|
||||
assert(ia[i] == ib[i]);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class InIter, class OutIter>
|
||||
void
|
||||
@@ -56,7 +56,7 @@ test1()
|
||||
assert(*ib[i] == i);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -72,7 +72,7 @@ int main()
|
||||
test<const int*, random_access_iterator<int*> >();
|
||||
test<const int*, int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*>, std::unique_ptr<int>*>();
|
||||
@@ -84,5 +84,5 @@ int main()
|
||||
test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -283,7 +283,7 @@ test()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
struct is_null
|
||||
{
|
||||
@@ -300,7 +300,7 @@ test1()
|
||||
Iter r = std::stable_partition(Iter(array), Iter(array+size), is_null());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -308,7 +308,7 @@ int main()
|
||||
test<random_access_iterator<std::pair<int,int>*> >();
|
||||
test<std::pair<int,int>*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
#endif
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -39,7 +39,7 @@ test()
|
||||
assert(ia[5] == 4);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class Iter>
|
||||
void
|
||||
@@ -63,7 +63,7 @@ test1()
|
||||
assert(*ia[5] == 4);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -72,12 +72,12 @@ int main()
|
||||
test<random_access_iterator<int*> >();
|
||||
test<int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
test1<forward_iterator<std::unique_ptr<int>*> >();
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*>();
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,7 @@ test()
|
||||
assert(ia[5] == 4);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
struct pred
|
||||
{
|
||||
@@ -72,7 +72,7 @@ test1()
|
||||
assert(*ia[5] == 4);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -81,12 +81,12 @@ int main()
|
||||
test<random_access_iterator<int*> >();
|
||||
test<int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
test1<forward_iterator<std::unique_ptr<int>*> >();
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*>();
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -213,7 +213,7 @@ test()
|
||||
assert(ig[5] == 2);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class Iter>
|
||||
void
|
||||
@@ -419,7 +419,7 @@ test1()
|
||||
assert(*ig[5] == 2);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -428,12 +428,12 @@ int main()
|
||||
test<random_access_iterator<int*> >();
|
||||
test<int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
test1<forward_iterator<std::unique_ptr<int>*> >();
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*>();
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ test()
|
||||
assert(j[2] == 3);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class Iter1, class Iter2>
|
||||
void
|
||||
@@ -60,7 +60,7 @@ test1()
|
||||
assert(*j[2] == 3);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -84,7 +84,7 @@ int main()
|
||||
test<int*, random_access_iterator<int*> >();
|
||||
test<int*, int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
test1<forward_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
|
||||
test1<forward_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
@@ -106,5 +106,5 @@ int main()
|
||||
test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -84,7 +84,7 @@ test()
|
||||
assert(ii[2] == 2);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
struct do_nothing
|
||||
{
|
||||
@@ -169,7 +169,7 @@ test1()
|
||||
assert(*ii[2] == 2);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -178,12 +178,12 @@ int main()
|
||||
test<random_access_iterator<int*> >();
|
||||
test<int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
test1<forward_iterator<Ptr*> >();
|
||||
test1<bidirectional_iterator<Ptr*> >();
|
||||
test1<random_access_iterator<Ptr*> >();
|
||||
test1<Ptr*>();
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
@@ -110,7 +110,7 @@ test()
|
||||
assert(count_equal::count == si-1);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
struct do_nothing
|
||||
{
|
||||
@@ -211,7 +211,7 @@ test1()
|
||||
assert(count_equal::count == si-1);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -220,12 +220,12 @@ int main()
|
||||
test<random_access_iterator<int*> >();
|
||||
test<int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
test1<forward_iterator<Ptr*> >();
|
||||
test1<bidirectional_iterator<Ptr*> >();
|
||||
test1<random_access_iterator<Ptr*> >();
|
||||
test1<Ptr*>();
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
|
||||
struct indirect_less
|
||||
@@ -27,7 +27,7 @@ struct indirect_less
|
||||
{return *x < *y;}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void test(unsigned N)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ int main()
|
||||
test(10);
|
||||
test(1000);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
{
|
||||
const int N = 1000;
|
||||
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
|
||||
@@ -60,5 +60,5 @@ int main()
|
||||
assert(std::is_heap(ia, ia+N, indirect_less()));
|
||||
delete [] ia;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
|
||||
struct indirect_less
|
||||
@@ -27,7 +27,7 @@ struct indirect_less
|
||||
{return *x < *y;}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void test(unsigned N)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ int main()
|
||||
{
|
||||
test(1000);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
{
|
||||
const int N = 1000;
|
||||
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
|
||||
@@ -64,5 +64,5 @@ int main()
|
||||
}
|
||||
delete [] ia;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
|
||||
struct indirect_less
|
||||
@@ -28,7 +28,7 @@ struct indirect_less
|
||||
{return *x < *y;}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void test(unsigned N)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ int main()
|
||||
{
|
||||
test(1000);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
{
|
||||
const int N = 1000;
|
||||
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
|
||||
@@ -62,5 +62,5 @@ int main()
|
||||
}
|
||||
delete [] ia;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
|
||||
struct indirect_less
|
||||
@@ -27,7 +27,7 @@ struct indirect_less
|
||||
{return *x < *y;}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void test(unsigned N)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ int main()
|
||||
test(10);
|
||||
test(1000);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
{
|
||||
const int N = 1000;
|
||||
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
|
||||
@@ -62,5 +62,5 @@ int main()
|
||||
assert(std::is_sorted(ia, ia+N, indirect_less()));
|
||||
delete [] ia;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
#include <memory>
|
||||
|
||||
struct indirect_less
|
||||
@@ -28,7 +28,7 @@ struct indirect_less
|
||||
{return *x < *y;}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
#include "../../iterators.h"
|
||||
|
||||
@@ -89,7 +89,7 @@ int main()
|
||||
test<random_access_iterator<int*> >();
|
||||
test<int*>();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
{
|
||||
unsigned N = 100;
|
||||
unsigned M = 50;
|
||||
@@ -108,5 +108,5 @@ int main()
|
||||
}
|
||||
delete [] ia;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
int i = std::max({2, 3, 1});
|
||||
assert(i == 3);
|
||||
i = std::max({2, 1, 3});
|
||||
@@ -31,5 +31,5 @@ int main()
|
||||
assert(i == 3);
|
||||
i = std::max({1, 3, 2});
|
||||
assert(i == 3);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
int i = std::max({2, 3, 1}, std::greater<int>());
|
||||
assert(i == 1);
|
||||
i = std::max({2, 1, 3}, std::greater<int>());
|
||||
@@ -32,5 +32,5 @@ int main()
|
||||
assert(i == 1);
|
||||
i = std::max({1, 3, 2}, std::greater<int>());
|
||||
assert(i == 1);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user