Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LinkNode-Test by
SafeBool< T > Class Template Reference
template class SafeBool use CRTP to made boolean conversion easy and correct. More...
#include <SafeBool.h>
Inherits SafeBool_::base.
Public Member Functions | |
operator BoolType_t () const | |
bool operator implementation, derived class has to provide bool toBool() const function. |
Detailed Description
template<typename T>
class SafeBool< T >
template class SafeBool use CRTP to made boolean conversion easy and correct.
Derived class should implement the function bool toBool() const to make this work. Inheritance should be public.
- Template Parameters:
-
T Type of the derived class
class A : public SafeBool<A> { public: // boolean conversion bool toBool() { } }; class B : public SafeBool<B> { public: // boolean conversion bool toBool() const { } }; A a; B b; // will compile if(a) { } // compilation error if(a == b) { }
Definition at line 89 of file SafeBool.h.
Member Function Documentation
operator BoolType_t | ( | ) | const |
bool operator implementation, derived class has to provide bool toBool() const function.
Definition at line 94 of file SafeBool.h.
Generated on Tue Jul 12 2022 16:00:25 by
