From 549545b64aab77d2a1784062451ee1c33f8324d2 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 16 Dec 2019 18:23:39 -0500 Subject: [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. --- libcxx/include/vector | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libcxx/include/vector') diff --git a/libcxx/include/vector b/libcxx/include/vector index a8289734e12..8366bb5d11e 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -433,7 +433,7 @@ __vector_base<_Tp, _Allocator>::__vector_base() _NOEXCEPT_(is_nothrow_default_constructible::value) : __begin_(nullptr), __end_(nullptr), - __end_cap_(nullptr) + __end_cap_(nullptr, __default_init_tag()) { } @@ -2622,7 +2622,7 @@ vector::vector() _NOEXCEPT_(is_nothrow_default_constructible::value) : __begin_(nullptr), __size_(0), - __cap_alloc_(0) + __cap_alloc_(0, __default_init_tag()) { } @@ -2644,7 +2644,7 @@ template vector::vector(size_type __n) : __begin_(nullptr), __size_(0), - __cap_alloc_(0) + __cap_alloc_(0, __default_init_tag()) { if (__n > 0) { @@ -2672,7 +2672,7 @@ template vector::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 @@ vector::vector(_InputIterator __first, _InputIterator __last, !__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 @@ vector::vector(_ForwardIterator __first, _ForwardIterator __la 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(_VSTD::distance(__first, __last)); if (__n > 0) @@ -2786,7 +2786,7 @@ template vector::vector(initializer_list __il) : __begin_(nullptr), __size_(0), - __cap_alloc_(0) + __cap_alloc_(0, __default_init_tag()) { size_type __n = static_cast(__il.size()); if (__n > 0) -- cgit v1.2.3