List of all members
blaze::OptimalGrowth Struct Reference

Optimal growth policy class.The OptimalGrowth policy class implements the optimal growth strategy suggested by Andrew Koenig for the std::vector class (see Andrew Koenig's column in the September 1998 issue of JOOP (Journal of Object-Oriented Programming), or the Dr. Dobb's article 'C++ Made Easier: How Vectors Grow', 2001). It applies an exponential growth strategy using a factor of 1.5 and additionally ensures that the sizes returns are always multiples of four. More...

#include <OptimalGrowth.h>

Public Member Functions

Utility functions
size_t operator() (size_t oldSize, size_t minSize) const
 Returns a new size depending on the given old size and the required minimum size. More...
 

Detailed Description

Optimal growth policy class.

The OptimalGrowth policy class implements the optimal growth strategy suggested by Andrew Koenig for the std::vector class (see Andrew Koenig's column in the September 1998 issue of JOOP (Journal of Object-Oriented Programming), or the Dr. Dobb's article 'C++ Made Easier: How Vectors Grow', 2001). It applies an exponential growth strategy using a factor of 1.5 and additionally ensures that the sizes returns are always multiples of four.

Member Function Documentation

size_t blaze::OptimalGrowth::operator() ( size_t  old,
size_t  minimum 
) const
inline

Returns a new size depending on the given old size and the required minimum size.

Parameters
oldThe old size.
minimumThe required minimum size.
Returns
The new size (at least the required minimum size).

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