Is there a way for std::map to "edit" values like a predicate for the key?
- by Marlon
I am wondering if it is possible to create something like a predicate for a std::map for all of its values so I don't have to edit the values before I insert them into the map.
What I would like is something like this:
mymap["username"] = " Marlon "; // notice the space on both sides of my name
assert(mymap["username"] == "Marlon"); // no more…