DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
OFrvalue< T > Struct Template Reference

A helper class to 'tag' objects as rvalues to help DCMTK's move emulation employed on pre C++11 compilers. More...

+ Inheritance diagram for OFrvalue< T >:

Detailed Description

template<typename T>
struct OFrvalue< T >

A helper class to 'tag' objects as rvalues to help DCMTK's move emulation employed on pre C++11 compilers.

Template Parameters
Tthe base type an rvalue should be create of.

OFrvalue wrapps the type T inside a zero-overhead object employing T's move constructor when possible.

Note
When C++11 support is available, OFrvalue<T> will simply be a type alias for T, since a C++11 compiler handles rvalue reference conversions natively.

Example

This example describes how to move an object of type OFunique_ptr out of a function by using OFrvalue.

{
}
. . .
OFunique_ptr<DcmDataset> pDataset = getDataset();
Warning
Some compilers might require you to use the following code instead, as older versions of the C++ standard allowed the compiler to use the copy constructor for binding an rvalue to an lvalue reference. Use this code template instead to achieve maximum portability:
{
return OFmove( pDataset );
}

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


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13