http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49561
Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blelbach at cct dot lsu.edu --- Comment #2 from Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> 2011-09-20 00:15:40 UTC --- (In reply to comment #1) > (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. The current standard is now C++11. 23.2.1, Table 96 explicitly states that the size() method of Containers must execute in constant time. Can this bug please be changed to confirmed? As of today (r178989), std::list<>::size() is still O(N).