libzypp
10.5.0
|
Validate objects in a boolean context without harmful side effects. More...
#include <SafeBool.h>
Public Types | |
typedef safebool_detail::SafeBoolBase::bool_type | bool_type |
Public Member Functions | |
operator bool_type () const | |
Protected Member Functions | |
~SafeBool () |
Validate objects in a boolean context without harmful side effects.
Uses CRTP to avoid a virtual function. _Derived
must provide bool boolTest() const
preformong the test.
Foo
, based on the bool_type values. Make shure you overload both operators, in case an other semantic is desired for ==/!=.class Foo : protected base::SafeBool<Foo> { public: using base::SafeBool<Foo>::operator bool_type; private: friend SafeBool<TT>::operator bool_type() const; bool boolTest() const { // Perform Boolean logic here } };
Definition at line 70 of file SafeBool.h.
typedef safebool_detail::SafeBoolBase::bool_type zypp::base::SafeBool< _Derived >::bool_type |
Reimplemented from zypp::base::safebool_detail::SafeBoolBase.
Reimplemented in zypp::bit::BitField< _IntT >, zypp::bit::BitField< FieldType >, zypp::bit::BitField< uint64_t >, zypp::IdStringType< Derived >, zypp::IdStringType< ResKind >, zypp::IdStringType< Edition >, zypp::IdStringType< PoolQueryAttr >, zypp::IdStringType< PackageKeyword >, and zypp::IdStringType< SolvAttr >.
Definition at line 72 of file SafeBool.h.
zypp::base::SafeBool< _Derived >::~SafeBool | ( | ) | [inline, protected] |
Definition at line 80 of file SafeBool.h.
zypp::base::SafeBool< _Derived >::operator bool_type | ( | ) | const [inline] |
Definition at line 73 of file SafeBool.h.