Boost logo

Boost Users :

From: Darin Adler (darin_at_[hidden])
Date: 2002-02-04 12:20:23

On 2/4/02 9:03 AM, "Duane Murphy" <duanemurphy_at_[hidden]> wrote:

> I would be interested in finding a class that is somewhere between
> allocating my own buffers and vector<>. Low overhead for simple
> allocations; no resizing or growing. Even in this case, in order to
> support iterator semantics the size is going to be needed.

There's a class boost::array that will sometimes meet your requirements.
There's another proposed class that will probably show up in a future
version of Boost called boost::fixed_capacity_vector that might also meet
your requirements. A boost::scoped_array or boost::shared_array is
occasionally useful, but not often.

But be wary of overestimating the importance of std::vector's low overhead.
It's often quite affordable, and not having a fixed capacity limit can be a
valuable feature that can help you avoid buffer overrun problems.

    -- Darin

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at