Boost logo

Boost :

Subject: Re: [boost] [Review:Algorithms] all.hpp vs std::count
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2011-10-04 19:42:53


[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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk