DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
OFExplicitBool Class Reference

Helper class for resolving overloaded functions. More...

Public Member Functions

 OFExplicitBool (explicit OFBool value)
 Construct an OFExplicitBool object from an explicit OFBool value. More...
 
 operator OFBool () const
 Implicit conversion to OFBool. More...
 
OFBool operator! () const
 Negation operator. More...
 

Private Attributes

OFBool m_Value
 The underlying boolean value.
 

Detailed Description

Helper class for resolving overloaded functions.

OFExplicitBool can be used to restrict an overloaded function's parameter to "real" OFBool values, e.g. pointers and numeric values can NOT be converted to OFExplicitBool implicitly.

Note
OFBool falls back to "int" on platforms that don't support the keyword "bool". Therefore the conversion of int values to OFExplicitBool can't be prevented on those platforms.

Constructor & Destructor Documentation

OFExplicitBool::OFExplicitBool ( explicit OFBool  value)
inline

Construct an OFExplicitBool object from an explicit OFBool value.

Parameters
valueeither OFTrue or OFFalse.
Note
"explicit OFBool" is not a valid C++ type. It's just a term to explain the concept of OFExplicitBool, that is realized by SFINAE mechanisms in reality.

Member Function Documentation

OFExplicitBool::operator OFBool ( ) const
inline

Implicit conversion to OFBool.

This allows to use OFExplicitBool like a normal OFBool value, for example in if-statements.

OFBool OFExplicitBool::operator! ( ) const
inline

Negation operator.

This allows to negate OFExplicitBool like a normal OFBool value, for example to use the negated value in if-statements.


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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8