DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
OFdefault_optional_traits< T > Class Template Reference

Default storage traits of OFoptional<T>. More...

Detailed Description

template<typename T>
class OFdefault_optional_traits< T >

Default storage traits of OFoptional<T>.

OFdefault_optional_traits manages the state and storage of the contained object in a portable manner. You may use this class as base when defining custom traits for a specific type T, so you won't have to re-implement this functionality entirely.

Template Parameters
Tthe content type of the respective OFoptional instance.
See also
OFoptional
OFoptional_traits

Example

This example shows how to override the is_default_constructible attribute of OFoptional_traits for the custom class Test.

// Note: Test's default constructor is private
// which leads to errors when being used within
// OFoptional, since a default constructor exists
// but can't be accessed.
class Test
{
Test() {}
public:
static OFoptional<T> instance();
.
.
.
};
// Override OFoptional's behavior to fix this problem
template<>
struct OFoptional_traits<Test>
: OFdefault_optional_traits<Test> // derived from default traits
{
// Tell OFoptional that it can't default-construct
// a Test object.
typedef OFfalse_type is_default_constructible;
};

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


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13