ITK  5.4.0
Insight Toolkit
Public Member Functions | List of all members
itk::VariableLengthVector< TValue >::KeepOldValues Struct Reference

#include <itkVariableLengthVector.h>

Detailed Description

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

VariableLengthVector Invariability Policy: Always keep old values. This policy, when used from VariableLengthVector::SetSize(), always copies min(newSize,oldSize) previous values from the previous internal buffer to the new one

Precondition
This policy is only meant to be executed in case of reallocation, i.e. oldBuffer and newBuffer are expected to differ (unchecked).
This presumes TValue assignment is a noexcept operation.
newBuffer is not null (pre-conditions imposed by some implementations of std::copy())
[oldBuffer, oldBuffer+oldSize) is a valid range

This behaviour mimics std::vector<>::resize() behaviour. However, it makes to sense from VariableLengthVector::operator=()

See also
itk::VariableLengthVector::SetSize
KeepValuesRootPolicy
DumpOldValues

Definition at line 273 of file itkVariableLengthVector.h.

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

Public Member Functions

template<typename TValue2 >
void operator() (unsigned int newSize, unsigned int oldSize, TValue2 *oldBuffer, TValue2 *newBuffer) const
 

Member Function Documentation

◆ operator()()

template<typename TValue>
template<typename TValue2 >
void itk::VariableLengthVector< TValue >::KeepOldValues::operator() ( unsigned int  newSize,
unsigned int  oldSize,
TValue2 *  oldBuffer,
TValue2 *  newBuffer 
) const
inline

Definition at line 277 of file itkVariableLengthVector.h.


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