DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

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 Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8