DCMTK  Version 3.6.4
OFFIS DICOM Toolkit
Classes
ofvriant.h File Reference

Declares OFvariant and related functionality. More...

Classes

class  OFvariant< Alternatives >
 A class template that represents a type-safe union. More...
 
struct  OFmonostate
 A helper type for making OFvariant default constructible. More...
 

Detailed Description

Declares OFvariant and related functionality.


Class Documentation

◆ OFmonostate

struct OFmonostate

A helper type for making OFvariant default constructible.

Use OFmonostate as the first alternative of an OFvariant otherwise holding a non default constructible type as the first alternative for making the variant itself default constructible.

Note
Be aware that any visitor applied to such an OFvariant object must also accept OFmonostate as an argument.

Example

template<typename T>
struct NonDefaultConstructible
{
NonDefaultConstructible( T t ) : value( t ) {}
T value;
};
typedef NonDefaultConstructible<int> nint;
typedef NonDefaultConstructible<float> nfloat;
// ...
OFvariant<nint,nfloat> v( 3 ); // OK, but what if we don't know the value yet?
v = 3; // assign the value when it's known


Generated on Thu Nov 29 2018 for DCMTK Version 3.6.4 by Doxygen 1.8.14