Does it make any sense to define operator< as noexcept?
I know that it makes perfect sense to define e.g. move constructor as noexcept
(if possible) and I think I understand the effect of that.
Why we need to add const in the custom comparator in C++
vector<vector<int>>& intervals auto comp = [](const vector<int>& a, const vector<int>& b) { return a[0] < b[0]; }; auto it = upper_bound(intervals.begin(), intervals.end(), newInterval, comp); I am not very familiar with C++ and was confused about how comparator works. The above code is how I can find the position I want to insert a new interval, […]