PrevUpHomeNext

Struct devector_growth_policy

boost::double_ended::devector_growth_policy

Synopsis

// In header: <boost/double_ended/devector.hpp>


struct devector_growth_policy {
  // types
  typedef unsigned int size_type;

  // public static functions
  static size_type new_capacity(size_type);
  static bool should_shrink(size_type, size_type, size_type);
};

Description

Controls a devectors reallocation policy.

Models the GrowthPolicy concept of the devector class.

devector_growth_policy public types

  1. typedef unsigned int size_type;

    Sets the size_type type of the devector.

devector_growth_policy public static functions

  1. static size_type new_capacity(size_type capacity);

    Returns: 4 times the old capacity or 16 if it's 0.

    Parameters:

    capacity

    The current capacity of the devector, equals to capacity().

  2. static bool should_shrink(size_type size, size_type capacity, 
                              size_type small_buffer_size);

    Returns: true, if the contents fit in the small buffer.

    Parameters:

    capacity

    The current capacity of the devector, equals to capacity().

    size

    The element count of the devector, equals to size()

    small_buffer_size

    The size of the small buffer, specified by the SmallBufferPolicy.


PrevUpHomeNext