aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/vector
diff options
context:
space:
mode:
authorAndrey Khalyavin <halyavin@gmail.com>2022-04-15 02:46:40 +0300
committerAndrey Khalyavin <halyavin@gmail.com>2022-04-15 02:46:40 +0300
commitc5bfd90690e2df55f55d1831b0edd2e1c7241582 (patch)
treecda6bc446bf17fc110b67126b4c5ddc640fa427b /contrib/libs/cxxsupp/libcxx/include/vector
parent599463a2ac4bda8536564ec6d7b798447755f05f (diff)
downloadydb-c5bfd90690e2df55f55d1831b0edd2e1c7241582.tar.gz
Update libc++ to b6d87773 (14 Jan 2022).
Notable changes: * implement operator << for filesystem::directory_entry * add std::ranges::in_in_result * add std::ranges::owning_view * add std::ranges::cdata * add std::ranges::construct_at and destroy{,_n,_at} * small fixes in std::ranges::data * SFINAE away std::ranges::cbegin(const T&&) for non-borrowed T * use arc4random to implement std::random_device on Apple * introduce __fits_in_sso to put constexpr check into a central place * introduce __debug_db_insert_c to put #if and constexpr check into a central place ref:b3dd06bd52f06e8939227ca0f0a5873d0c211e48
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/vector')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/vector66
1 files changed, 18 insertions, 48 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/vector b/contrib/libs/cxxsupp/libcxx/include/vector
index 0050fc4f8c..3d4d1eaff9 100644
--- a/contrib/libs/cxxsupp/libcxx/include/vector
+++ b/contrib/libs/cxxsupp/libcxx/include/vector
@@ -376,11 +376,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
- {
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
- }
+ {
+ _VSTD::__debug_db_insert_c(this);
+ }
_LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a)
#if _LIBCPP_STD_VER <= 14
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
@@ -389,9 +387,7 @@ public:
#endif
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
}
explicit vector(size_type __n);
#if _LIBCPP_STD_VER > 11
@@ -403,9 +399,7 @@ public:
vector(size_type __n, const value_type& __x, const allocator_type& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1134,9 +1128,7 @@ vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)
template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(size_type __n)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1149,9 +1141,7 @@ template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1163,9 +1153,7 @@ vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__n > 0)
{
__vallocate(__n);
@@ -1183,9 +1171,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first,
typename iterator_traits<_InputIterator>::reference>::value,
_InputIterator>::type __last)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
for (; __first != __last; ++__first)
__emplace_back(*__first);
}
@@ -1200,9 +1186,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c
typename iterator_traits<_InputIterator>::reference>::value>::type*)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
for (; __first != __last; ++__first)
__emplace_back(*__first);
}
@@ -1216,9 +1200,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first,
typename iterator_traits<_ForwardIterator>::reference>::value,
_ForwardIterator>::type __last)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
@@ -1236,9 +1218,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las
typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
@@ -1251,9 +1231,7 @@ template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(const vector& __x)
: __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc()))
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
size_type __n = __x.size();
if (__n > 0)
{
@@ -1266,9 +1244,7 @@ template <class _Tp, class _Allocator>
vector<_Tp, _Allocator>::vector(const vector& __x, const __identity_t<allocator_type>& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
size_type __n = __x.size();
if (__n > 0)
{
@@ -1289,8 +1265,8 @@ vector<_Tp, _Allocator>::vector(vector&& __x)
#endif
: __base(_VSTD::move(__x.__alloc()))
{
+ _VSTD::__debug_db_insert_c(this);
#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
__get_db()->swap(this, _VSTD::addressof(__x));
#endif
this->__begin_ = __x.__begin_;
@@ -1304,9 +1280,7 @@ inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(vector&& __x, const __identity_t<allocator_type>& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__a == __x.__alloc())
{
this->__begin_ = __x.__begin_;
@@ -1328,9 +1302,7 @@ template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__il.size() > 0)
{
__vallocate(__il.size());
@@ -1343,9 +1315,7 @@ inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)
: __base(__a)
{
-#if _LIBCPP_DEBUG_LEVEL == 2
- __get_db()->__insert_c(this);
-#endif
+ _VSTD::__debug_db_insert_c(this);
if (__il.size() > 0)
{
__vallocate(__il.size());