Should the complexity of std::list::size() be O(n) or O(1)?
Peter Dimov
pdimov@mmltd.net
Tue Nov 29 18:49:00 GMT 2005
Gabriel Dos Reis wrote:
> "Peter Dimov" <pdimov@mmltd.net> writes:
>
>> I think that the general consensus is that while it is theoretically
>> possible to implement a non-contiguous conforming string as an
>> academic exercise,
>
> From the discussion, I have not seen a consensus that it would be an
> academic exercise. Rather, the consensus was that no implementation
> has had taken advantage of that latitude.
I probably am not allowed to reproduce c++std-lib postings here, but
everyone with access can read c++std-lib-16067 in which Matt Austern says
that "If you think about what would be required to have a conforming
noncontiguous implementation, you'll see pretty quickly why nobody has ever
shipped one."
More information about the Libstdc++
mailing list