Function GetNewCapacity

Summary

#include <include/EASTL/string.h>

(1) size_type GetNewCapacity(size_type currentCapacity)

(2) size_type GetNewCapacity(size_type currentCapacity, size_type minimumGrowSize)

Function overload

Synopsis

#include <include/EASTL/string.h>

size_type GetNewCapacity(size_type currentCapacity)

Description

No description yet.

Source

Lines 3284-3289 in include/EASTL/string.h. Line 756 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::size_type
basic_string<T, Allocator>::GetNewCapacity(size_type currentCapacity)
{
    return GetNewCapacity(currentCapacity, 1);
}

Synopsis

#include <include/EASTL/string.h>

size_type GetNewCapacity(size_type currentCapacity, size_type minimumGrowSize)

Description

No description yet.

Source

Lines 3292-3307 in include/EASTL/string.h. Line 757 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::size_type
basic_string<T, Allocator>::GetNewCapacity(size_type currentCapacity, size_type minimumGrowSize)
{
    #if EASTL_STRING_OPT_LENGTH_ERRORS
        const size_type nRemainingSize = max_size() - currentCapacity;
        if(EASTL_UNLIKELY((minimumGrowSize > nRemainingSize)))
        {
            ThrowLengthException();
        }
    #endif
    const size_type nNewCapacity = eastl::max_alt(currentCapacity + minimumGrowSize, currentCapacity * 2);
    return nNewCapacity;
}





Add Discussion as Guest

Log in