[libc++] Rework compressed pair constructors.
This patch de-duplicates most compressed pair constructors
to use the same code in C++11 and C++03.
Part of doing that is deleting the "__second_tag()" and replacing
it with a "__value_init_tag()" which has the same effect, but
allows for the removal of the special "one-arg" first element
constructor.
This patch is intended to have no semantic change.
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 549545b64aab77d2a1784062451ee1c33f8324d2
diff --git a/include/__tree b/include/__tree
index 8b6509c..cb7a102 100644
--- a/include/__tree
+++ b/include/__tree
@@ -1577,8 +1577,8 @@
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
: __begin_node_(__iter_pointer()),
- __pair1_(__second_tag(), __node_allocator(__a)),
- __pair3_(0)
+ __pair1_(__default_init_tag(), __node_allocator(__a)),
+ __pair3_(0, __default_init_tag())
{
__begin_node() = __end_node();
}
@@ -1587,7 +1587,7 @@
__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp,
const allocator_type& __a)
: __begin_node_(__iter_pointer()),
- __pair1_(__second_tag(), __node_allocator(__a)),
+ __pair1_(__default_init_tag(), __node_allocator(__a)),
__pair3_(0, __comp)
{
__begin_node() = __end_node();
@@ -1700,7 +1700,7 @@
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
: __begin_node_(__iter_pointer()),
- __pair1_(__second_tag(), __node_traits::select_on_container_copy_construction(__t.__node_alloc())),
+ __pair1_(__default_init_tag(), __node_traits::select_on_container_copy_construction(__t.__node_alloc())),
__pair3_(0, __t.value_comp())
{
__begin_node() = __end_node();
@@ -1730,7 +1730,7 @@
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
- : __pair1_(__second_tag(), __node_allocator(__a)),
+ : __pair1_(__default_init_tag(), __node_allocator(__a)),
__pair3_(0, _VSTD::move(__t.value_comp()))
{
if (__a == __t.__alloc())