Mbed OS Reference
|
Safe conversion of objects in boolean context. More...
#include <SafeBool.h>
Public Member Functions | |
operator BoolType_t () const | |
Bool operator implementation, derived class must provide a bool toBool() const function. More... | |
Protected Types | |
typedef void(base::* | BoolType_t) () const |
The bool type is a pointer to method that can be used in boolean context. More... | |
Protected Member Functions | |
void | invalidTag () const |
Nonimplemented call, use to disallow conversion between unrelated types. More... | |
void | trueTag () const |
Special member function that indicates a true value. More... | |
Safe conversion of objects in boolean context.
Classes wanting evaluation of their instances in boolean context must derive publicly from this class rather than implementing the easy to misuse operator bool().
Descendant classes must implement the function bool toBool() const to enable the safe conversion in boolean context.
T | Type of the derived class |
Definition at line 113 of file common/SafeBool.h.
|
protectedinherited |
The bool type is a pointer to method that can be used in boolean context.
Definition at line 50 of file common/SafeBool.h.
operator BoolType_t | ( | ) | const |
Bool operator implementation, derived class must provide a bool toBool() const function.
Definition at line 119 of file common/SafeBool.h.
|
protectedinherited |
Nonimplemented call, use to disallow conversion between unrelated types.
|
protectedinherited |
Special member function that indicates a true value.
Definition at line 60 of file common/SafeBool.h.