Open mikekaganski opened 1 year ago
What code exactly are you looking at? Because this looks fine to me by doing almost exactly what you suggest (deferring to find
, though not find_impl
):
https://github.com/serge-sans-paille/frozen/blob/5666e8cd770fa1fc6afbc3c24a36aad418332e73/include/frozen/map.h#L194-L201
map::at() is implemented using at_impl, which itself is:
So whenever
lower_bound
succeeds, it returns the found value. Butlower_bound
returns whatever compares not less than - so a check is needed, that it is equal to? Possibly usingfind_impl
.