How to use std::map extract with iterators?
I’ve been trying to use extract()
to efficiently pull out a key and replace it, as the documentation says is possible. However, I can’t get my code to compile with a “regular” iterator
, and the documentation implies that a const_iterator
must be used instead.
C++ map: How do I get the key that was used to add an element into a std::map?
I’m creating a std::map
using keys that contain e.g. double
s as identifiers. However, I need the keys to have some leeway, i.e. tolerance, to identify a key as “the same”.