Trumphurst Ltd.

Submit a comment to an "Available C++ Libraries FAQ" entry

CategoryTools for C++ Programmers

Rich Booleans - A library to make powerful debugging libraries like ASSERT macros

The Rich Booleans framework is a set of macros that hold extra information if the condition fails, so a developer understands what goes wrong. They allow modularization of assertions and other constructs that check conditions, so on the one hand we can have different types of assertion macros (ASSERT, VERIFY, ASSERT_MSG, ...), and on the other hand macros that replace booleans in the assertion macros to provide extra information. So one could write ASSERT(rbEQUAL(a,b)), VERIFY(rbLESS(foo(), 10)), etc. These Rich Booleans can even be reused in other situations, like a TASSERT macro in a unit testing framework, or in contracts. The macros just have to know how to handle a rich boolean.

A number of interesting rich booleans are in this library, like rbEQUAL_STRING that shows where two strings are different (taking care of mismatches and insertions in an intelligent way), and similar ones for ranges of iterators and STL containers. They can be combined to make powerful checks, like checking whether the integer values in one vector are smaller than those in another vector, comparing two vectors of vectors, or combining rich booleans with logical operations.

They are released under the Boost License, which allows free use in any code. It was tested with Visual C++ and Gnu C++, but contains no platform or compiler specific code, so it should be portable.

Licensing : Non commercial

Do not expect an immediate response - the contents of this form will be added to a queue, which I process manually about once a week. If you don't fill in your email address correctly, you will not (obviously) get any reply at all. Other invalid information may result in a mailed request for clarification.

Enter your comment in the areas provided below. Be sure to include your name and email address.

Please don't bother trying to post spam or links to dodgy web sites - everything you post here is reviewed by a human being before being released for public viewing.

Your Name
Your Email Address

Click to submit your comment.
Up to the FAQ title page

For more information on any of Trumphurst's products and services, please

This page, and all contents, are Copyright © 1997-2021 by
Trumphurst Ltd.
The Willows
St. Martins Moor
SY10 7BH
Contact us is hosted by JumboCruiser.