Boost logo

Boost :

From: Scott McCaskill (scott_at_[hidden])
Date: 2001-09-13 16:28:47

You assume that correct software will never specify an invalid index.
However, this is a big assumption for something as low level and general
purpose as std::vector or boost::array. For some applications, the
performance cost may be justified in order to further reduce the chances of
straying into the territory of undefined behavior (or having to duplicate
the range-checking functionality of std::vector::at()). Thankfully, we can
choose which tradeoff we prefer on a case-by-case basis.

----- Original Message -----
From: "Thomas Lien" <tgunlien_at_[hidden]>
To: "boost" <boost_at_[hidden]>
Sent: Wednesday, September 12, 2001 9:08 PM
Subject: [boost] Index Checking

> I want to comment about how index checking is handled
> in the std::vector and vicariously in boost::array. I
> feel having two different methods, operator[](int) and
> at(int), to specify whether you want to have index
> checking is bad design. A better way would be to
> decide at compile time whether or not you want to
> index check, possibly based on preprocessor values
> NDEBUG or perhaps INDEX_CHECKING. The way it stands
> now, I never want to use at(int) because eventually
> release versions of my code won't need it anymore. I
> understand that the since the standard does this,
> boost::array wanted to mimic it. IMHO, however, I
> believe index checking is best decided at compile
> time. I'm curious is anyone has other opinions about
> this.
> Repectfully Submitted:
> Tom Lien
> __________________________________________________
> Terrorist Attacks on U.S. - How can you help?
> Donate cash, emergency relief information
> Info: Unsubscribe:
> Your use of Yahoo! Groups is subject to

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