DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
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.
| operator OFBool () const
| Implicit conversion to OFBool.
OFBool | operator! () const
| Negation operator.

## 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

  value | either 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.

References m_Value.

## ◆ 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:

- ofstd/include/dcmtk/ofstd/ofexbl.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2