DCMTK  Version 3.6.6
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 wraps 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:
OFrvalue
A helper class to 'tag' objects as rvalues to help DCMTK's move emulation employed on pre C++11 compi...
Definition: ofutil.h:157
DcmDataset
a class handling the DICOM dataset format (files without meta header)
Definition: dcdatset.h:42
OFunique_ptr
OFunique_ptr is a smart pointer that retains sole ownership of an object through a pointer and destro...
Definition: ofmem.h:289
OFmove
OFconstexpr xvalue OFmove(T< unspecified > t)
Obtains an rvalue reference to its argument and converts it to an xvalue.


Generated on Thu Jan 14 2021 for DCMTK Version 3.6.6 by Doxygen 1.8.18