Awkward test type that is convertible to bool.

Synopsis

Declared in <bsltf_evilbooleantype.h>

struct EvilBooleanType;

Description

This class provides a test type for predicates returning a type that is convertible‐to‐bool. It makes life reasonably difficult by disabling the address‐of and comma operators, but deliberately does not overload the && and || operators, as we hope the standard will be updated to no longer require such support. Once C++11 becomes available, this class would use an explicit operator bool() conversion operator, and explicitly supply the == and != operators, but we use the convertible‐to‐pointer‐to‐member idiom in the meantime. Implicitly defined operations fill out the API as needed.

Member Functions

Name

Description

EvilBooleanType [constructor]

Constructors

~EvilBooleanType [destructor]

Destroy this object.

operator BoolResult

Convert this object to a boolean‐testable result.

operator!

Return the newly created object having the logically negated value of this object.

Non-Member Functions

Name

Description

operator!=

Return whether two objects do not have the same value.

operator==

Return whether two objects have the same value.

Created with MrDocs