CppCon 2021 has ended
Back To Schedule
Friday, October 29 • 10:30am - 11:30am
Correctly Calculating min, max, and More: What Can Go Wrong?

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
The C++ standard library long ago selected operator < as its ordering primitive, and even spells it in several different ways (e.g., std::less).

This talk will explain why operator < (and its aliases) must be used with care, in even such seemingly simple algorithms as max and min.

We will also discuss the use of operator < in several other order-related algorithms, showing how easy it is to make mistakes when using the operator < primitive directly, no matter how it’s spelled.  (Of course, we will also present a straightforward technique to avoid such mistakes.)

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

avatar for Walter E Brown

Walter E Brown

With broad experience in industry, academia, consulting, and research, Dr. Walter E. Brown has been a computer programmer for almost 60 years, and a C++ programmer for more than 40 years.He joined the C++ standards effort in 2000, and has since written circa 175 proposal papers. Among... Read More →

Friday October 29, 2021 10:30am - 11:30am MDT