Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-12-17 08:49:24


----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>

> Should we have a boost macro for adding in this kind of assertion?
>
> #define BOOST_ASSERT_RANGE(expr) \
> if (expr) \
> throw std::range_error( \
> __FILE__ + std::string(":") \
> + boost::lexical_cast<std::string>(__LINE__) + \
> std::string(": range error") )

I don't think so. IMO, it would be much better to supply a single
BOOST_ASSERT() macro with hookable semantics. In many (most?) cases,
throwing an exception is an inappropriate response to a precondition
violation.

-Dave


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