C++14 standard defines the find() member functions of std::map
as follows:
iterator find(const key_type& x);
const_iterator find(const key_type& x) const;
Why are these functions not defined as noexcept
? What could possibly go wrong inside, that would require to throw an exception or produce undefined behavior (other than not finding an element in which case the function returns an end
iterator and no exception throwing would be required anyway)?