This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should the complexity of std::list::size() be O(n) or O(1)?


On 29 Nov 2005 16:47:14 +0100, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
> Jonathan Wakely <jwakely.gcc@gmail.com> writes:
> 
> | Sorry for going off on a tangent, but does the standard actually
> | require contiguous storage for std::string?
> 
> It does not.  But, that does not matter.  Just pretend it does and if 
> implementations don't agree you, decree they are not portable <g>.

For this case, that's exactly what I do.  It works everywhere I need it to.
 
Thanks for confirming that, Gaby & Peter, I'll continue to write code assuming it if I need to, but continue to feel dirty for doing so ;-)

jon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]