[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/vector b/include/vector
index a828973..8366bb5 100644
--- a/include/vector
+++ b/include/vector
@@ -433,7 +433,7 @@
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __begin_(nullptr),
__end_(nullptr),
- __end_cap_(nullptr)
+ __end_cap_(nullptr, __default_init_tag())
{
}
@@ -2622,7 +2622,7 @@
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __begin_(nullptr),
__size_(0),
- __cap_alloc_(0)
+ __cap_alloc_(0, __default_init_tag())
{
}
@@ -2644,7 +2644,7 @@
vector<bool, _Allocator>::vector(size_type __n)
: __begin_(nullptr),
__size_(0),
- __cap_alloc_(0)
+ __cap_alloc_(0, __default_init_tag())
{
if (__n > 0)
{
@@ -2672,7 +2672,7 @@
vector<bool, _Allocator>::vector(size_type __n, const value_type& __x)
: __begin_(nullptr),
__size_(0),
- __cap_alloc_(0)
+ __cap_alloc_(0, __default_init_tag())
{
if (__n > 0)
{
@@ -2701,7 +2701,7 @@
!__is_cpp17_forward_iterator<_InputIterator>::value>::type*)
: __begin_(nullptr),
__size_(0),
- __cap_alloc_(0)
+ __cap_alloc_(0, __default_init_tag())
{
#ifndef _LIBCPP_NO_EXCEPTIONS
try
@@ -2754,7 +2754,7 @@
typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value>::type*)
: __begin_(nullptr),
__size_(0),
- __cap_alloc_(0)
+ __cap_alloc_(0, __default_init_tag())
{
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
@@ -2786,7 +2786,7 @@
vector<bool, _Allocator>::vector(initializer_list<value_type> __il)
: __begin_(nullptr),
__size_(0),
- __cap_alloc_(0)
+ __cap_alloc_(0, __default_init_tag())
{
size_type __n = static_cast<size_type>(__il.size());
if (__n > 0)