Boost logo

Boost :

Subject: [boost] [utility] [assert] Proposal for a new assert macro which stores the failed values ("informative assert")
From: Viktor Sehr (viktor.sehr_at_[hidden])
Date: 2013-06-05 11:07:09

I'd like some opinions about this assert implementation which I'd like to
propose as an update of the old BOOST_ASSERT.

Basically it stores the failed values next to the expression string,
instead of just the expression string:
"5*5 < 2*2 | 25 | 4"

"INFORMATIVE_ASSERT(std::vector<int>(10).size() ==
"std::vector<int>(10).size() > std::vector<int>(12).size() | 10 | 12"

- If the class can't be serialized, the byte-data is logged instead.
- It writes the values to the expression string in order to be compliant
with any assert implementations

Easy to read implementation available here:

Modified version of BOOST_ASSERT available here:

/Viktor (Reposting this as I posted it without labels one week ago)

Boost list run by bdawes at, gregod at, cpdaniel at, john at