Namespaces
Variants
Views
Actions

Talk:cpp/container/map/erase

From cppreference.com
< Talk:cpp‎ | container‎ | map
Revision as of 07:31, 12 April 2016 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Map cannot contain several entries with key key:

"3) Removes all elements with the key value key."


Should be replace with:

"3) Removes element with the key value key."

thanks, fixed --Cubbi (talk) 05:59, 16 July 2015 (PDT)

--- Is the complexity of variant (2) correct? Given two iterators, why would the complexity depend on the container size and not simply on the number of elements removed?

that's what the spec says, "Table 109 — Associative container requirements (in addition to container)", the entry for a.erase(q1, q2), complexity requirement is "log(a.size()) + N where N has the value distance(q1,q2)." --Cubbi (talk) 08:30, 12 April 2016 (PDT)