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

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


Generated on Wed Dec 11 2024 for DCMTK Version 3.6.9 by Doxygen 1.9.1