commented: every function should be nodiscard unless it returns void commented: Really? Even things like std::set::insert (which returns an iterator to the new element or the existing one and a boolean indicating whether the element was inserted or already present)? I've used that return value maybe once ever, out of all the times I've used that function. It's pretty common (at least in C++) to have functions which return something which some consumer might want but most consumers won't. Would you split that into two functions or just insist that every caller explicitly indicate that they don't need the return value? commented: Yeah exactly, just have two functions, one of them can call the other one. Been trying out this way of doing things for 10 years now. I can confidently say it's great. All upsides, no downsides. It's easy to discard something at the callsite, too. commented: m[k] for try emplace is actually a disgusting footgun, I wish they had tried to fight this fight :( commented: I'm with him on this. If I see mymap[key] at the beginning of a line, I'm going to expect an assignment of some kind and think it was possibly a bug if I didn't see one. The (void) will at least alert me that it's intentional and save me the trouble of double-checking it. Regarding old code bases, this seems like something you could add a clang-tidy modernize rule to change to .try_emplace() or add the (void) for you. .