This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Possible bug in list::size()? Or my misreading?
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- To: Brad Spencer <spencer at infointeractive dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 3 Jan 2002 16:49:24 -0500
- Subject: Re: Possible bug in list::size()? Or my misreading?
- References: <20020103172006.D18928@infointeractive.com>
On Thu, Jan 03, 2002 at 05:20:06PM -0400, Brad Spencer wrote:
> Please tell me I've just misunderstood this all these years, but my
> copy of the standard says, in Section 23.1, Table 65:
>
> Those entries marked "(Note A)" should have constant complexity.
>
> Sure enough, size() is marked with "(Note A)". However, the trivial
> program below is enough to show that this is not the case and list
> computes its size in O(n) with each call to size! What have I missed?
http://www.sgi.com/tech/stl/FAQ.html
I should probably restate this in our own docs. Yeah.
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams