Migrated from the original repository
Original issue: serge-sans-paille/frozen#156
Originally reported by: @mikekaganski
map::at() is implemented using at_impl, which itself is:
template <class This, class KeyType>
static inline constexpr auto& at_impl(This&& self, KeyType const &key) {
auto where = self.lower_bound(key);
if (where != self.end())
return where->second;
else
FROZEN_THROW_OR_ABORT(std::out_of_range("unknown key"));
}
So whenever lower_bound succeeds, it returns the found value. But lower_bound returns whatever compares not less than — so a check is needed that it is equal to? Possibly using find_impl.
map::at()is implemented usingat_impl, which itself is:So whenever
lower_boundsucceeds, it returns the found value. Butlower_boundreturns whatever compares not less than — so a check is needed that it is equal to? Possibly usingfind_impl.