DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
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::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

◆ operator OFBool()

OFExplicitBool::operator OFBool ( ) const
inline

Implicit conversion to OFBool.

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

◆ operator!()

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.

References m_Value.


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


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1