TCR
TCR copied to clipboard
increasing_function should overwrite on insert
std::insert doesn't overwrite, while we need this to update an existing index to a better value.
Just using m[x] works, but is much slower.
https://github.com/TimonKnigge/TCR/blob/master/snippets/datastructures/increasing_function.cpp#L12
Are you really that worried about the performance of m[x] = y? I'm also a bit uncomfortable with this hint parameter by the way, since apparently it behaves differently until C++11 then in C++11 and later [1].
[1] https://en.cppreference.com/w/cpp/container/set/insert