BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsl::Vector_Util Struct Reference

#include <bslstl_vector.h>

Detailed Description

This struct provides a namespace for implementing the swap member function of vector<VALUE_TYPE, ALLOCATOR>. swap can be implemented irrespective of the VALUE_TYPE or ALLOCATOR template parameters, which is why we implement it in this non-parameterized, non-inlined utility.

See bslstl_vector

Static Public Member Functions

static std::size_t computeNewCapacity (std::size_t newLength, std::size_t capacity, std::size_t maxSize)
 
static void swap (void *a, void *b)
 

Member Function Documentation

◆ computeNewCapacity()

static std::size_t bsl::Vector_Util::computeNewCapacity ( std::size_t  newLength,
std::size_t  capacity,
std::size_t  maxSize 
)
static

Return a capacity that is at least the specified newLength and at least twice the specified capacity if this is less than the specified maxSize, but never more than maxSize.

Precondition
The behavior is undefined unless capacity < newLength and newLength <= maxSize.

◆ swap()

static void bsl::Vector_Util::swap ( void *  a,
void *  b 
)
static

Exchange the value of the specified a vector with that of the specified b vector.


The documentation for this struct was generated from the following file: