
4 Oct
2011
4 Oct
'11
11:42 p.m.
[Dave Abrahams]
Furthermore, the size() operation on std::list is not (necessarily) O(1).
FDIS 23.2.1 [container.requirements.general] requires a.size() to have constant complexity. 23.3.5 [list] doesn't specify any exceptions to this. 23.3.4.1 [forwardlist.overview]/2 does: "A forward_list satisfies all of the requirements of a container (Table 96), except that the size() member function is not provided." This was changed from C++03, which specified that size() "should have constant complexity". STL