11#ifndef INCLUDED_BSLSTL_VECTOR_CPP03
12#define INCLUDED_BSLSTL_VECTOR_CPP03
63#ifdef COMPILING_BSLSTL_VECTOR_H
69template <
class VALUE_TYPE,
class ITERATOR>
70class vector_UintPtrConversionIterator;
96 static void swap(
void *a,
void *b);
113template <
class BSLSTL_ITERATOR,
115struct Vector_DeduceIteratorCategory {
118 typedef typename bsl::iterator_traits<BSLSTL_ITERATOR>::iterator_category
126template <
class BSLSTL_ITERATOR>
127struct Vector_DeduceIteratorCategory<BSLSTL_ITERATOR, true> {
130 typedef BloombergLP::bslmf::Nil
type;
147template <class TARGET, class ITERATOR, bool = is_integral<ITERATOR>::value>
148struct vector_ForwardIteratorForPtrs {
151 typedef ITERATOR
type;
158template <
class TARGET,
class ITERATOR>
159struct vector_ForwardIteratorForPtrs<TARGET, ITERATOR, false> {
162 typedef vector_UintPtrConversionIterator<TARGET *, ITERATOR>
type;
165#if defined(BSLS_ASSERT_SAFE_IS_USED)
167template <
class BSLSTL_ITERATOR>
168struct Vector_IsRandomAccessIterator :
169 bsl::is_same<typename Vector_DeduceIteratorCategory<BSLSTL_ITERATOR>::type,
170 bsl::random_access_iterator_tag>::type
179struct Vector_RangeCheck {
189 template <
class BSLSTL_ITERATOR>
192 !Vector_IsRandomAccessIterator<BSLSTL_ITERATOR>::value,
bool>::type
193 isInvalidRange(BSLSTL_ITERATOR, BSLSTL_ITERATOR);
197 template <
class BSLSTL_ITERATOR>
200 Vector_IsRandomAccessIterator<BSLSTL_ITERATOR>::value,
bool>::type
201 isInvalidRange(BSLSTL_ITERATOR first, BSLSTL_ITERATOR last);
223template <
class VALUE_TYPE>
230 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
261 void adopt(BloombergLP::bslmf::MovableRef<vectorBase> base);
413template <class VALUE_TYPE, class ALLOCATOR = allocator<VALUE_TYPE> >
415 , private BloombergLP::
bslalg::ContainerBase<ALLOCATOR> {
421 typedef BloombergLP::bslalg::ArrayPrimitives ArrayPrimitives;
425 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
429 typedef BloombergLP::bslma::AllocatorUtil AllocatorUtil;
433 typedef allocator_traits<ALLOCATOR> AllocatorTraits;
438 typedef ALLOCATOR allocator_type;
442 typedef typename AllocatorTraits::size_type
size_type;
444 typedef typename AllocatorTraits::pointer pointer;
445 typedef typename AllocatorTraits::const_pointer const_pointer;
456 typedef vectorBase<VALUE_TYPE> ImpBase;
460 typedef BloombergLP::bslalg::ContainerBase<ALLOCATOR> ContainerBase;
469 VALUE_TYPE *d_data_p;
470 std::size_t d_capacity;
471 ContainerBase *d_container_p;
475 Proctor(
const Proctor&);
476 Proctor& operator=(
const Proctor&);
485 Proctor(VALUE_TYPE *data,
486 std::size_t capacity,
487 ContainerBase *container);
507 template <
class FWD_ITER>
508 void constructFromRange(FWD_ITER first,
510 std::forward_iterator_tag);
511 template <
class INPUT_ITER>
512 void constructFromRange(INPUT_ITER first,
514 std::input_iterator_tag);
522 template <
class INTEGRAL>
523 void constructFromRange(INTEGRAL initialSize,
525 BloombergLP::bslmf::Nil);
529 template <
class INPUT_ITER>
530 void privateInsertDispatch(
534 BloombergLP::bslmf::MatchArithmeticType ,
535 BloombergLP::bslmf::Nil );
538 template <
class INPUT_ITER>
542 BloombergLP::bslmf::MatchAnyType ,
543 BloombergLP::bslmf::MatchAnyType );
546 template <
class INPUT_ITER>
550 const std::input_iterator_tag&);
554 template <
class FWD_ITER>
558 const std::forward_iterator_tag&);
563 void privateMoveInsert(vector *fromVector,
568 void privateReserveEmpty(
size_type numElements);
570#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
573#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT
574#define BSLSTL_VECTOR_VARIADIC_LIMIT 10
576#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT_A
577#define BSLSTL_VECTOR_VARIADIC_LIMIT_A BSLSTL_VECTOR_VARIADIC_LIMIT
579#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 0
580 void privateEmplaceBackWithAllocation(
584#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 1
585 template <
class Args_01>
586 void privateEmplaceBackWithAllocation(
590#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 2
591 template <
class Args_01,
593 void privateEmplaceBackWithAllocation(
598#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 3
599 template <
class Args_01,
602 void privateEmplaceBackWithAllocation(
608#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 4
609 template <
class Args_01,
613 void privateEmplaceBackWithAllocation(
620#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 5
621 template <
class Args_01,
626 void privateEmplaceBackWithAllocation(
634#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 6
635 template <
class Args_01,
641 void privateEmplaceBackWithAllocation(
650#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 7
651 template <
class Args_01,
658 void privateEmplaceBackWithAllocation(
668#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 8
669 template <
class Args_01,
677 void privateEmplaceBackWithAllocation(
688#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 9
689 template <
class Args_01,
698 void privateEmplaceBackWithAllocation(
710#if BSLSTL_VECTOR_VARIADIC_LIMIT_A >= 10
711 template <
class Args_01,
721 void privateEmplaceBackWithAllocation(
737 template <
class... Args>
738 void privateEmplaceBackWithAllocation(
746 void privatePushBackWithAllocation(
const VALUE_TYPE& value);
753 void privatePushBackWithAllocation(
754 BloombergLP::bslmf::MovableRef<VALUE_TYPE> value);
786 const ALLOCATOR& basicAllocator = ALLOCATOR());
801 const VALUE_TYPE& value,
802 const ALLOCATOR& basicAllocator = ALLOCATOR());
824 template <class INPUT_ITER>
825 vector(INPUT_ITER first,
827 const ALLOCATOR& basicAllocator = ALLOCATOR());
836 vector(const vector& original);
843 vector(BloombergLP::
bslmf::MovableRef<vector> original)
853 vector(const vector& original,
854 const typename type_identity<ALLOCATOR>::type& basicAllocator);
867 vector(BloombergLP::
bslmf::MovableRef<vector> original,
868 const typename type_identity<ALLOCATOR>::type& basicAllocator);
870#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
871 vector(std::initializer_list<VALUE_TYPE> values,
872 const ALLOCATOR& basicAllocator = ALLOCATOR());
900 vector& operator=(
const vector& rhs);
903 BloombergLP::bslmf::MovableRef<vector<VALUE_TYPE, ALLOCATOR> > rhs)
905 AllocatorTraits::propagate_on_container_move_assignment::value ||
906 AllocatorTraits::is_always_equal::value);
924#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
933 vector& operator=(std::initializer_list<VALUE_TYPE> values);
942 void assign(std::initializer_list<VALUE_TYPE> values);
959 template <
class INPUT_ITER>
960 void assign(INPUT_ITER first, INPUT_ITER last);
1012 void shrink_to_fit();
1016#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1019#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT
1020#define BSLSTL_VECTOR_VARIADIC_LIMIT 10
1022#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT_B
1023#define BSLSTL_VECTOR_VARIADIC_LIMIT_B BSLSTL_VECTOR_VARIADIC_LIMIT
1025#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 0
1026 VALUE_TYPE &emplace_back(
1030#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 1
1031 template <
class Args_01>
1032 VALUE_TYPE &emplace_back(
1036#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 2
1037 template <
class Args_01,
1039 VALUE_TYPE &emplace_back(
1044#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 3
1045 template <
class Args_01,
1048 VALUE_TYPE &emplace_back(
1054#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 4
1055 template <
class Args_01,
1059 VALUE_TYPE &emplace_back(
1066#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 5
1067 template <
class Args_01,
1072 VALUE_TYPE &emplace_back(
1080#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 6
1081 template <
class Args_01,
1087 VALUE_TYPE &emplace_back(
1096#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 7
1097 template <
class Args_01,
1104 VALUE_TYPE &emplace_back(
1114#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 8
1115 template <
class Args_01,
1123 VALUE_TYPE &emplace_back(
1134#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 9
1135 template <
class Args_01,
1144 VALUE_TYPE &emplace_back(
1156#if BSLSTL_VECTOR_VARIADIC_LIMIT_B >= 10
1157 template <
class Args_01,
1167 VALUE_TYPE &emplace_back(
1183 template <
class... Args>
1184 VALUE_TYPE &emplace_back(
1194 void push_back(
const VALUE_TYPE& value);
1203 void push_back(BloombergLP::bslmf::MovableRef<VALUE_TYPE> value);
1209#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1212#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT
1213#define BSLSTL_VECTOR_VARIADIC_LIMIT 10
1215#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT_C
1216#define BSLSTL_VECTOR_VARIADIC_LIMIT_C BSLSTL_VECTOR_VARIADIC_LIMIT
1218#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 0
1226 const iterator& pos =
const_cast<const iterator&
>(position);
1230 maxSize - this->
size())) {
1232 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1233 "vector<...>::emplace(pos,arguments): vector too long");
1237 if (newSize > this->d_capacity) {
1239 newSize, this->d_capacity, maxSize);
1240 vector temp(this->get_allocator());
1241 temp.privateReserveEmpty(newCapacity);
1243 ArrayPrimitives::destructiveMoveAndEmplace(
1246 this->d_dataBegin_p,
1249 this->allocatorRef());
1251 temp.d_dataEnd_p += newSize;
1255 ArrayPrimitives::emplace(
1258 this->allocatorRef());
1262 return this->
begin() + index;
1266#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 1
1267 template <
class Args_01>
1276 const iterator& pos =
const_cast<const iterator&
>(position);
1280 maxSize - this->
size())) {
1282 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1283 "vector<...>::emplace(pos,arguments): vector too long");
1287 if (newSize > this->d_capacity) {
1289 newSize, this->d_capacity, maxSize);
1290 vector temp(this->get_allocator());
1291 temp.privateReserveEmpty(newCapacity);
1293 ArrayPrimitives::destructiveMoveAndEmplace(
1296 this->d_dataBegin_p,
1299 this->allocatorRef(),
1302 temp.d_dataEnd_p += newSize;
1306 ArrayPrimitives::emplace(
1309 this->allocatorRef(),
1314 return this->
begin() + index;
1318#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 2
1319 template <
class Args_01,
1330 const iterator& pos =
const_cast<const iterator&
>(position);
1334 maxSize - this->
size())) {
1336 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1337 "vector<...>::emplace(pos,arguments): vector too long");
1341 if (newSize > this->d_capacity) {
1343 newSize, this->d_capacity, maxSize);
1344 vector temp(this->get_allocator());
1345 temp.privateReserveEmpty(newCapacity);
1347 ArrayPrimitives::destructiveMoveAndEmplace(
1350 this->d_dataBegin_p,
1353 this->allocatorRef(),
1357 temp.d_dataEnd_p += newSize;
1361 ArrayPrimitives::emplace(
1364 this->allocatorRef(),
1370 return this->
begin() + index;
1374#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 3
1375 template <
class Args_01,
1388 const iterator& pos =
const_cast<const iterator&
>(position);
1392 maxSize - this->
size())) {
1394 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1395 "vector<...>::emplace(pos,arguments): vector too long");
1399 if (newSize > this->d_capacity) {
1401 newSize, this->d_capacity, maxSize);
1402 vector temp(this->get_allocator());
1403 temp.privateReserveEmpty(newCapacity);
1405 ArrayPrimitives::destructiveMoveAndEmplace(
1408 this->d_dataBegin_p,
1411 this->allocatorRef(),
1416 temp.d_dataEnd_p += newSize;
1420 ArrayPrimitives::emplace(
1423 this->allocatorRef(),
1430 return this->
begin() + index;
1434#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 4
1435 template <
class Args_01,
1450 const iterator& pos =
const_cast<const iterator&
>(position);
1454 maxSize - this->
size())) {
1456 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1457 "vector<...>::emplace(pos,arguments): vector too long");
1461 if (newSize > this->d_capacity) {
1463 newSize, this->d_capacity, maxSize);
1464 vector temp(this->get_allocator());
1465 temp.privateReserveEmpty(newCapacity);
1467 ArrayPrimitives::destructiveMoveAndEmplace(
1470 this->d_dataBegin_p,
1473 this->allocatorRef(),
1479 temp.d_dataEnd_p += newSize;
1483 ArrayPrimitives::emplace(
1486 this->allocatorRef(),
1494 return this->
begin() + index;
1498#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 5
1499 template <
class Args_01,
1516 const iterator& pos =
const_cast<const iterator&
>(position);
1520 maxSize - this->
size())) {
1522 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1523 "vector<...>::emplace(pos,arguments): vector too long");
1527 if (newSize > this->d_capacity) {
1529 newSize, this->d_capacity, maxSize);
1530 vector temp(this->get_allocator());
1531 temp.privateReserveEmpty(newCapacity);
1533 ArrayPrimitives::destructiveMoveAndEmplace(
1536 this->d_dataBegin_p,
1539 this->allocatorRef(),
1546 temp.d_dataEnd_p += newSize;
1550 ArrayPrimitives::emplace(
1553 this->allocatorRef(),
1562 return this->
begin() + index;
1566#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 6
1567 template <
class Args_01,
1586 const iterator& pos =
const_cast<const iterator&
>(position);
1590 maxSize - this->
size())) {
1592 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1593 "vector<...>::emplace(pos,arguments): vector too long");
1597 if (newSize > this->d_capacity) {
1599 newSize, this->d_capacity, maxSize);
1600 vector temp(this->get_allocator());
1601 temp.privateReserveEmpty(newCapacity);
1603 ArrayPrimitives::destructiveMoveAndEmplace(
1606 this->d_dataBegin_p,
1609 this->allocatorRef(),
1617 temp.d_dataEnd_p += newSize;
1621 ArrayPrimitives::emplace(
1624 this->allocatorRef(),
1634 return this->
begin() + index;
1638#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 7
1639 template <
class Args_01,
1660 const iterator& pos =
const_cast<const iterator&
>(position);
1664 maxSize - this->
size())) {
1666 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1667 "vector<...>::emplace(pos,arguments): vector too long");
1671 if (newSize > this->d_capacity) {
1673 newSize, this->d_capacity, maxSize);
1674 vector temp(this->get_allocator());
1675 temp.privateReserveEmpty(newCapacity);
1677 ArrayPrimitives::destructiveMoveAndEmplace(
1680 this->d_dataBegin_p,
1683 this->allocatorRef(),
1692 temp.d_dataEnd_p += newSize;
1696 ArrayPrimitives::emplace(
1699 this->allocatorRef(),
1710 return this->
begin() + index;
1714#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 8
1715 template <
class Args_01,
1738 const iterator& pos =
const_cast<const iterator&
>(position);
1742 maxSize - this->
size())) {
1744 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1745 "vector<...>::emplace(pos,arguments): vector too long");
1749 if (newSize > this->d_capacity) {
1751 newSize, this->d_capacity, maxSize);
1752 vector temp(this->get_allocator());
1753 temp.privateReserveEmpty(newCapacity);
1755 ArrayPrimitives::destructiveMoveAndEmplace(
1758 this->d_dataBegin_p,
1761 this->allocatorRef(),
1771 temp.d_dataEnd_p += newSize;
1775 ArrayPrimitives::emplace(
1778 this->allocatorRef(),
1790 return this->
begin() + index;
1794#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 9
1795 template <
class Args_01,
1820 const iterator& pos =
const_cast<const iterator&
>(position);
1824 maxSize - this->
size())) {
1826 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1827 "vector<...>::emplace(pos,arguments): vector too long");
1831 if (newSize > this->d_capacity) {
1833 newSize, this->d_capacity, maxSize);
1834 vector temp(this->get_allocator());
1835 temp.privateReserveEmpty(newCapacity);
1837 ArrayPrimitives::destructiveMoveAndEmplace(
1840 this->d_dataBegin_p,
1843 this->allocatorRef(),
1854 temp.d_dataEnd_p += newSize;
1858 ArrayPrimitives::emplace(
1861 this->allocatorRef(),
1874 return this->
begin() + index;
1878#if BSLSTL_VECTOR_VARIADIC_LIMIT_C >= 10
1879 template <
class Args_01,
1906 const iterator& pos =
const_cast<const iterator&
>(position);
1910 maxSize - this->
size())) {
1912 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1913 "vector<...>::emplace(pos,arguments): vector too long");
1917 if (newSize > this->d_capacity) {
1919 newSize, this->d_capacity, maxSize);
1920 vector temp(this->get_allocator());
1921 temp.privateReserveEmpty(newCapacity);
1923 ArrayPrimitives::destructiveMoveAndEmplace(
1926 this->d_dataBegin_p,
1929 this->allocatorRef(),
1941 temp.d_dataEnd_p += newSize;
1945 ArrayPrimitives::emplace(
1948 this->allocatorRef(),
1962 return this->
begin() + index;
1969 template <
class... Args>
1978 const iterator& pos =
const_cast<const iterator&
>(position);
1982 maxSize - this->
size())) {
1984 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
1985 "vector<...>::emplace(pos,arguments): vector too long");
1989 if (newSize > this->d_capacity) {
1991 newSize, this->d_capacity, maxSize);
1992 vector temp(this->get_allocator());
1993 temp.privateReserveEmpty(newCapacity);
1995 ArrayPrimitives::destructiveMoveAndEmplace(
1998 this->d_dataBegin_p,
2001 this->allocatorRef(),
2004 temp.d_dataEnd_p += newSize;
2008 ArrayPrimitives::emplace(
2011 this->allocatorRef(),
2016 return this->
begin() + index;
2047 BloombergLP::bslmf::MovableRef<VALUE_TYPE> value);
2062 const VALUE_TYPE& value);
2084 template <
class INPUT_ITER>
2103 privateInsertDispatch(
2104 position, first, last, first, BloombergLP::bslmf::Nil());
2105 return this->
begin() + index;
2108#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2121 std::initializer_list<VALUE_TYPE> values);
2144 AllocatorTraits::propagate_on_container_swap::value ||
2145 AllocatorTraits::is_always_equal::value);
2193template <class VALUE_TYPE, class ALLOCATOR>
2194bool operator==(const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2195 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2197#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2198template <
class VALUE_TYPE,
class ALLOCATOR>
2199bool operator!=(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2200 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2211#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
2216template <
class VALUE_TYPE,
class ALLOCATOR>
2217BloombergLP::bslalg::SynthThreeWayUtil::Result<VALUE_TYPE> operator<=>(
2218 const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2219 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2223template <
class VALUE_TYPE,
class ALLOCATOR>
2224bool operator<(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2225 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2238template <
class VALUE_TYPE,
class ALLOCATOR>
2239bool operator>(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2240 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2249template <
class VALUE_TYPE,
class ALLOCATOR>
2250bool operator<=(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2251 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2260template <
class VALUE_TYPE,
class ALLOCATOR>
2261bool operator>=(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
2262 const vector<VALUE_TYPE, ALLOCATOR>& rhs);
2277template <
class VALUE_TYPE,
class ALLOCATOR,
class BDE_OTHER_TYPE>
2279erase(vector<VALUE_TYPE, ALLOCATOR>& vec,
const BDE_OTHER_TYPE& value);
2283template <
class VALUE_TYPE,
class ALLOCATOR,
class PREDICATE>
2285erase_if(vector<VALUE_TYPE, ALLOCATOR>& vec, PREDICATE predicate);
2287template <
class VALUE_TYPE,
class ALLOCATOR>
2288void swap(vector<VALUE_TYPE, ALLOCATOR>& a,
2289 vector<VALUE_TYPE, ALLOCATOR>& b)
2319template <
class VALUE_TYPE,
class ALLOCATOR>
2320class vector<VALUE_TYPE *, ALLOCATOR>
2324 typedef BloombergLP::bsls::Types::UintPtr UintPtr;
2325#if defined(BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES)
2326 typedef typename allocator_traits<ALLOCATOR>::
2327 template rebind_alloc<UintPtr> ImplAlloc;
2329 typedef typename ALLOCATOR::template rebind<UintPtr>::other ImplAlloc;
2331 typedef vector<UintPtr, ImplAlloc> Impl;
2332 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
2346 typedef ALLOCATOR allocator_type;
2347 typedef typename ALLOCATOR::pointer pointer;
2348 typedef typename ALLOCATOR::const_pointer const_pointer;
2360 const ALLOCATOR& basicAllocator = ALLOCATOR());
2364 const ALLOCATOR& basicAllocator = ALLOCATOR());
2366 template <class INPUT_ITER>
2367 vector(INPUT_ITER first,
2369 const ALLOCATOR& basicAllocator = ALLOCATOR());
2371 vector(const vector& original);
2373 vector(BloombergLP::
bslmf::MovableRef<vector> original)
2376 vector(const vector& original,
2377 const typename type_identity<ALLOCATOR>::type& basicAllocator);
2379 vector(BloombergLP::
bslmf::MovableRef<vector> original,
2380 const typename type_identity<ALLOCATOR>::type& basicAllocator);
2383#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2384 vector(std::initializer_list<VALUE_TYPE *> values,
2385 const ALLOCATOR& basicAllocator = ALLOCATOR());
2391 vector& operator=(
const vector& rhs);
2396 BloombergLP::bslmf::MovableRef<vector<VALUE_TYPE *, ALLOCATOR> > rhs)
2398 d_impl = MoveUtil::move(MoveUtil::access(rhs).d_impl)))
2400 d_impl = MoveUtil::move(MoveUtil::access(rhs).d_impl);
2404#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2405 vector& operator=(std::initializer_list<VALUE_TYPE *> values);
2407 void assign(std::initializer_list<VALUE_TYPE *> values);
2411 template <
class INPUT_ITER>
2412 void assign(INPUT_ITER first, INPUT_ITER last);
2437 void resize(
size_type newLength, VALUE_TYPE *value);
2440 void shrink_to_fit();
2446# if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
2447 template <
class ARG>
2453 void push_back(VALUE_TYPE *value);
2459# if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
2460 template <
class ARG>
2471 template <
class INPUT_ITER>
2479 typedef typename vector_ForwardIteratorForPtrs<VALUE_TYPE,
2480 INPUT_ITER>::type Iter;
2483 (
const UintPtr *)position, Iter(first), Iter(last));
2486#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2488 std::initializer_list<VALUE_TYPE *> values);
2494 void swap(vector<VALUE_TYPE *, ALLOCATOR>& other)
2496 d_impl.swap(other.d_impl)));
2536 bool operator==(const vector& lhs, const vector& rhs)
2538 return lhs.d_impl == rhs.d_impl;
2541#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
2543 friend BloombergLP::bslalg::SynthThreeWayUtil::Result<Impl>
2544 operator<=>(
const vector& lhs,
const vector& rhs)
2546 return BloombergLP::bslalg::SynthThreeWayUtil::compare(lhs.d_impl,
2553 bool operator!=(
const vector& lhs,
const vector& rhs)
2555 return lhs.d_impl != rhs.d_impl;
2559 bool operator<(
const vector& lhs,
const vector& rhs)
2561 return lhs.d_impl < rhs.d_impl;
2565 bool operator>(
const vector& lhs,
const vector& rhs)
2567 return lhs.d_impl > rhs.d_impl;
2571 bool operator<=(
const vector& lhs,
const vector& rhs)
2573 return lhs.d_impl <= rhs.d_impl;
2577 bool operator>=(
const vector& lhs,
const vector& rhs)
2579 return lhs.d_impl >= rhs.d_impl;
2585 void swap(vector& a, vector& b)
2587 a.d_impl.swap(b.d_impl)))
2589 a.d_impl.swap(b.d_impl);
2593#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2605 class = bsl::enable_if_t<
2606 bsl::is_convertible_v<
2609 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2611vector(SIZE_TYPE, VALUE, ALLOC *) -> vector<VALUE>;
2616 class INPUT_ITERATOR,
2618 typename BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>
2620vector(INPUT_ITERATOR, INPUT_ITERATOR) -> vector<VALUE>;
2627 class INPUT_ITERATOR,
2630 typename BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
2631 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
2633vector(INPUT_ITERATOR, INPUT_ITERATOR, ALLOCATOR) -> vector<VALUE, ALLOCATOR>;
2640 class INPUT_ITERATOR,
2643 typename BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
2645 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2647vector(INPUT_ITERATOR, INPUT_ITERATOR, ALLOC *)
2658 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2660vector(std::initializer_list<VALUE>, ALLOC *)
2685template <
class VALUE_TYPE,
class ITERATOR>
2686class vector_UintPtrConversionIterator {
2694 typedef BloombergLP::bsls::Types::UintPtr UintPtr;
2696 typedef UintPtr value_type;
2697 typedef UintPtr *pointer;
2698 typedef UintPtr reference;
2699 typedef typename iterator_traits<ITERATOR>::difference_type
2701 typedef typename iterator_traits<ITERATOR>::iterator_category
2707 vector_UintPtrConversionIterator(ITERATOR it);
2713 vector_UintPtrConversionIterator&
operator++();
2721#ifdef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2730 operator<=>(
const vector_UintPtrConversionIterator& other)
const =
default;
2736 bool operator!=(
const vector_UintPtrConversionIterator& lhs,
2737 const vector_UintPtrConversionIterator& rhs)
2744 return lhs.d_iter != rhs.d_iter;
2757 bool operator==(
const vector_UintPtrConversionIterator& lhs,
2758 const vector_UintPtrConversionIterator& rhs)
2760 return lhs.d_iter == rhs.d_iter;
2769 bool operator<(
const vector_UintPtrConversionIterator& lhs,
2770 const vector_UintPtrConversionIterator& rhs)
2772 return lhs.d_iter < rhs.d_iter;
2780 difference_type
operator-(
const vector_UintPtrConversionIterator& lhs,
2781 const vector_UintPtrConversionIterator& rhs)
2783 return lhs.d_iter - rhs.d_iter;
2792template <
class VALUE_TYPE,
class ITERATOR>
2801template <
class VALUE_TYPE,
class ITERATOR>
2803vector_UintPtrConversionIterator<VALUE_TYPE, ITERATOR>&
2804vector_UintPtrConversionIterator<VALUE_TYPE, ITERATOR>::operator++()
2811template <
class VALUE_TYPE,
class ITERATOR>
2813BloombergLP::bsls::Types::UintPtr
2814vector_UintPtrConversionIterator<VALUE_TYPE, ITERATOR>::operator*()
const
2816 VALUE_TYPE
const ptr = *d_iter;
2817 return reinterpret_cast<UintPtr
>(ptr);
2833template <
class VALUE_TYPE,
class ALLOCATOR>
2834class Vector_PushProctor {
2837 VALUE_TYPE *d_target_p;
2838 ALLOCATOR d_allocator;
2842 Vector_PushProctor(
const Vector_PushProctor&);
2843 Vector_PushProctor& operator=(
const Vector_PushProctor&);
2853 Vector_PushProctor(VALUE_TYPE *target,
const ALLOCATOR& allocator);
2859 ~Vector_PushProctor();
2874template <
class VALUE_TYPE,
class ALLOCATOR>
2876Vector_PushProctor<VALUE_TYPE,ALLOCATOR>::Vector_PushProctor(
2878 const ALLOCATOR& allocator)
2880, d_allocator(allocator)
2884template <
class VALUE_TYPE,
class ALLOCATOR>
2886Vector_PushProctor<VALUE_TYPE,ALLOCATOR>::~Vector_PushProctor()
2894template <
class VALUE_TYPE,
class ALLOCATOR>
2896void Vector_PushProctor<VALUE_TYPE,ALLOCATOR>::release()
2901#if defined(BSLS_ASSERT_SAFE_IS_USED)
2906template <
class BSLSTL_ITERATOR>
2908typename enable_if<!Vector_IsRandomAccessIterator<BSLSTL_ITERATOR>::value,
2910Vector_RangeCheck::isInvalidRange(BSLSTL_ITERATOR, BSLSTL_ITERATOR)
2915template <
class BSLSTL_ITERATOR>
2917typename enable_if<Vector_IsRandomAccessIterator<BSLSTL_ITERATOR>::value,
2919Vector_RangeCheck::isInvalidRange(BSLSTL_ITERATOR first, BSLSTL_ITERATOR last)
2921 return last < first;
2930template <
class VALUE_TYPE>
2932vectorBase<VALUE_TYPE>::vectorBase()
2941template <
class VALUE_TYPE>
2944vectorBase<VALUE_TYPE>::adopt(BloombergLP::bslmf::MovableRef<vectorBase> base)
2950 vectorBase& lvalue = base;
2951 d_dataBegin_p = lvalue.d_dataBegin_p;
2952 d_dataEnd_p = lvalue.d_dataEnd_p;
2953 d_capacity = lvalue.d_capacity;
2955 lvalue.d_dataBegin_p = 0;
2956 lvalue.d_dataEnd_p = 0;
2957 lvalue.d_capacity = 0;
2960template <
class VALUE_TYPE>
2962typename vectorBase<VALUE_TYPE>::iterator
2965 return d_dataBegin_p;
2968template <
class VALUE_TYPE>
2970typename vectorBase<VALUE_TYPE>::iterator
2976template <
class VALUE_TYPE>
2978typename vectorBase<VALUE_TYPE>::reverse_iterator
2981 return reverse_iterator(
end());
2984template <
class VALUE_TYPE>
2986typename vectorBase<VALUE_TYPE>::reverse_iterator
2989 return reverse_iterator(
begin());
2994template <
class VALUE_TYPE>
2996typename vectorBase<VALUE_TYPE>::reference
2997vectorBase<VALUE_TYPE>::operator[](size_type position)
3001 return d_dataBegin_p[position];
3004template <
class VALUE_TYPE>
3005typename vectorBase<VALUE_TYPE>::reference
3006vectorBase<VALUE_TYPE>::at(size_type position)
3010 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
3011 "vector<...>::at(position): invalid position");
3013 return d_dataBegin_p[position];
3016template <
class VALUE_TYPE>
3018typename vectorBase<VALUE_TYPE>::reference
3019vectorBase<VALUE_TYPE>::front()
3023 return *d_dataBegin_p;
3026template <
class VALUE_TYPE>
3028typename vectorBase<VALUE_TYPE>::reference
3029vectorBase<VALUE_TYPE>::back()
3033 return *(d_dataEnd_p - 1);
3036template <
class VALUE_TYPE>
3041 return d_dataBegin_p;
3047template <
class VALUE_TYPE>
3049typename vectorBase<VALUE_TYPE>::const_iterator
3052 return d_dataBegin_p;
3055template <
class VALUE_TYPE>
3057typename vectorBase<VALUE_TYPE>::const_iterator
3060 return d_dataBegin_p;
3063template <
class VALUE_TYPE>
3065typename vectorBase<VALUE_TYPE>::const_iterator
3071template <
class VALUE_TYPE>
3073typename vectorBase<VALUE_TYPE>::const_iterator
3079template <
class VALUE_TYPE>
3081typename vectorBase<VALUE_TYPE>::const_reverse_iterator
3084 return const_reverse_iterator(
end());
3087template <
class VALUE_TYPE>
3089typename vectorBase<VALUE_TYPE>::const_reverse_iterator
3092 return const_reverse_iterator(
end());
3095template <
class VALUE_TYPE>
3097typename vectorBase<VALUE_TYPE>::const_reverse_iterator
3100 return const_reverse_iterator(
begin());
3103template <
class VALUE_TYPE>
3105typename vectorBase<VALUE_TYPE>::const_reverse_iterator
3108 return const_reverse_iterator(
begin());
3113template <
class VALUE_TYPE>
3115typename vectorBase<VALUE_TYPE>::size_type
3118 return d_dataEnd_p - d_dataBegin_p;
3121template <
class VALUE_TYPE>
3123typename vectorBase<VALUE_TYPE>::size_type
3129template <
class VALUE_TYPE>
3133 return d_dataEnd_p == d_dataBegin_p;
3137template <
class VALUE_TYPE>
3139typename vectorBase<VALUE_TYPE>::const_reference
3140vectorBase<VALUE_TYPE>::operator[](size_type position)
const
3144 return d_dataBegin_p[position];
3147template <
class VALUE_TYPE>
3148typename vectorBase<VALUE_TYPE>::const_reference
3149vectorBase<VALUE_TYPE>::at(size_type position)
const
3153 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
3154 "const vector<...>::at(position): invalid position");
3156 return d_dataBegin_p[position];
3159template <
class VALUE_TYPE>
3161typename vectorBase<VALUE_TYPE>::const_reference
3162vectorBase<VALUE_TYPE>::front()
const
3166 return *d_dataBegin_p;
3169template <
class VALUE_TYPE>
3171typename vectorBase<VALUE_TYPE>::const_reference
3172vectorBase<VALUE_TYPE>::back()
const
3176 return *(d_dataEnd_p - 1);
3179template <
class VALUE_TYPE>
3184 return d_dataBegin_p;
3192template <
class VALUE_TYPE,
class ALLOCATOR>
3194vector<VALUE_TYPE, ALLOCATOR>::Proctor::Proctor(VALUE_TYPE *data,
3195 std::size_t capacity,
3196 ContainerBase *container)
3198, d_capacity(capacity)
3199, d_container_p(container)
3203template <
class VALUE_TYPE,
class ALLOCATOR>
3205vector<VALUE_TYPE, ALLOCATOR>::Proctor::~Proctor()
3207 using BloombergLP::bslma::AllocatorUtil;
3210 AllocatorUtil::deallocateObject(d_container_p->allocatorRef(),
3211 d_data_p, d_capacity);
3216template <
class VALUE_TYPE,
class ALLOCATOR>
3218void vector<VALUE_TYPE, ALLOCATOR>::Proctor::release()
3228template <
class VALUE_TYPE,
class ALLOCATOR>
3229template <
class FWD_ITER>
3230void vector<VALUE_TYPE, ALLOCATOR>::constructFromRange(
3233 std::forward_iterator_tag)
3239 const size_type maxSize = max_size();
3240 const size_type newSize = bsl::distance(first, last);
3244 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3245 "vector<...>::(range-constructor): input too long");
3248 size_type newCapacity = Vector_Util::computeNewCapacity(newSize,
3251 this->privateReserveEmpty(newCapacity);
3252 Proctor proctor(this->d_dataBegin_p,
3254 static_cast<ContainerBase *
>(
this));
3256 ArrayPrimitives::copyConstruct(this->d_dataEnd_p,
3259 this->allocatorRef());
3261 this->d_dataEnd_p += newSize;
3264template <
class VALUE_TYPE,
class ALLOCATOR>
3265template <
class INPUT_ITER>
3266void vector<VALUE_TYPE, ALLOCATOR>::constructFromRange(
3269 std::input_iterator_tag)
3279 vector temp(this->get_allocator());
3280 while (first != last) {
3281 temp.emplace_back(*first);
3284 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3287template <
class VALUE_TYPE,
class ALLOCATOR>
3288template <
class INTEGRAL>
3289void vector<VALUE_TYPE, ALLOCATOR>::constructFromRange(
3290 INTEGRAL initialSize,
3292 BloombergLP::bslmf::Nil)
3303 static_cast<size_type
>(initialSize) > max_size())) {
3305 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3306 "vector<...>::(repeated-value constructor): input too long");
3309 if (initialSize > 0) {
3310 privateReserveEmpty(initialSize);
3311 Proctor proctor(this->d_dataBegin_p,
3313 static_cast<ContainerBase *
>(
this));
3315 ArrayPrimitives::uninitializedFillN(this->d_dataBegin_p,
3317 static_cast<VALUE_TYPE
>(value),
3318 this->allocatorRef());
3321 this->d_dataEnd_p += initialSize;
3325template <
class VALUE_TYPE,
class ALLOCATOR>
3326template <
class INPUT_ITER>
3328void vector<VALUE_TYPE, ALLOCATOR>::privateInsertDispatch(
3329 const_iterator position,
3332 BloombergLP::bslmf::MatchArithmeticType ,
3333 BloombergLP::bslmf::Nil )
3338 this->insert(position,
3339 static_cast<size_type
>(count),
3340 static_cast<VALUE_TYPE
>(value));
3343template <
class VALUE_TYPE,
class ALLOCATOR>
3344template <
class INPUT_ITER>
3346void vector<VALUE_TYPE, ALLOCATOR>::privateInsertDispatch(
3347 const_iterator position,
3350 BloombergLP::bslmf::MatchAnyType ,
3351 BloombergLP::bslmf::MatchAnyType )
3356 typedef typename iterator_traits<INPUT_ITER>::iterator_category Tag;
3357 this->privateInsert(position, first, last, Tag());
3360template <
class VALUE_TYPE,
class ALLOCATOR>
3361template <
class INPUT_ITER>
3362void vector<VALUE_TYPE, ALLOCATOR>::privateInsert(
3363 const_iterator position,
3366 const std::input_iterator_tag&)
3380 if (first == last) {
3384 if (!this->capacity()) {
3385 privateReserveEmpty(size_type(1));
3386 position = this->d_dataBegin_p;
3389 size_type insertOffset = position - this->d_dataBegin_p;
3390 size_type initialEnd = this->
size();
3391 size_type tailLength = this->
end() - position;
3393 VALUE_TYPE *emplaceBegin = this->d_dataEnd_p;
3394 VALUE_TYPE *emplaceEnd = this->d_dataBegin_p + this->d_capacity;
3395 VALUE_TYPE *emplacePosition = emplaceBegin;
3397 allocator_type alloc(this->get_allocator());
3404 vector resultState(alloc);
3410 BloombergLP::bslma::AutoDestructor<VALUE_TYPE> insertProctor(
3412 while (emplacePosition != emplaceEnd) {
3413 AllocatorTraits::construct(alloc, emplacePosition, *first);
3416 if (++first == last) {
3417 this->d_dataEnd_p = emplacePosition;
3418 insertProctor.release();
3420 ArrayPrimitives::rotate(this->d_dataBegin_p + insertOffset,
3421 this->d_dataBegin_p + initialEnd,
3431 resultState.reserve(this->d_capacity*2);
3432 emplacePosition = resultState.d_dataBegin_p + insertOffset;
3433 ArrayPrimitives::destructiveMove(emplacePosition,
3438 size_type emplaceOffset = (emplaceEnd - emplaceBegin);
3439 insertProctor.reset(emplacePosition);
3440 emplaceBegin = emplacePosition;
3441 emplaceEnd = resultState.d_dataBegin_p + resultState.d_capacity
3443 emplacePosition += emplaceOffset;
3445 while (first != last) {
3446 if (emplacePosition == emplaceEnd) {
3448 vector nextResult(alloc);
3449 nextResult.reserve(resultState.d_capacity*2);
3450 emplacePosition = nextResult.d_dataBegin_p + insertOffset;
3451 ArrayPrimitives::destructiveMove(emplacePosition,
3456 insertProctor.reset(emplacePosition);
3457 emplaceOffset = (emplaceEnd - emplaceBegin);
3458 emplaceBegin = emplacePosition;
3459 emplaceEnd = nextResult.d_dataBegin_p + nextResult.d_capacity
3461 emplacePosition += emplaceOffset;
3463 Vector_Util::swap(&nextResult.d_dataBegin_p,
3464 &resultState.d_dataBegin_p);
3467 AllocatorTraits::construct(alloc, emplacePosition, *first);
3474 ArrayPrimitives::destructiveMove(emplacePosition,
3475 this->d_dataBegin_p + insertOffset,
3476 this->d_dataBegin_p + initialEnd,
3480 this->d_dataEnd_p = this->d_dataBegin_p + insertOffset;
3481 emplacePosition += (initialEnd - insertOffset);
3482 insertProctor.setLength(
3483 insertProctor.length() +
static_cast<int>(initialEnd - insertOffset));
3486 ArrayPrimitives::destructiveMove(resultState.d_dataBegin_p,
3487 this->d_dataBegin_p,
3488 this->d_dataBegin_p + insertOffset,
3494 resultState.d_dataEnd_p = emplacePosition;
3497 insertProctor.release();
3498 this->d_dataEnd_p = this->d_dataBegin_p;
3501 Vector_Util::swap(&this->d_dataBegin_p, &resultState.d_dataBegin_p);
3504template <
class VALUE_TYPE,
class ALLOCATOR>
3505template <
class FWD_ITER>
3506void vector<VALUE_TYPE, ALLOCATOR>::privateInsert(
3507 const_iterator position,
3510 const std::forward_iterator_tag&)
3516 const iterator& pos =
const_cast<iterator
>(position);
3518 const size_type maxSize = max_size();
3519 const size_type n = bsl::distance(first, last);
3523 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3524 "vector<...>::insert(pos,first,last): vector too long");
3527 const size_type newSize = this->
size() + n;
3528 if (newSize > this->d_capacity) {
3529 size_type newCapacity = Vector_Util::computeNewCapacity(
3534 vector temp(this->get_allocator());
3535 temp.privateReserveEmpty(newCapacity);
3537 ArrayPrimitives::destructiveMoveAndInsert(temp.d_dataBegin_p,
3539 this->d_dataBegin_p,
3545 this->allocatorRef());
3546 temp.d_dataEnd_p += newSize;
3547 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3550 ArrayPrimitives::insert(pos,
3555 this->allocatorRef());
3556 this->d_dataEnd_p += n;
3560template <
class VALUE_TYPE,
class ALLOCATOR>
3561void vector<VALUE_TYPE, ALLOCATOR>::privateMoveInsert(
3563 const_iterator position)
3565 const iterator& pos =
const_cast<const iterator&
>(position);
3567 const size_type maxSize = max_size();
3568 const size_type n = fromVector->size();
3571 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3572 "vector<...>::insert(pos,first,last): vector too long");
3575 const size_type newSize = this->
size() + n;
3576 if (newSize > this->d_capacity) {
3577 const size_type newCapacity = Vector_Util::computeNewCapacity(
3582 vector temp(this->get_allocator());
3583 temp.privateReserveEmpty(newCapacity);
3585 ArrayPrimitives::destructiveMoveAndMoveInsert(
3588 &fromVector->d_dataEnd_p,
3589 this->d_dataBegin_p,
3592 fromVector->d_dataBegin_p,
3593 fromVector->d_dataEnd_p,
3595 this->allocatorRef());
3596 temp.d_dataEnd_p += newSize;
3597 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3600 ArrayPrimitives::moveInsert(pos,
3602 &fromVector->d_dataEnd_p,
3603 fromVector->d_dataBegin_p,
3604 fromVector->d_dataEnd_p,
3606 this->allocatorRef());
3607 this->d_dataEnd_p += n;
3611template <
class VALUE_TYPE,
class ALLOCATOR>
3613void vector<VALUE_TYPE, ALLOCATOR>::privateReserveEmpty(size_type numElements)
3618 this->d_dataBegin_p = this->d_dataEnd_p =
3619 AllocatorUtil::allocateObject<VALUE_TYPE>(this->allocatorRef(),
3622 this->d_capacity = numElements;
3625#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
3628#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT
3629#define BSLSTL_VECTOR_VARIADIC_LIMIT 10
3631#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT_D
3632#define BSLSTL_VECTOR_VARIADIC_LIMIT_D BSLSTL_VECTOR_VARIADIC_LIMIT
3634#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 0
3635template <
class VALUE_TYPE,
class ALLOCATOR>
3636void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3641 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3642 "vector<...>:emplace_back(args...): vector too long");
3645 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3648 vector temp(this->get_allocator());
3649 temp.privateReserveEmpty(newCapacity);
3651 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3652 AllocatorTraits::construct(
3653 this->allocatorRef(),
3656 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3657 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3658 this->d_dataBegin_p,
3660 this->allocatorRef());
3663 this->d_dataEnd_p = this->d_dataBegin_p;
3664 temp.d_dataEnd_p = ++pos;
3665 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3669#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 1
3670template <
class VALUE_TYPE,
class ALLOCATOR>
3671template <
class Args_01>
3672void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3677 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3678 "vector<...>:emplace_back(args...): vector too long");
3681 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3684 vector temp(this->get_allocator());
3685 temp.privateReserveEmpty(newCapacity);
3687 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3688 AllocatorTraits::construct(
3689 this->allocatorRef(),
3693 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3694 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3695 this->d_dataBegin_p,
3697 this->allocatorRef());
3700 this->d_dataEnd_p = this->d_dataBegin_p;
3701 temp.d_dataEnd_p = ++pos;
3702 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3706#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 2
3707template <
class VALUE_TYPE,
class ALLOCATOR>
3708template <
class Args_01,
3710void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3716 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3717 "vector<...>:emplace_back(args...): vector too long");
3720 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3723 vector temp(this->get_allocator());
3724 temp.privateReserveEmpty(newCapacity);
3726 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3727 AllocatorTraits::construct(
3728 this->allocatorRef(),
3733 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3734 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3735 this->d_dataBegin_p,
3737 this->allocatorRef());
3740 this->d_dataEnd_p = this->d_dataBegin_p;
3741 temp.d_dataEnd_p = ++pos;
3742 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3746#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 3
3747template <
class VALUE_TYPE,
class ALLOCATOR>
3748template <
class Args_01,
3751void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3758 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3759 "vector<...>:emplace_back(args...): vector too long");
3762 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3765 vector temp(this->get_allocator());
3766 temp.privateReserveEmpty(newCapacity);
3768 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3769 AllocatorTraits::construct(
3770 this->allocatorRef(),
3776 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3777 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3778 this->d_dataBegin_p,
3780 this->allocatorRef());
3783 this->d_dataEnd_p = this->d_dataBegin_p;
3784 temp.d_dataEnd_p = ++pos;
3785 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3789#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 4
3790template <
class VALUE_TYPE,
class ALLOCATOR>
3791template <
class Args_01,
3795void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3803 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3804 "vector<...>:emplace_back(args...): vector too long");
3807 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3810 vector temp(this->get_allocator());
3811 temp.privateReserveEmpty(newCapacity);
3813 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3814 AllocatorTraits::construct(
3815 this->allocatorRef(),
3822 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3823 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3824 this->d_dataBegin_p,
3826 this->allocatorRef());
3829 this->d_dataEnd_p = this->d_dataBegin_p;
3830 temp.d_dataEnd_p = ++pos;
3831 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3835#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 5
3836template <
class VALUE_TYPE,
class ALLOCATOR>
3837template <
class Args_01,
3842void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3851 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3852 "vector<...>:emplace_back(args...): vector too long");
3855 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3858 vector temp(this->get_allocator());
3859 temp.privateReserveEmpty(newCapacity);
3861 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3862 AllocatorTraits::construct(
3863 this->allocatorRef(),
3871 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3872 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3873 this->d_dataBegin_p,
3875 this->allocatorRef());
3878 this->d_dataEnd_p = this->d_dataBegin_p;
3879 temp.d_dataEnd_p = ++pos;
3880 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3884#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 6
3885template <
class VALUE_TYPE,
class ALLOCATOR>
3886template <
class Args_01,
3892void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3902 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3903 "vector<...>:emplace_back(args...): vector too long");
3906 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3909 vector temp(this->get_allocator());
3910 temp.privateReserveEmpty(newCapacity);
3912 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3913 AllocatorTraits::construct(
3914 this->allocatorRef(),
3923 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3924 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3925 this->d_dataBegin_p,
3927 this->allocatorRef());
3930 this->d_dataEnd_p = this->d_dataBegin_p;
3931 temp.d_dataEnd_p = ++pos;
3932 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3936#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 7
3937template <
class VALUE_TYPE,
class ALLOCATOR>
3938template <
class Args_01,
3945void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
3956 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
3957 "vector<...>:emplace_back(args...): vector too long");
3960 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
3963 vector temp(this->get_allocator());
3964 temp.privateReserveEmpty(newCapacity);
3966 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
3967 AllocatorTraits::construct(
3968 this->allocatorRef(),
3978 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
3979 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
3980 this->d_dataBegin_p,
3982 this->allocatorRef());
3985 this->d_dataEnd_p = this->d_dataBegin_p;
3986 temp.d_dataEnd_p = ++pos;
3987 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
3991#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 8
3992template <
class VALUE_TYPE,
class ALLOCATOR>
3993template <
class Args_01,
4001void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
4013 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4014 "vector<...>:emplace_back(args...): vector too long");
4017 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
4020 vector temp(this->get_allocator());
4021 temp.privateReserveEmpty(newCapacity);
4023 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
4024 AllocatorTraits::construct(
4025 this->allocatorRef(),
4036 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
4037 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4038 this->d_dataBegin_p,
4040 this->allocatorRef());
4043 this->d_dataEnd_p = this->d_dataBegin_p;
4044 temp.d_dataEnd_p = ++pos;
4045 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4049#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 9
4050template <
class VALUE_TYPE,
class ALLOCATOR>
4051template <
class Args_01,
4060void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
4073 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4074 "vector<...>:emplace_back(args...): vector too long");
4077 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
4080 vector temp(this->get_allocator());
4081 temp.privateReserveEmpty(newCapacity);
4083 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
4084 AllocatorTraits::construct(
4085 this->allocatorRef(),
4097 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
4098 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4099 this->d_dataBegin_p,
4101 this->allocatorRef());
4104 this->d_dataEnd_p = this->d_dataBegin_p;
4105 temp.d_dataEnd_p = ++pos;
4106 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4110#if BSLSTL_VECTOR_VARIADIC_LIMIT_D >= 10
4111template <
class VALUE_TYPE,
class ALLOCATOR>
4112template <
class Args_01,
4122void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
4136 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4137 "vector<...>:emplace_back(args...): vector too long");
4140 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
4143 vector temp(this->get_allocator());
4144 temp.privateReserveEmpty(newCapacity);
4146 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
4147 AllocatorTraits::construct(
4148 this->allocatorRef(),
4161 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
4162 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4163 this->d_dataBegin_p,
4165 this->allocatorRef());
4168 this->d_dataEnd_p = this->d_dataBegin_p;
4169 temp.d_dataEnd_p = ++pos;
4170 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4177template <
class VALUE_TYPE,
class ALLOCATOR>
4178template <
class... Args>
4179void vector<VALUE_TYPE, ALLOCATOR>::privateEmplaceBackWithAllocation(
4184 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4185 "vector<...>:emplace_back(args...): vector too long");
4188 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
4191 vector temp(this->get_allocator());
4192 temp.privateReserveEmpty(newCapacity);
4194 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
4195 AllocatorTraits::construct(
4196 this->allocatorRef(),
4200 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
4201 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4202 this->d_dataBegin_p,
4204 this->allocatorRef());
4207 this->d_dataEnd_p = this->d_dataBegin_p;
4208 temp.d_dataEnd_p = ++pos;
4209 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4214template <
class VALUE_TYPE,
class ALLOCATOR>
4215void vector<VALUE_TYPE, ALLOCATOR>::privatePushBackWithAllocation(
4216 const VALUE_TYPE& value)
4220 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4221 "vector<...>:push_back(lvalue): vector too long");
4224 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
4228 vector temp(this->get_allocator());
4229 temp.privateReserveEmpty(newCapacity);
4232 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
4233 AllocatorTraits::construct(this->allocatorRef(), pos, value);
4237 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
4238 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4239 this->d_dataBegin_p,
4241 this->allocatorRef());
4244 this->d_dataEnd_p = this->d_dataBegin_p;
4245 temp.d_dataEnd_p = ++pos;
4246 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4249template <
class VALUE_TYPE,
class ALLOCATOR>
4250void vector<VALUE_TYPE, ALLOCATOR>::privatePushBackWithAllocation(
4251 BloombergLP::bslmf::MovableRef<VALUE_TYPE> value)
4253 VALUE_TYPE& lvalue = value;
4256 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4257 "vector<...>:push_back(rvalue): vector too long");
4260 size_type newCapacity = Vector_Util::computeNewCapacity(this->
size() + 1,
4264 vector temp(this->get_allocator());
4265 temp.privateReserveEmpty(newCapacity);
4268 VALUE_TYPE *pos = temp.d_dataBegin_p + this->
size();
4269 AllocatorTraits::construct(this->allocatorRef(),
4271 MoveUtil::move(lvalue));
4275 Vector_PushProctor<VALUE_TYPE, ALLOCATOR> guard(pos, this->allocatorRef());
4276 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4277 this->d_dataBegin_p,
4279 this->allocatorRef());
4282 this->d_dataEnd_p = this->d_dataBegin_p;
4283 temp.d_dataEnd_p = ++pos;
4284 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4291template <
class VALUE_TYPE,
class ALLOCATOR>
4294: vectorBase<VALUE_TYPE>()
4295, ContainerBase(ALLOCATOR())
4299template <
class VALUE_TYPE,
class ALLOCATOR>
4301vector<VALUE_TYPE, ALLOCATOR>::vector(
const ALLOCATOR& basicAllocator)
4303: vectorBase<VALUE_TYPE>()
4304, ContainerBase(basicAllocator)
4308template <
class VALUE_TYPE,
class ALLOCATOR>
4309vector<VALUE_TYPE, ALLOCATOR>::vector(size_type initialSize,
4310 const ALLOCATOR& basicAllocator)
4311: vectorBase<VALUE_TYPE>()
4312, ContainerBase(basicAllocator)
4316 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4317 "vector<...>::vector(n,v): vector too long");
4319 if (initialSize > 0) {
4320 privateReserveEmpty(initialSize);
4321 Proctor proctor(this->d_dataBegin_p,
4323 static_cast<ContainerBase *
>(
this));
4325 ArrayPrimitives::defaultConstruct(this->d_dataBegin_p,
4327 this->allocatorRef());
4330 this->d_dataEnd_p += initialSize;
4334template <
class VALUE_TYPE,
class ALLOCATOR>
4335vector<VALUE_TYPE, ALLOCATOR>::vector(size_type initialSize,
4336 const VALUE_TYPE& value,
4337 const ALLOCATOR& basicAllocator)
4338: vectorBase<VALUE_TYPE>()
4339, ContainerBase(basicAllocator)
4343 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4344 "vector<...>::vector(n,v): vector too long");
4346 if (initialSize > 0) {
4347 privateReserveEmpty(initialSize);
4348 Proctor proctor(this->d_dataBegin_p,
4350 static_cast<ContainerBase *
>(
this));
4352 ArrayPrimitives::uninitializedFillN(this->d_dataBegin_p,
4355 this->allocatorRef());
4358 this->d_dataEnd_p += initialSize;
4362template <
class VALUE_TYPE,
class ALLOCATOR>
4363template <
class INPUT_ITER>
4365vector<VALUE_TYPE, ALLOCATOR>::vector(INPUT_ITER first,
4367 const ALLOCATOR& basicAllocator)
4368: vectorBase<VALUE_TYPE>()
4369, ContainerBase(basicAllocator)
4373 typedef typename Vector_DeduceIteratorCategory<INPUT_ITER>::type Tag;
4375 if (is_same<Tag, BloombergLP::bslmf::Nil>::value || first != last) {
4377 constructFromRange(first, last, Tag());
4381template <
class VALUE_TYPE,
class ALLOCATOR>
4382vector<VALUE_TYPE, ALLOCATOR>::vector(
const vector& original)
4383: vectorBase<VALUE_TYPE>()
4384, ContainerBase(AllocatorTraits::select_on_container_copy_construction(
4385 original.get_allocator()))
4387 if (original.size() > 0) {
4388 privateReserveEmpty(original.size());
4389 Proctor proctor(this->d_dataBegin_p,
4391 static_cast<ContainerBase *
>(
this));
4393 ArrayPrimitives::copyConstruct(this->d_dataBegin_p,
4396 this->allocatorRef());
4399 this->d_dataEnd_p += original.size();
4403template <
class VALUE_TYPE,
class ALLOCATOR>
4404vector<VALUE_TYPE, ALLOCATOR>::
4405vector(
const vector& original,
4406 const typename type_identity<ALLOCATOR>::type& basicAllocator)
4407: vectorBase<VALUE_TYPE>()
4408, ContainerBase(basicAllocator)
4410 if (original.size() > 0) {
4411 privateReserveEmpty(original.size());
4412 Proctor proctor(this->d_dataBegin_p,
4414 static_cast<ContainerBase *
>(
this));
4416 ArrayPrimitives::copyConstruct(this->d_dataBegin_p,
4419 this->allocatorRef());
4422 this->d_dataEnd_p += original.size();
4426template <
class VALUE_TYPE,
class ALLOCATOR>
4427vector<VALUE_TYPE, ALLOCATOR>::vector(
4428 BloombergLP::bslmf::MovableRef<vector> original)
4430: vectorBase<VALUE_TYPE>()
4431, ContainerBase(MoveUtil::access(original).get_allocator())
4433 vector& lvalue = original;
4434 ImpBase::adopt(MoveUtil::move(
static_cast<ImpBase&
>(lvalue)));
4437template <
class VALUE_TYPE,
class ALLOCATOR>
4438vector<VALUE_TYPE, ALLOCATOR>::vector(
4439 BloombergLP::bslmf::MovableRef<vector> original,
4440 const typename type_identity<ALLOCATOR>::type& basicAllocator)
4441: vectorBase<VALUE_TYPE>()
4442, ContainerBase(basicAllocator)
4444 vector& lvalue = original;
4447 lvalue.get_allocator())) {
4448 ImpBase::adopt(MoveUtil::move(
static_cast<ImpBase&
>(lvalue)));
4451 if (lvalue.size() > 0) {
4452 privateReserveEmpty(lvalue.size());
4453 Proctor proctor(this->d_dataBegin_p,
4455 static_cast<ContainerBase *
>(
this));
4457 ArrayPrimitives::moveConstruct(this->d_dataBegin_p,
4460 this->allocatorRef());
4463 this->d_dataEnd_p += lvalue.size();
4468#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4469template <
class VALUE_TYPE,
class ALLOCATOR>
4471vector<VALUE_TYPE, ALLOCATOR>::vector(
4472 std::initializer_list<VALUE_TYPE> values,
4473 const ALLOCATOR& basicAllocator)
4474: vectorBase<VALUE_TYPE>()
4475, ContainerBase(basicAllocator)
4477 if (values.begin() != values.end()) {
4478 constructFromRange(values.begin(),
4480 std::random_access_iterator_tag());
4487template <
class VALUE_TYPE,
class ALLOCATOR>
4489vector<VALUE_TYPE, ALLOCATOR>::~vector()
4491 using BloombergLP::bslalg::ArrayDestructionPrimitives;
4494#ifdef BSLS_PLATFORM_CMP_GNU
4495#pragma GCC diagnostic push
4496#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
4498 if (this->d_dataBegin_p) {
4499 ArrayDestructionPrimitives::destroy(this->d_dataBegin_p,
4501 this->allocatorRef());
4502 AllocatorUtil::deallocateObject(this->allocatorRef(),
4503 this->d_dataBegin_p, this->d_capacity);
4505#ifdef BSLS_PLATFORM_CMP_GNU
4506#pragma GCC diagnostic pop
4511template <
class VALUE_TYPE,
class ALLOCATOR>
4512vector<VALUE_TYPE, ALLOCATOR>&
4513vector<VALUE_TYPE, ALLOCATOR>::operator=(
const vector& rhs)
4516 AllocatorTraits::propagate_on_container_copy_assignment Propagate;
4519 if (Propagate::value) {
4520 vector other(rhs, rhs.get_allocator());
4521 Vector_Util::swap(&this->d_dataBegin_p, &other.d_dataBegin_p);
4522 AllocatorUtil::swap(&this->allocatorRef(),
4523 &other.allocatorRef(),
4528 if (!this->
empty()) {
4531 insert(this->
begin(), rhs.begin(), rhs.end());
4537template <
class VALUE_TYPE,
class ALLOCATOR>
4538vector<VALUE_TYPE, ALLOCATOR>& vector<VALUE_TYPE, ALLOCATOR>::operator=(
4539 BloombergLP::bslmf::MovableRef<vector<VALUE_TYPE, ALLOCATOR> > rhs)
4541 AllocatorTraits::propagate_on_container_move_assignment::value ||
4542 AllocatorTraits::is_always_equal::value)
4545 AllocatorTraits::propagate_on_container_move_assignment Propagate;
4547 vector& lvalue = rhs;
4549 if (get_allocator() == lvalue.get_allocator()) {
4550 vector other(MoveUtil::move(lvalue));
4551 Vector_Util::swap(&this->d_dataBegin_p, &other.d_dataBegin_p);
4553 else if (Propagate::value) {
4554 vector other(MoveUtil::move(lvalue));
4555 AllocatorUtil::swap(&this->allocatorRef(),
4556 &other.allocatorRef(),
4558 Vector_Util::swap(&this->d_dataBegin_p, &other.d_dataBegin_p);
4561 vector other(MoveUtil::move(lvalue), this->allocatorRef());
4562 Vector_Util::swap(&this->d_dataBegin_p, &other.d_dataBegin_p);
4568#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4569template <
class VALUE_TYPE,
class ALLOCATOR>
4571vector<VALUE_TYPE, ALLOCATOR>&
4572vector<VALUE_TYPE, ALLOCATOR>::operator=(
4573 std::initializer_list<VALUE_TYPE> values)
4575 this->
assign(values.begin(), values.end());
4579template <
class VALUE_TYPE,
class ALLOCATOR>
4581void vector<VALUE_TYPE, ALLOCATOR>::assign(
4582 std::initializer_list<VALUE_TYPE> values)
4584 assign(values.begin(), values.end());
4588template <
class VALUE_TYPE,
class ALLOCATOR>
4589template <
class INPUT_ITER>
4591void vector<VALUE_TYPE, ALLOCATOR>::assign(INPUT_ITER first, INPUT_ITER last)
4595 if (!this->
empty()) {
4599 insert(this->
begin(), first, last);
4602template <
class VALUE_TYPE,
class ALLOCATOR>
4604void vector<VALUE_TYPE, ALLOCATOR>::assign(size_type numElements,
4605 const VALUE_TYPE& value)
4607 if (!this->
empty()) {
4610 insert(this->
begin(), numElements, value);
4616template <
class VALUE_TYPE,
class ALLOCATOR>
4617void vector<VALUE_TYPE, ALLOCATOR>::resize(size_type newSize)
4625 if (newSize <= this->
size()) {
4626 BloombergLP::bslalg::ArrayDestructionPrimitives::destroy(
4627 this->d_dataBegin_p + newSize,
4629 this->allocatorRef());
4630 this->d_dataEnd_p = this->d_dataBegin_p + newSize;
4632 else if (0 == this->d_capacity) {
4635 vector temp(newSize, this->get_allocator());
4636 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4638 else if (newSize > this->d_capacity) {
4639 const size_type maxSize = max_size();
4642 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4643 "vector<...>::resize(n): vector too long");
4646 size_type newCapacity = Vector_Util::computeNewCapacity(
4647 newSize, this->d_capacity, maxSize);
4649 vector temp(this->get_allocator());
4650 temp.privateReserveEmpty(newCapacity);
4652 ArrayPrimitives::destructiveMoveAndInsert(temp.d_dataBegin_p,
4654 this->d_dataBegin_p,
4657 newSize - this->size(),
4658 this->allocatorRef());
4660 temp.d_dataEnd_p += newSize;
4661 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4664 ArrayPrimitives::defaultConstruct(this->d_dataEnd_p,
4665 newSize - this->
size(),
4666 this->allocatorRef());
4667 this->d_dataEnd_p = this->d_dataBegin_p + newSize;
4671template <
class VALUE_TYPE,
class ALLOCATOR>
4672void vector<VALUE_TYPE, ALLOCATOR>::resize(size_type newSize,
4673 const VALUE_TYPE& value)
4678 if (newSize <= this->
size()) {
4679 BloombergLP::bslalg::ArrayDestructionPrimitives::destroy(
4680 this->d_dataBegin_p + newSize,
4682 this->allocatorRef());
4683 this->d_dataEnd_p = this->d_dataBegin_p + newSize;
4686 insert(this->d_dataEnd_p, newSize - this->
size(), value);
4690template <
class VALUE_TYPE,
class ALLOCATOR>
4691void vector<VALUE_TYPE, ALLOCATOR>::reserve(size_type newCapacity)
4695 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
4696 "vector<...>::reserve(newCapacity): vector too long");
4698 if (0 == this->d_capacity && 0 != newCapacity) {
4699 privateReserveEmpty(newCapacity);
4701 else if (this->d_capacity < newCapacity) {
4702 vector temp(this->get_allocator());
4703 temp.privateReserveEmpty(newCapacity);
4705 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4706 this->d_dataBegin_p,
4708 this->allocatorRef());
4710 temp.d_dataEnd_p += this->
size();
4711 this->d_dataEnd_p = this->d_dataBegin_p;
4712 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4716template <
class VALUE_TYPE,
class ALLOCATOR>
4717void vector<VALUE_TYPE, ALLOCATOR>::shrink_to_fit()
4719 if (this->
size() < this->d_capacity) {
4720 vector temp(this->get_allocator());
4721 if (this->
size() > 0) {
4722 temp.privateReserveEmpty(this->
size());
4723 ArrayPrimitives::destructiveMove(temp.d_dataBegin_p,
4724 this->d_dataBegin_p,
4726 this->allocatorRef());
4728 temp.d_dataEnd_p += this->
size();
4729 this->d_dataEnd_p = this->d_dataBegin_p;
4731 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
4737#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
4740#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT
4741#define BSLSTL_VECTOR_VARIADIC_LIMIT 10
4743#ifndef BSLSTL_VECTOR_VARIADIC_LIMIT_E
4744#define BSLSTL_VECTOR_VARIADIC_LIMIT_E BSLSTL_VECTOR_VARIADIC_LIMIT
4746#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 0
4747template <
class VALUE_TYPE,
class ALLOCATOR>
4750vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4754 AllocatorTraits::construct(
4755 this->allocatorRef(),
4757 ++this->d_dataEnd_p;
4760 privateEmplaceBackWithAllocation(
4763 return *(this->d_dataEnd_p - 1);
4767#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 1
4768template <
class VALUE_TYPE,
class ALLOCATOR>
4769template <
class Args_01>
4772vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4776 AllocatorTraits::construct(
4777 this->allocatorRef(),
4780 ++this->d_dataEnd_p;
4783 privateEmplaceBackWithAllocation(
4786 return *(this->d_dataEnd_p - 1);
4790#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 2
4791template <
class VALUE_TYPE,
class ALLOCATOR>
4792template <
class Args_01,
4796vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4801 AllocatorTraits::construct(
4802 this->allocatorRef(),
4806 ++this->d_dataEnd_p;
4809 privateEmplaceBackWithAllocation(
4813 return *(this->d_dataEnd_p - 1);
4817#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 3
4818template <
class VALUE_TYPE,
class ALLOCATOR>
4819template <
class Args_01,
4824vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4830 AllocatorTraits::construct(
4831 this->allocatorRef(),
4836 ++this->d_dataEnd_p;
4839 privateEmplaceBackWithAllocation(
4844 return *(this->d_dataEnd_p - 1);
4848#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 4
4849template <
class VALUE_TYPE,
class ALLOCATOR>
4850template <
class Args_01,
4856vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4863 AllocatorTraits::construct(
4864 this->allocatorRef(),
4870 ++this->d_dataEnd_p;
4873 privateEmplaceBackWithAllocation(
4879 return *(this->d_dataEnd_p - 1);
4883#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 5
4884template <
class VALUE_TYPE,
class ALLOCATOR>
4885template <
class Args_01,
4892vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4900 AllocatorTraits::construct(
4901 this->allocatorRef(),
4908 ++this->d_dataEnd_p;
4911 privateEmplaceBackWithAllocation(
4918 return *(this->d_dataEnd_p - 1);
4922#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 6
4923template <
class VALUE_TYPE,
class ALLOCATOR>
4924template <
class Args_01,
4932vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4941 AllocatorTraits::construct(
4942 this->allocatorRef(),
4950 ++this->d_dataEnd_p;
4953 privateEmplaceBackWithAllocation(
4961 return *(this->d_dataEnd_p - 1);
4965#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 7
4966template <
class VALUE_TYPE,
class ALLOCATOR>
4967template <
class Args_01,
4976vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
4986 AllocatorTraits::construct(
4987 this->allocatorRef(),
4996 ++this->d_dataEnd_p;
4999 privateEmplaceBackWithAllocation(
5008 return *(this->d_dataEnd_p - 1);
5012#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 8
5013template <
class VALUE_TYPE,
class ALLOCATOR>
5014template <
class Args_01,
5024vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
5035 AllocatorTraits::construct(
5036 this->allocatorRef(),
5046 ++this->d_dataEnd_p;
5049 privateEmplaceBackWithAllocation(
5059 return *(this->d_dataEnd_p - 1);
5063#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 9
5064template <
class VALUE_TYPE,
class ALLOCATOR>
5065template <
class Args_01,
5076vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
5088 AllocatorTraits::construct(
5089 this->allocatorRef(),
5100 ++this->d_dataEnd_p;
5103 privateEmplaceBackWithAllocation(
5114 return *(this->d_dataEnd_p - 1);
5118#if BSLSTL_VECTOR_VARIADIC_LIMIT_E >= 10
5119template <
class VALUE_TYPE,
class ALLOCATOR>
5120template <
class Args_01,
5132vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
5145 AllocatorTraits::construct(
5146 this->allocatorRef(),
5158 ++this->d_dataEnd_p;
5161 privateEmplaceBackWithAllocation(
5173 return *(this->d_dataEnd_p - 1);
5180template <
class VALUE_TYPE,
class ALLOCATOR>
5181template <
class... Args>
5184vector<VALUE_TYPE, ALLOCATOR>::emplace_back(
5188 AllocatorTraits::construct(
5189 this->allocatorRef(),
5192 ++this->d_dataEnd_p;
5195 privateEmplaceBackWithAllocation(
5198 return *(this->d_dataEnd_p - 1);
5203template <
class VALUE_TYPE,
class ALLOCATOR>
5205void vector<VALUE_TYPE, ALLOCATOR>::push_back(
const VALUE_TYPE& value)
5208 AllocatorTraits::construct(this->allocatorRef(),
5211 ++this->d_dataEnd_p;
5214 privatePushBackWithAllocation(value);
5218template <
class VALUE_TYPE,
class ALLOCATOR>
5220void vector<VALUE_TYPE, ALLOCATOR>::push_back(
5221 BloombergLP::bslmf::MovableRef<VALUE_TYPE> value)
5223 VALUE_TYPE& lvalue = value;
5225 AllocatorTraits::construct(this->allocatorRef(),
5227 MoveUtil::move(lvalue));
5228 ++this->d_dataEnd_p;
5231 privatePushBackWithAllocation(MoveUtil::move(lvalue));
5235template <
class VALUE_TYPE,
class ALLOCATOR>
5237void vector<VALUE_TYPE, ALLOCATOR>::pop_back()
5241 AllocatorTraits::destroy(this->allocatorRef(),
5242 --this->d_dataEnd_p);
5245template <
class VALUE_TYPE,
class ALLOCATOR>
5247typename vector<VALUE_TYPE, ALLOCATOR>::iterator
5248vector<VALUE_TYPE, ALLOCATOR>::insert(const_iterator position,
5249 const VALUE_TYPE& value)
5254 return insert(position, size_type(1), value);
5257template <
class VALUE_TYPE,
class ALLOCATOR>
5258typename vector<VALUE_TYPE, ALLOCATOR>::iterator
5259vector<VALUE_TYPE, ALLOCATOR>::insert(
5260 const_iterator position,
5261 BloombergLP::bslmf::MovableRef<VALUE_TYPE> value)
5266 const size_type maxSize = max_size();
5269 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
5270 "vector<...>::insert(pos,rv): vector too long");
5273 VALUE_TYPE& lvalue = value;
5275 const size_type index = position - this->
begin();
5276 const iterator& pos =
const_cast<const iterator&
>(position);
5277 const size_type newSize = this->
size() + 1;
5279 if (newSize > this->d_capacity) {
5280 size_type newCapacity = Vector_Util::computeNewCapacity(
5285 vector temp(this->get_allocator());
5286 temp.privateReserveEmpty(newCapacity);
5288 ArrayPrimitives::destructiveMoveAndEmplace(temp.d_dataBegin_p,
5290 this->d_dataBegin_p,
5293 this->allocatorRef(),
5294 MoveUtil::move(lvalue));
5296 temp.d_dataEnd_p += newSize;
5297 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
5300 ArrayPrimitives::insert(pos,
5302 MoveUtil::move(lvalue),
5303 this->allocatorRef());
5304 ++this->d_dataEnd_p;
5307 return this->
begin() + index;
5310template <
class VALUE_TYPE,
class ALLOCATOR>
5311typename vector<VALUE_TYPE, ALLOCATOR>::iterator
5312vector<VALUE_TYPE, ALLOCATOR>::insert(const_iterator position,
5313 size_type numElements,
5314 const VALUE_TYPE& value)
5319 const size_type maxSize = max_size();
5321 numElements > maxSize - this->
size())) {
5323 BloombergLP::bslstl::StdExceptUtil::throwLengthError(
5324 "vector<...>::insert(pos,n,v): vector too long");
5327 const size_type index = position - this->
begin();
5328 const iterator& pos =
const_cast<const iterator&
>(position);
5329 const size_type newSize = this->
size() + numElements;
5331 if (newSize > this->d_capacity) {
5332 size_type newCapacity = Vector_Util::computeNewCapacity(
5337 vector temp(this->get_allocator());
5338 temp.privateReserveEmpty(newCapacity);
5340 ArrayPrimitives::destructiveMoveAndInsert(temp.d_dataBegin_p,
5342 this->d_dataBegin_p,
5347 this->allocatorRef());
5349 temp.d_dataEnd_p += newSize;
5350 Vector_Util::swap(&this->d_dataBegin_p, &temp.d_dataBegin_p);
5353 ArrayPrimitives::insert(pos,
5357 this->allocatorRef());
5358 this->d_dataEnd_p += numElements;
5360 return this->
begin() + index;
5363#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5364template <
class VALUE_TYPE,
class ALLOCATOR>
5366typename vector<VALUE_TYPE, ALLOCATOR>::iterator
5367vector<VALUE_TYPE, ALLOCATOR>::insert(
5368 const_iterator position,
5369 std::initializer_list<VALUE_TYPE> values)
5371 return insert(position, values.begin(), values.end());
5375template <
class VALUE_TYPE,
class ALLOCATOR>
5377typename vector<VALUE_TYPE, ALLOCATOR>::iterator
5378vector<VALUE_TYPE, ALLOCATOR>::erase(const_iterator position)
5383 return erase(position, position + 1);
5389template <
class VALUE_TYPE,
class ALLOCATOR>
5391typename vector<VALUE_TYPE, ALLOCATOR>::iterator
5392vector<VALUE_TYPE, ALLOCATOR>::erase(const_iterator first, const_iterator last)
5399 const size_type n = last - first;
5400 ArrayPrimitives::erase(
const_cast<VALUE_TYPE *
>(first),
5401 const_cast<VALUE_TYPE *
>(last),
5403 this->allocatorRef());
5404 this->d_dataEnd_p -= n;
5405 return const_cast<VALUE_TYPE *
>(first);
5408template <
class VALUE_TYPE,
class ALLOCATOR>
5409void vector<VALUE_TYPE, ALLOCATOR>::swap(vector<VALUE_TYPE, ALLOCATOR>& other)
5411 AllocatorTraits::propagate_on_container_swap::value ||
5412 AllocatorTraits::is_always_equal::value)
5415 AllocatorTraits::propagate_on_container_swap Propagate;
5417 if (Propagate::value) {
5418 Vector_Util::swap(&this->d_dataBegin_p, &other.d_dataBegin_p);
5419 AllocatorUtil::swap(&this->allocatorRef(),
5420 &other.allocatorRef(),
5425 this->get_allocator() == other.get_allocator())) {
5426 Vector_Util::swap(&this->d_dataBegin_p, &other.d_dataBegin_p);
5431 vector toOtherCopy(MoveUtil::move(*
this),
5432 other.get_allocator());
5433 vector toThisCopy( MoveUtil::move(other),
5434 this->get_allocator());
5436 Vector_Util::swap(&toOtherCopy.d_dataBegin_p,
5437 &other.d_dataBegin_p);
5438 Vector_Util::swap(&toThisCopy. d_dataBegin_p,
5439 &this->d_dataBegin_p);
5444template <
class VALUE_TYPE,
class ALLOCATOR>
5449 BloombergLP::bslalg::ArrayDestructionPrimitives::destroy(
5450 this->d_dataBegin_p,
5452 this->allocatorRef());
5453 this->d_dataEnd_p = this->d_dataBegin_p;
5461template <
class VALUE_TYPE,
class ALLOCATOR>
5463typename vector<VALUE_TYPE, ALLOCATOR>::allocator_type
5466 return this->allocatorRef();
5471template <
class VALUE_TYPE,
class ALLOCATOR>
5473typename vector<VALUE_TYPE, ALLOCATOR>::size_type
5476 return AllocatorTraits::max_size(this->allocatorRef());
5483template <
class VALUE_TYPE,
class ALLOCATOR>
5485bool operator==(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5486 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5488 return BloombergLP::bslalg::RangeCompare::equal(lhs.begin(),
5496#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
5497template <
class VALUE_TYPE,
class ALLOCATOR>
5499bool operator!=(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5500 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5502 return ! (lhs == rhs);
5506#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
5508template <
class VALUE_TYPE,
class ALLOCATOR>
5510BloombergLP::bslalg::SynthThreeWayUtil::Result<VALUE_TYPE> operator<=>(
5511 const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5512 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5514 return lexicographical_compare_three_way(
5519 BloombergLP::bslalg::SynthThreeWayUtil::compare);
5524template <
class VALUE_TYPE,
class ALLOCATOR>
5526bool operator< (
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5527 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5529 return 0 > BloombergLP::bslalg::RangeCompare::lexicographical(lhs.begin(),
5537template <
class VALUE_TYPE,
class ALLOCATOR>
5539bool operator> (
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5540 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5545template <
class VALUE_TYPE,
class ALLOCATOR>
5547bool operator<=(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5548 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5550 return !(rhs < lhs);
5553template <
class VALUE_TYPE,
class ALLOCATOR>
5555bool operator>=(
const vector<VALUE_TYPE, ALLOCATOR>& lhs,
5556 const vector<VALUE_TYPE, ALLOCATOR>& rhs)
5558 return !(lhs < rhs);
5567template <
class VALUE_TYPE,
class ALLOCATOR,
class BDE_OTHER_TYPE>
5568inline typename vector<VALUE_TYPE, ALLOCATOR>::size_type
5569erase(vector<VALUE_TYPE, ALLOCATOR>& vec,
const BDE_OTHER_TYPE& value)
5571 typename vector<VALUE_TYPE, ALLOCATOR>::size_type oldSize = vec.
size();
5572 vec.erase(bsl::remove(vec.begin(), vec.end(), value), vec.end());
5573 return oldSize - vec.size();
5576template <
class VALUE_TYPE,
class ALLOCATOR,
class PREDICATE>
5577inline typename vector<VALUE_TYPE, ALLOCATOR>::size_type
5578erase_if(vector<VALUE_TYPE, ALLOCATOR>& vec, PREDICATE predicate)
5580 typename vector<VALUE_TYPE, ALLOCATOR>::size_type oldSize = vec.
size();
5581 vec.erase(bsl::remove_if(vec.begin(), vec.end(), predicate), vec.end());
5582 return oldSize - vec.size();
5585template <
class VALUE_TYPE,
class ALLOCATOR>
5587void swap(vector<VALUE_TYPE, ALLOCATOR>& a,
5588 vector<VALUE_TYPE, ALLOCATOR>& b)
5596template <
class HASHALG,
class VALUE_TYPE,
class ALLOCATOR>
5598void hashAppend(HASHALG& hashAlg,
const vector<VALUE_TYPE, ALLOCATOR>& input)
5600 using ::BloombergLP::bslh::hashAppend;
5601 typedef typename vector<VALUE_TYPE, ALLOCATOR>::const_iterator ci_t;
5603 for (ci_t b = input.begin(), e = input.end(); b != e; ++b) {
5616template <
class VALUE_TYPE,
class ALLOCATOR>
5623template <
class VALUE_TYPE,
class ALLOCATOR>
5625vector<VALUE_TYPE *, ALLOCATOR>::vector(
const ALLOCATOR& basicAllocator)
5627: d_impl(ImplAlloc(basicAllocator))
5631template <
class VALUE_TYPE,
class ALLOCATOR>
5633vector<VALUE_TYPE *, ALLOCATOR>::vector(size_type initialSize,
5634 const ALLOCATOR& basicAllocator)
5635: d_impl(initialSize, ImplAlloc(basicAllocator))
5639template <
class VALUE_TYPE,
class ALLOCATOR>
5641vector<VALUE_TYPE *, ALLOCATOR>::vector(size_type initialSize,
5643 const ALLOCATOR& basicAllocator)
5644: d_impl(initialSize, (UintPtr) value, ImplAlloc(basicAllocator))
5648template <
class VALUE_TYPE,
class ALLOCATOR>
5649template <
class INPUT_ITER>
5651vector<VALUE_TYPE *, ALLOCATOR>::vector(INPUT_ITER first,
5653 const ALLOCATOR& basicAllocator)
5654: d_impl(typename vector_ForwardIteratorForPtrs<VALUE_TYPE, INPUT_ITER>::type(
5656 typename vector_ForwardIteratorForPtrs<VALUE_TYPE, INPUT_ITER>::type(
5662template <
class VALUE_TYPE,
class ALLOCATOR>
5664vector<VALUE_TYPE *, ALLOCATOR>::vector(
const vector& original)
5665: d_impl(original.d_impl)
5669template <
class VALUE_TYPE,
class ALLOCATOR>
5671vector<VALUE_TYPE *, ALLOCATOR>::vector(
5672 BloombergLP::bslmf::MovableRef<vector> original)
5674: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl))
5678template <
class VALUE_TYPE,
class ALLOCATOR>
5680vector<VALUE_TYPE *, ALLOCATOR>::vector(
const vector& original,
5681 const typename type_identity<ALLOCATOR>::type& basicAllocator)
5682: d_impl(original.d_impl, ImplAlloc(basicAllocator))
5686template <
class VALUE_TYPE,
class ALLOCATOR>
5688vector<VALUE_TYPE *, ALLOCATOR>::vector(
5689 BloombergLP::bslmf::MovableRef<vector> original,
5690 const typename type_identity<ALLOCATOR>::type& basicAllocator)
5691: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl),
5692 ImplAlloc(basicAllocator))
5696#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5697template <
class VALUE_TYPE,
class ALLOCATOR>
5699vector<VALUE_TYPE *, ALLOCATOR>::vector(
5700 std::initializer_list<VALUE_TYPE *> values,
5701 const ALLOCATOR& basicAllocator)
5702: d_impl(typename vector_ForwardIteratorForPtrs<
5704 typename
std::initializer_list<VALUE_TYPE *>::const_iterator>::
5705 type(values.
begin()),
5706 typename vector_ForwardIteratorForPtrs<
5708 typename
std::initializer_list<VALUE_TYPE *>::const_iterator>::
5715template <
class VALUE_TYPE,
class ALLOCATOR>
5717vector<VALUE_TYPE *, ALLOCATOR>::~vector()
5722template <
class VALUE_TYPE,
class ALLOCATOR>
5724vector<VALUE_TYPE *, ALLOCATOR>& vector<VALUE_TYPE *, ALLOCATOR>::operator=(
5727 d_impl = rhs.d_impl;
5731#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5732template <
class VALUE_TYPE,
class ALLOCATOR>
5734vector<VALUE_TYPE *, ALLOCATOR>& vector<VALUE_TYPE *, ALLOCATOR>::operator=(
5735 std::initializer_list<VALUE_TYPE *> values)
5741template <
class VALUE_TYPE,
class ALLOCATOR>
5743void vector<VALUE_TYPE *, ALLOCATOR>::assign(
5744 std::initializer_list<VALUE_TYPE *> values)
5746 typedef typename std::initializer_list<VALUE_TYPE *>::const_iterator
5749 typedef typename vector_ForwardIteratorForPtrs<VALUE_TYPE, InitIter>::type
5752 d_impl.assign(Iter(values.begin()), Iter(values.end()));
5756template <
class VALUE_TYPE,
class ALLOCATOR>
5757template <
class INPUT_ITER>
5759void vector<VALUE_TYPE *, ALLOCATOR>::assign(INPUT_ITER first, INPUT_ITER last)
5761 typedef typename vector_ForwardIteratorForPtrs<VALUE_TYPE,
5762 INPUT_ITER>::type Iter;
5764 d_impl.assign(Iter(first), Iter(last));
5767template <
class VALUE_TYPE,
class ALLOCATOR>
5769void vector<VALUE_TYPE *, ALLOCATOR>::assign(size_type numElements,
5772 d_impl.assign(numElements, (UintPtr) value);
5777template <
class VALUE_TYPE,
class ALLOCATOR>
5779typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5782 return (iterator) d_impl.begin();
5785template <
class VALUE_TYPE,
class ALLOCATOR>
5787typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5790 return (iterator) d_impl.end();
5793template <
class VALUE_TYPE,
class ALLOCATOR>
5795typename vector<VALUE_TYPE *, ALLOCATOR>::reverse_iterator
5798 return reverse_iterator((iterator) d_impl.rbegin().base());
5801template <
class VALUE_TYPE,
class ALLOCATOR>
5803typename vector<VALUE_TYPE *, ALLOCATOR>::reverse_iterator
5806 return reverse_iterator((iterator) d_impl.rend().base());
5811template <
class VALUE_TYPE,
class ALLOCATOR>
5813typename vector<VALUE_TYPE *, ALLOCATOR>::size_type
5816 return d_impl.size();
5819template <
class VALUE_TYPE,
class ALLOCATOR>
5821typename vector<VALUE_TYPE *, ALLOCATOR>::size_type
5824 return d_impl.capacity();
5827template <
class VALUE_TYPE,
class ALLOCATOR>
5832 return d_impl.empty();
5837template <
class VALUE_TYPE,
class ALLOCATOR>
5839typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5840vector<VALUE_TYPE *, ALLOCATOR>::operator[](size_type position)
5842 return (reference) d_impl.operator[](position);
5845template <
class VALUE_TYPE,
class ALLOCATOR>
5847typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5848vector<VALUE_TYPE *, ALLOCATOR>::at(size_type position)
5850 return (reference) d_impl.at(position);
5853template <
class VALUE_TYPE,
class ALLOCATOR>
5855typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5856vector<VALUE_TYPE *, ALLOCATOR>::front()
5858 return (reference) d_impl.front();
5861template <
class VALUE_TYPE,
class ALLOCATOR>
5863typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5864vector<VALUE_TYPE *, ALLOCATOR>::back()
5866 return (reference) d_impl.back();
5869template <
class VALUE_TYPE,
class ALLOCATOR>
5873 return (VALUE_TYPE **) d_impl.data();
5878template <
class VALUE_TYPE,
class ALLOCATOR>
5880void vector<VALUE_TYPE *, ALLOCATOR>::resize(size_type newLength)
5882 d_impl.resize(newLength);
5885template <
class VALUE_TYPE,
class ALLOCATOR>
5887void vector<VALUE_TYPE *, ALLOCATOR>::resize(size_type newLength,
5890 d_impl.resize(newLength, (UintPtr) value);
5893template <
class VALUE_TYPE,
class ALLOCATOR>
5895void vector<VALUE_TYPE *, ALLOCATOR>::reserve(size_type newCapacity)
5897 d_impl.reserve(newCapacity);
5900template <
class VALUE_TYPE,
class ALLOCATOR>
5902void vector<VALUE_TYPE *, ALLOCATOR>::shrink_to_fit()
5904 d_impl.shrink_to_fit();
5910template <
class VALUE_TYPE,
class ALLOCATOR>
5912typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5913vector<VALUE_TYPE *, ALLOCATOR>::emplace_back()
5915 d_impl.emplace_back();
5919# if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
5920template <
class VALUE_TYPE,
class ALLOCATOR>
5923typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5924vector<VALUE_TYPE *, ALLOCATOR>::emplace_back(ARG&& arg)
5926 VALUE_TYPE *ptr(arg);
5927 d_impl.emplace_back(
reinterpret_cast<UintPtr
>(ptr));
5931template <
class VALUE_TYPE,
class ALLOCATOR>
5933typename vector<VALUE_TYPE *, ALLOCATOR>::reference
5934vector<VALUE_TYPE *, ALLOCATOR>::emplace_back(VALUE_TYPE *ptr)
5936 d_impl.emplace_back(
reinterpret_cast<UintPtr
>(ptr));
5941template <
class VALUE_TYPE,
class ALLOCATOR>
5943void vector<VALUE_TYPE *, ALLOCATOR>::push_back(VALUE_TYPE *value)
5945 d_impl.emplace_back(
reinterpret_cast<UintPtr
>(value));
5948template <
class VALUE_TYPE,
class ALLOCATOR>
5950void vector<VALUE_TYPE *, ALLOCATOR>::pop_back()
5955template <
class VALUE_TYPE,
class ALLOCATOR>
5957typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5958vector<VALUE_TYPE *, ALLOCATOR>::emplace(const_iterator position)
5960 return (iterator) d_impl.emplace((
const UintPtr*) position);
5963# if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
5964template <
class VALUE_TYPE,
class ALLOCATOR>
5967typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5968vector<VALUE_TYPE *, ALLOCATOR>::emplace(const_iterator position, ARG&& arg)
5970 VALUE_TYPE *ptr(arg);
5971 return (iterator) d_impl.emplace((
const UintPtr *)position,
5972 reinterpret_cast<UintPtr
>(ptr));
5975template <
class VALUE_TYPE,
class ALLOCATOR>
5977typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5978vector<VALUE_TYPE *, ALLOCATOR>::emplace(const_iterator position,
5981 return (iterator) d_impl.emplace((
const UintPtr*) position,
5982 reinterpret_cast<UintPtr
>(ptr));
5986template <
class VALUE_TYPE,
class ALLOCATOR>
5988typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5989vector<VALUE_TYPE *, ALLOCATOR>::insert(const_iterator position,
5992 return (iterator) d_impl.emplace((
const UintPtr*) position,
5993 reinterpret_cast<UintPtr
>(value));
5996template <
class VALUE_TYPE,
class ALLOCATOR>
5998typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
5999vector<VALUE_TYPE *, ALLOCATOR>::insert(const_iterator position,
6000 size_type numElements,
6003 return (iterator) d_impl.insert(
6004 (
const UintPtr *)position, numElements, (UintPtr)value);
6007#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
6008template <
class VALUE_TYPE,
class ALLOCATOR>
6010typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
6011vector<VALUE_TYPE *, ALLOCATOR>::insert(
6012 const_iterator position,
6013 std::initializer_list<VALUE_TYPE *> values)
6015 typedef typename std::initializer_list<VALUE_TYPE *>::const_iterator
6018 typedef typename vector_ForwardIteratorForPtrs<VALUE_TYPE, InitIter>::type
6021 return (iterator) d_impl.insert(
6022 (
const UintPtr *)position, Iter(values.begin()), Iter(values.end()));
6026template <
class VALUE_TYPE,
class ALLOCATOR>
6028typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
6029vector<VALUE_TYPE *, ALLOCATOR>::erase(const_iterator position)
6031 return (iterator) d_impl.erase((
const UintPtr*) position);
6034template <
class VALUE_TYPE,
class ALLOCATOR>
6036typename vector<VALUE_TYPE *, ALLOCATOR>::iterator
6037vector<VALUE_TYPE *, ALLOCATOR>::erase(const_iterator first,
6038 const_iterator last)
6040 return (iterator) d_impl.erase((
const UintPtr*) first,
6041 (
const UintPtr*) last);
6044template <
class VALUE_TYPE,
class ALLOCATOR>
6046void vector<VALUE_TYPE *, ALLOCATOR>::swap(
6047 vector<VALUE_TYPE *, ALLOCATOR>& other)
6049 d_impl.swap(other.d_impl)))
6051 d_impl.swap(other.d_impl);
6054template <
class VALUE_TYPE,
class ALLOCATOR>
6062template <
class VALUE_TYPE,
class ALLOCATOR>
6064typename vector<VALUE_TYPE *, ALLOCATOR>::allocator_type
6067 return ALLOCATOR(d_impl.get_allocator());
6070template <
class VALUE_TYPE,
class ALLOCATOR>
6072typename vector<VALUE_TYPE *, ALLOCATOR>::size_type
6075 return d_impl.max_size();
6081template <
class VALUE_TYPE,
class ALLOCATOR>
6083typename vector<VALUE_TYPE *, ALLOCATOR>::const_iterator
6086 return (const_iterator) d_impl.begin();
6089template <
class VALUE_TYPE,
class ALLOCATOR>
6091typename vector<VALUE_TYPE *, ALLOCATOR>::const_iterator
6094 return (const_iterator) d_impl.cbegin();
6097template <
class VALUE_TYPE,
class ALLOCATOR>
6099typename vector<VALUE_TYPE *, ALLOCATOR>::const_iterator
6102 return (const_iterator) d_impl.end();
6105template <
class VALUE_TYPE,
class ALLOCATOR>
6107typename vector<VALUE_TYPE *, ALLOCATOR>::const_iterator
6110 return (const_iterator) d_impl.cend();
6113template <
class VALUE_TYPE,
class ALLOCATOR>
6115typename vector<VALUE_TYPE *, ALLOCATOR>::const_reverse_iterator
6118 return const_reverse_iterator((const_iterator) d_impl.rbegin().base());
6121template <
class VALUE_TYPE,
class ALLOCATOR>
6123typename vector<VALUE_TYPE *, ALLOCATOR>::const_reverse_iterator
6126 return const_reverse_iterator((const_iterator) d_impl.crbegin().base());
6129template <
class VALUE_TYPE,
class ALLOCATOR>
6131typename vector<VALUE_TYPE *, ALLOCATOR>::const_reverse_iterator
6134 return const_reverse_iterator((const_iterator) d_impl.rend().base());
6137template <
class VALUE_TYPE,
class ALLOCATOR>
6139typename vector<VALUE_TYPE *, ALLOCATOR>::const_reverse_iterator
6142 return const_reverse_iterator((const_iterator) d_impl.crend().base());
6148template <
class VALUE_TYPE,
class ALLOCATOR>
6150typename vector<VALUE_TYPE *, ALLOCATOR>::const_reference
6151vector<VALUE_TYPE *, ALLOCATOR>::operator[](size_type position)
const
6153 return (const_reference) d_impl.operator[](position);
6156template <
class VALUE_TYPE,
class ALLOCATOR>
6158typename vector<VALUE_TYPE *, ALLOCATOR>::const_reference
6159vector<VALUE_TYPE *, ALLOCATOR>::at(size_type position)
const
6161 return (const_reference) d_impl.at(position);
6164template <
class VALUE_TYPE,
class ALLOCATOR>
6166typename vector<VALUE_TYPE *, ALLOCATOR>::const_reference
6167vector<VALUE_TYPE *, ALLOCATOR>::front()
const
6169 return (const_reference) d_impl.front();
6172template <
class VALUE_TYPE,
class ALLOCATOR>
6174typename vector<VALUE_TYPE *, ALLOCATOR>::const_reference
6175vector<VALUE_TYPE *, ALLOCATOR>::back()
const
6177 return (const_reference) d_impl.back();
6180template <
class VALUE_TYPE,
class ALLOCATOR>
6182VALUE_TYPE *
const *vector<VALUE_TYPE *, ALLOCATOR>::data() const
6185 return (VALUE_TYPE *
const *) d_impl.data();
6206template <
class VALUE_TYPE,
class ALLOCATOR>
6214template <
class VALUE_TYPE,
class ALLOCATOR>
6215struct UsesBslmaAllocator<
bsl::vector<VALUE_TYPE, ALLOCATOR> >
6223template <
class VALUE_TYPE,
class ALLOCATOR>
6224struct IsBitwiseMoveable<
bsl::vector<VALUE_TYPE, ALLOCATOR> >
6225 : IsBitwiseMoveable<ALLOCATOR>
6232#ifdef BSLS_COMPILERFEATURES_SUPPORT_EXTERN_TEMPLATE
6271# error Not valid except when included from bslstl_vector.h
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements contained by this deque.
Definition bslstl_deque.h:2074
Definition bslma_bslallocator.h:580
Definition bslstl_vector.h:834
VALUE_TYPE const & const_reference
Definition bslstl_vector.h:852
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this vector.
Definition bslstl_vector.h:2664
std::size_t d_capacity
Definition bslstl_vector.h:846
VALUE_TYPE * d_dataEnd_p
Definition bslstl_vector.h:845
void adopt(BloombergLP::bslmf::MovableRef< vectorBase > base)
Definition bslstl_vector.h:2492
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2511
reference back()
Definition bslstl_vector.h:2577
size_type capacity() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2672
std::ptrdiff_t difference_type
Definition bslstl_vector.h:856
VALUE_TYPE value_type
Definition bslstl_vector.h:850
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2622
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2606
VALUE_TYPE const * const_iterator
Definition bslstl_vector.h:854
std::size_t size_type
Definition bslstl_vector.h:855
const_reverse_iterator crend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2654
reverse_iterator rbegin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2527
vectorBase()
Create an empty base object with no capacity.
Definition bslstl_vector.h:2480
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2519
VALUE_TYPE * d_dataBegin_p
Definition bslstl_vector.h:844
bsl::reverse_iterator< const_iterator > const_reverse_iterator
Definition bslstl_vector.h:858
reference at(size_type position)
Definition bslstl_vector.h:2554
VALUE_TYPE & reference
Definition bslstl_vector.h:851
bsl::reverse_iterator< iterator > reverse_iterator
Definition bslstl_vector.h:857
bool empty() const BSLS_KEYWORD_NOEXCEPT
Return true if this vector has size 0, and false otherwise.
Definition bslstl_vector.h:2679
reference front()
Definition bslstl_vector.h:2567
reverse_iterator rend() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2535
const_reverse_iterator crbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2638
VALUE_TYPE * iterator
Definition bslstl_vector.h:853
VALUE_TYPE * data() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2587
vector_UintPtrConversionIterator(ITERATOR it)
Create a proxy iterator adapting the specified it.
Definition bslstl_vector.h:2343
Definition bslstl_vector.h:1025
AllocatorTraits::size_type size_type
Definition bslstl_vector.h:1052
static const bool value
Definition bslmf_integralconstant.h:258
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_NOEXCEPT_OPERATOR(...)
Definition bsls_keyword.h:635
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
void hashAppend(HASH_ALGORITHM &hashAlg, const baljsn::EncoderTestAddress &object)
Definition baljsn_encoder_testtypes.h:9236
bool operator<(const MetricId &lhs, const MetricId &rhs)
void resize(TYPE *array, int newSize)
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
int assign(LHS_TYPE *lhs, const RHS_TYPE &rhs)
bool operator>=(const Guid &lhs, const Guid &rhs)
FunctionOutputIterator< FUNCTION > & operator++(FunctionOutputIterator< FUNCTION > &iterator)
Do nothing and return specified iterator.
Definition bdlb_functionoutputiterator.h:405
bool operator<=(const Guid &lhs, const Guid &rhs)
bool operator>(const Guid &lhs, const Guid &rhs)
TransformIterator< FUNCTOR, ITERATOR > operator-(const TransformIterator< FUNCTOR, ITERATOR > &iterator, typename TransformIterator< FUNCTOR, ITERATOR >::difference_type offset)
Decimal32 operator*(Decimal32 lhs, Decimal32 rhs)
Definition bdlb_printmethods.h:283
deque< VALUE_TYPE, ALLOCATOR >::size_type erase(deque< VALUE_TYPE, ALLOCATOR > &deq, const BDE_OTHER_TYPE &value)
Definition bslstl_deque.h:4126
T::iterator begin(T &container)
Definition bslstl_iterator.h:1495
T::iterator end(T &container)
Definition bslstl_iterator.h:1523
deque< VALUE_TYPE, ALLOCATOR >::size_type erase_if(deque< VALUE_TYPE, ALLOCATOR > &deq, PREDICATE predicate)
Definition bslstl_deque.h:4135
BSLS_KEYWORD_CONSTEXPR CONTAINER::value_type * data(CONTAINER &container)
Definition bslstl_iterator.h:1231
BSLS_KEYWORD_CONSTEXPR bool empty(const CONTAINER &container)
Definition bslstl_iterator.h:1279
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bdldfp_decimal.h:5188
bsl::iterator_traits< BSLSTL_ITERATOR >::iterator_category type
Definition bslstl_vector.h:729
static std::size_t computeNewCapacity(std::size_t newLength, std::size_t capacity, std::size_t maxSize)
static void swap(void *a, void *b)
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR_TYPE >::type size_type
Definition bslma_allocatortraits.h:1165
static void destroy(ALLOCATOR_TYPE &basicAllocator, ELEMENT_TYPE *elementAddr)
Definition bslma_allocatortraits.h:1494
Definition bslmf_enableif.h:525
Definition bslmf_isconvertible.h:867
Definition bslmf_issame.h:146
ITERATOR type
Definition bslstl_vector.h:761