cisst-saw
Loading...
Searching...
No Matches
vctReturnDynamicVector< _elementType > Class Template Reference

#include <vctDynamicVector.h>

Inheritance diagram for vctReturnDynamicVector< _elementType >:
vctDynamicVector< _elementType >

Public Types

typedef vctDynamicVector< _elementType > BaseType

Public Member Functions

 vctReturnDynamicVector (const BaseType &other)

Detailed Description

template<class _elementType>
class vctReturnDynamicVector< _elementType >

Class vctReturnDynamicVector is specialized to store a temporary vector object by transfering ownership. An object of this class has all the methods inherited from vctDynamicVector, but can only be constructed in one way – taking the ownership from another vctDynamicVector (or vctReturnDynamicVector) object. In turn, when an assignment occurs from a vctReturnDynamicVector to a vctDynamicVector (or likewise construction), the lhs vctDynamicVector strips this object from the ownership of the data.

Use this class only when you want to return a newly created dynamic vector from a function, without going through memory allocation and deallocation. Never use it on an object that is going to remain in scope after constructing the vctReturnDynamicVector.

Member Typedef Documentation

◆ BaseType

template<class _elementType>
typedef vctDynamicVector<_elementType> vctReturnDynamicVector< _elementType >::BaseType

Base type of vctReturnDynamicVector.

Constructor & Destructor Documentation

◆ vctReturnDynamicVector()

template<class _elementType>
vctReturnDynamicVector< _elementType >::vctReturnDynamicVector ( const BaseType & other)
inlineexplicit

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