3 ms·
For the last 20 years, C++ standard library uses `operator <` for std::sort, and for building red black trees like std::map and std::set; `operator >` is not us
by Const-me 7y ago
For the last 20 years, C++ standard library uses `operator <` for std::sort, and for building red black trees like std::map and std::set; `operator >` is not used.
Making this a warning would probably break too much existing code.
- gumby 7y agoWell, you can use whatever extremities of strictness and year of standard for new code (mine is currently c++17 + pretty much every possible warning). And you can keep lower levels of warning for older, or third party code. In the case of the standard library, the whole library is being hoisted to use <=> in c++ 20. Old code will still work with the latest library of course.
- Const-me 7y ago> And you can keep lower levels of warning for older, or third party code. Maybe, but I think it’s hard to do in practice. Many C++ libraries are header only because templates, i.e. old and new stuff is mixed really well. Differentiating warnings is possible with #pragma but they aren’t portable across compilers.
- gumby 7y agoWhat we do is make a small shim to a more modern interface and then compile the shim, with the includes, in c++11 mode with whatever warnings disabled as necessary. I know this doesn't work for everyone and we can't even do it with everything. But it helps a lot.