ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Member Functions | List of all members
itk::VariableLengthVector< TValue >::DontShrinkToFit Struct Reference

#include <itkVariableLengthVector.h>

+ Inheritance diagram for itk::VariableLengthVector< TValue >::DontShrinkToFit:
+ Collaboration diagram for itk::VariableLengthVector< TValue >::DontShrinkToFit:

Detailed Description

template<typename TValue>
struct itk::VariableLengthVector< TValue >::DontShrinkToFit

VariableLengthVector Allocation Policy: reallocate memory only when size increases. This policy, when used from VariableLengthVector::SetSize(), will reallocate the internal buffer only if the new size requested for the VariableLengthVector increases.

whether newSize is bigger than oldSize
Unlike classes like std::vector<>, VariableLengthVector has no capacity concept: the size of the VariableLengthVector is its capacity. However, this will help a class without capacity to emulate one. The consequence is that reallocations will occur with scenarios such as the following:
v.SetSize(12); // no reallocation
v.SetSize(42); // pointless reallocation (given this policy)
See Also

Definition at line 216 of file itkVariableLengthVector.h.

Public Member Functions

bool operator() (unsigned int newSize, unsigned int oldSize) const

Member Function Documentation

template<typename TValue>
bool itk::VariableLengthVector< TValue >::DontShrinkToFit::operator() ( unsigned int  newSize,
unsigned int  oldSize 
) const

Definition at line 218 of file itkVariableLengthVector.h.

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