Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2001-10-26 17:39:23


on 10/26/01 3:35 PM, Fernando Cacciola at fcacciola_at_[hidden] wrote:

> Should we sketch a "defect management configurable framework"? What about
> the debugging tools submitted by Brian Parker a few days ago? Can that be
> made to fit here?

I suggest an extremely simple framework. My proposal for the entire
configurable framework would be:

    #ifndef BOOST_ASSERT
    # include <cassert>
    # define BOOST_ASSERT(x) assert(x)
    #endif

Perhaps you want to propose a more-complex framework.

I think the really tricky bit is to figure out how to name the proposed two
different versions of numeric_cast. One is more like dynamic_cast, and the
other more like static_cast, but numeric_dynamic_cast and
numeric_checked_cast would be terrible names.

I also realized that it would be good to have a third kind of numeric
conversion, for generic programming. That would be a conversion that asserts
that no precision is lost. The current conversion throws an exception if the
result is out of range, but having one that asserts if the result loses
precision would be useful too, I think.

    -- Darin


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk