This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/49561] gcc does not meet the standard for std::list container
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Jun 2011 08:48:06 +0000
- Subject: [Bug libstdc++/49561] gcc does not meet the standard for std::list container
- Auto-submitted: auto-generated
- References: <bug-49561-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49561
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-28 08:47:47 UTC ---
(In reply to comment #0)
> I realized that the complexity of std::list::size() is O(n), not O(1).
>
> This does not conform to standard. The standard states that size() function is
> in constant time for alls containers.
No, the current standard does not.
The C++0x draft does, but it's not yet a standard, and parts of it are not yet
implemented.