|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2000-12-15 11:12:59
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") )
On Thu, 14 Dec 2000, Jesse Jones wrote:
jejone> >I notice that bounds checking in array.hpp is only done when the at()
jejone> >methods are used. I think it would be a great boon to the community
jejone> >using boost if there could be a debug mode -- either use asserts or,
jejone> >as the STLPort does, have a boost_debug namespace and do range
jejone> >checking for classes imported from there. Does this make sense?
jejone>
jejone> Most definitely.
jejone>
jejone> -- Jesse
jejone>
jejone>
jejone>
jejone>
jejone>
jejone>
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk