aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/__split_buffer
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2013-02-17 14:29:14 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2013-03-25 00:34:11 +0700
commit59ff5a6a3c3e1f5255c5cf29f98df633a77b89b3 (patch)
treec7660fa62600366e3479dbf6b2fd1d25709af1b5 /system/include/libcxx/__split_buffer
parent80fd6f0bce2b95db6ec539c9275ce24585550e7c (diff)
Update to current libcxx.
This doesn't work yet as it needs to be customized for use with emscripten still.
Diffstat (limited to 'system/include/libcxx/__split_buffer')
-rw-r--r--system/include/libcxx/__split_buffer32
1 files changed, 19 insertions, 13 deletions
diff --git a/system/include/libcxx/__split_buffer b/system/include/libcxx/__split_buffer
index d5b8f0a3..e0aa13b8 100644
--- a/system/include/libcxx/__split_buffer
+++ b/system/include/libcxx/__split_buffer
@@ -6,7 +6,11 @@
#include <type_traits>
#include <algorithm>
+#include <__undef_min_max>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -91,7 +95,7 @@ public:
void reserve(size_type __n);
void shrink_to_fit() _NOEXCEPT;
void push_front(const_reference __x);
- void push_back(const_reference __x);
+ _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
void push_front(value_type&& __x);
void push_back(value_type&& __x);
@@ -129,8 +133,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last) _NOEXCEPT
- {__destruct_at_end(__new_last, is_trivially_destructible<value_type>());}
+ {__destruct_at_end(__new_last, false_type());}
+ _LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
void swap(__split_buffer& __x)
@@ -148,7 +154,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__split_buffer& __c, false_type) _NOEXCEPT
+ void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT
{}
_LIBCPP_INLINE_VISIBILITY
@@ -167,7 +173,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, false_type) _NOEXCEPT
+ static void __swap_alloc(__alloc_rr&, __alloc_rr&, false_type) _NOEXCEPT
{}
};
@@ -283,7 +289,7 @@ _LIBCPP_INLINE_VISIBILITY inline
void
__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
{
- while (__begin_ < __new_begin)
+ while (__begin_ != __new_begin)
__alloc_traits::destroy(__alloc(), __begin_++);
}
@@ -300,7 +306,7 @@ _LIBCPP_INLINE_VISIBILITY inline
void
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
{
- while (__new_last < __end_)
+ while (__new_last != __end_)
__alloc_traits::destroy(__alloc(), --__end_);
}
@@ -388,8 +394,8 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al
__first_ = __alloc_traits::allocate(__alloc(), __cap);
__begin_ = __end_ = __first_;
__end_cap() = __first_ + __cap;
- typedef move_iterator<iterator> _I;
- __construct_at_end(_I(__c.begin()), _I(__c.end()));
+ typedef move_iterator<iterator> _Ip;
+ __construct_at_end(_Ip(__c.begin()), _Ip(__c.end()));
}
}
@@ -486,7 +492,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
}
else
{
- size_type __c = max<size_type>(2 * (__end_cap() - __first_), 1);
+ size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
__split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -517,7 +523,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
}
else
{
- size_type __c = max<size_type>(2 * (__end_cap() - __first_), 1);
+ size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
__split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -550,7 +556,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
}
else
{
- size_type __c = max<size_type>(2 * (__end_cap() - __first_), 1);
+ size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -581,7 +587,7 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
}
else
{
- size_type __c = max<size_type>(2 * (__end_cap() - __first_), 1);
+ size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -614,7 +620,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
}
else
{
- size_type __c = max<size_type>(2 * (__end_cap() - __first_), 1);
+ size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));