Topic: std::list specification (Was: vector will be contiguous (Was: variable length arrays in)
Author: Valentin Bonnard <Bonnard.V@wanadoo.fr>
Date: 1999/08/04 Raw View
Dave Harris wrote:
> abrahams@mediaone.net (Dave Abrahams) wrote:
> > > Similarly the STL list<> requires that size() be O(1) which means the
> > > length must be stored rather than calculated as needed. This doubles
> > > the memory overhead for a zero-length list and means splice cannot be
> > > O(1). Again these are highly specific, and controversial, choices.
> >
> > Actually, the exact opposite is the case.
>
> Really? You mean std::list<>::size() is not O(1)
It is not
> and splice is?
Maybe, maybe not
> Still, my main point - that these were specific, controversial choices
> which constrain implementations - remains.
Which let the user choose the right tool portably.
--
Valentin Bonnard
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]