Is it really unspecified, or did I miss something?
Yes. At the moment, it is really unspecified.
There is an open library issue for this, whose text contains a link to a relevant Q&A on StackOverflow. The answer by Jonathan Wakely to that question clarifies what has been going on.
According to the linked proposal, the complexity requirement of clear()
should be made linear for all sequence containers. However, one must keep in mind that complexity requirements are just upper bounds. Per Paragraph 17.5.1.4/7 of the C++11 Standard:
Complexity requirements specified in the library clauses are upper bounds, and implementations that provide better complexity guarantees satisfy the requirements.
This allows for possible optimizations, but does not mandate them.
Even when the linked proposal will be accepted, we will not be allowed to assume that clear()
has O(1) complexity for sequence containers of non-class elements, even though this seems to be a natural and common optimization strategy (and the answer by dasblinkenlight to this question on SO confirms it).
Implementations will be allowed to adopt this strategy (per 17.5.1.4/7), but they won't be required to do so, because nowhere in the Standard such a constraint is (nor is it proposed to be) specified.