|
Boost : |
From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-10-18 11:56:45
At Thursday 2002/10/17 12:01, you wrote:
>Herve Bronnimann wrote:
>
>>I assume that by fixed-size vectors your mean a sequence container where
>>all the operations insert/erase have been made inacessible?
>>imho you don't need a container adaptor for fixed-size vector. You
>>should rewrite your code to use a range [first,last) instead.
>
>I was thinking more of a vector (or deque) where inserting an
>element on a full container (however "full" is defined) would
>either throw an exception, automatically remove an element from the
>container before inserting the new one or take some other
>policy-dependent action.
you mean a 'maximum sized' container then, not 'fixed', correct?
> Ditto on the removal side.
>
>>Granted you can't pass a range as a single object, but Jeremy Siek has
>>written (in the boost-sandbox) a series of container algorithms that
>>take a pair<iterator,iterator> (representing a range) and applying
>>standard library functions to the pair. It's pretty usable (he uses it
>>in the BGL IIRC, but don't take my word for it, go look!)
>
>Unfortunately, a range is (I think) too static for my needs. I
>suppose I could write algorithms to simulate item insertion and
>removal via copying, but that is expensive. Am I missing
>something important? I'd love to learn that something like this
>exists already, especially something not in the form I envisioned.
>
>>I'm really unclear as to what a container adaptor library would provide
>>(are you thinking of something along the lines of std::stack,
>>std::queue, and std::priority_queue?) I'm pretty convinced that
>>fixed-size vectors would encourage using the wrong solution style, but
>>they are a convenience, and some people can't live without a certain
>>level of it. Other adaptors may be more useful, would you have a few
>>suggestions?
>
>I had stack, queue, etc. in mind when I wrote the post. I'm curious
>why you feel fixed-sized vectors encourage the wrong solution style.
>What is the solution style you are worried about?
>
>In case you're interested, I'm planning on using these containers to
>model hardware queues, etc. in a simulation environment.
>
> -Dave
>
>--
>
>"Some little people have music in them, but Fats, he was all music,
> and you know how big he was." -- James P. Johnson
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
"There oughta be a law"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk