DCMTK
Version 3.6.3
OFFIS DICOM Toolkit
|
Implement fallback support for modern techniques defined in the STL's <utility> header (e.g. move semantics) for older compilers. More...
Classes | |
struct | OFrvalue< T > |
A helper class to 'tag' objects as rvalues to help DCMTK's move emulation employed on pre C++11 compilers. More... | |
class | OFPair< K, V > |
a pair - this implements parts of std::pair's interface. More... | |
struct | OFtuple_size< Tuple > |
struct | OFtuple_element< Index, Tuple > |
struct | OFtuple_size< OFPair< K, V > > |
struct | OFtuple_element< 0, OFPair< K, V > > |
struct | OFtuple_element< 1, OFPair< K, V > > |
struct | OFpair_element< Element > |
struct | OFpair_element< 0 > |
struct | OFpair_element< 1 > |
Macros | |
#define | OFrvalue_ref(T) unspecified |
Determines rvalue reference type for the type T . More... | |
#define | OFrvalue_ref_upcast(T, RV) unspecified |
Upcast an rvalue reference to an rvalue reference of one of its bases. More... | |
Functions | |
template<typename T > | |
T & | OFrvalue_access (OFrvalue_ref(T) rv) |
Obtain an lvalue reference from an rvalue reference. More... | |
template<typename T > | |
OFconstexpr xvalue | OFmove (T< unspecified > t) |
Obtains an rvalue reference to its argument and converts it to an xvalue. More... | |
template<typename T > | |
void | OFswap (T &t0, T &t1) |
Exchanges the given values. More... | |
Implement fallback support for modern techniques defined in the STL's <utility> header (e.g. move semantics) for older compilers.
struct OFtuple_size |
struct OFtuple_element |
struct OFtuple_element< 0, OFPair< K, V > > |
struct OFtuple_element< 1, OFPair< K, V > > |
struct OFpair_element |
#define OFrvalue_ref | ( | T | ) | unspecified |
Determines rvalue reference type for the type T
.
T | the base type to determine the rvalue reference type for. |
T&&
when C++11 support is available. Otherwise DCMTK's move emulation will be used, employing an unspecified type to implement rvalue references.This example shows how to implement the move constructor and move assignment for a custom class in a portable fashion (employing C++11's native features when available and using DCMTK's move emulation otherwise).
#define OFrvalue_ref_upcast | ( | T, | |
RV | |||
) | unspecified |
Upcast an rvalue reference to an rvalue reference of one of its bases.
This is a helper macro for being used with DCMTK's fallback implementation of move semantics. C++11 rvalue references should normally allow implicit upcasts, therefore, this macro typically has no effect if C++11 is enabled (it may be used to work around the behavior of older GCC versions).
T | the base class to upcast to |
RV | the rvalue reference to upcast |
OFconstexpr xvalue OFmove | ( | T< unspecified > | t | ) |
Obtains an rvalue reference to its argument and converts it to an xvalue.
OFmove is meant to 'mark' an object for a move operation, e.g. to move an OFVector object into another OFVector instance instead of copying it.
t | The object to move. |
T& OFrvalue_access | ( | OFrvalue_ref(T) | rv | ) |
Obtain an lvalue reference from an rvalue reference.
DCMTK's move emulations does restrict write access to rvalue references due to compiler limitations. This method enables you to workaround this restriction by converting DCMTK's emulated rvalue references to lvalue references.
rv | an rvalue reference, e.g. the parameter of a move constructor. |
void OFswap | ( | T & | t0, |
T & | t1 | ||
) |
Exchanges the given values.
OFswap is an alias for std::swap if C++11 is supported. Otherwise OFswap simply creates a temporary copy of one argument to exchange both values.
t0 | An object to be exchanged. |
t1 | The object to be exchanged with t0. |
Referenced by DSRTree< DSRDocumentTreeNode >::swap().