Boost logo

Boost Users :

Subject: Re: [Boost-users] Is there a self contained vector-like container?
From: Nevin Liber (nevin_at_[hidden])
Date: 2012-03-01 17:07:45

On 1 March 2012 15:15, Frank Birbacher <bloodymir.crap_at_[hidden]> wrote:

> I'd like to see it. Actually I need one of those but with some special
> property: the size type shall be changable to e.g. unsigned char.

In the interface or the implementation?

If it is in the interface, I'd rather it match the other containers and be
a size_t.

In the implementation, well, that's just a detail that should be weighed
against other concerns (what is the efficiency (both space and typical
access) tradeoff between storing the size vs. storing a pointer to end vs.
conversion of a "smaller" size to size_t).

Your use case (char array) is fairly easy to whip up with just an array and
a size. Alignment, exception safety or move semantics is what makes this
container non-trivial to write.

 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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