Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    Perhaps this belongs to codereview.stackexchange.com ? Commented May 24, 2018 at 21:12
  • Which tests, though? Commented May 24, 2018 at 21:14
  • 1
    auto nextInterval = --m_map.upper_bound(keyEnd);, if upper_bound returns begin() (as for empty map), you have UB. Commented May 24, 2018 at 21:15
  • 1
    Jarod42, I copied it from their reference implementation of operator[]. At the start the map is intialized with a single element with lowest possible key numeric_limits<K>::lowest() and should be never empty given everything works in a right way. Commented May 24, 2018 at 21:40
  • What is your try catch supposed to do ? strong guaranty exception ? there is potentially a m_map.erase not restored in that case... Commented May 24, 2018 at 22:15