Boost logo

Boost :

From: Thomas Lien (tgunlien_at_[hidden])
Date: 2001-09-14 09:49:09

As programmer, I can understand why production code
might still want index checking. What would be fine
with me, and other boost members from the responses,
is if we put an assert into operator[](int). Would
anyone oppose this?

--- Scott McCaskill <scott_at_[hidden]> wrote:
> 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.

Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information

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