Overview
Google, IBM & Meta Certificates — All 10,000+ Courses at 40% Off
One annual plan covers every course and certificate on Coursera. 40% off for a limited time.
Get Full Access
Explore the complexities of implementing a seemingly simple max function in this conference talk from C++Now 2025. Dive deep into the nuances of creating a fully generic max function, examining challenges like mixed comparisons (max(-1, 1u)) and handling different value categories (lvalue vs prvalue). Journey through advanced C++ concepts including mixed comparison functions, common types and common references, and language semantics considerations. Discover how to implement Rust-style lifetime annotations using template metaprogramming and extensive macro usage. Learn from Jonathan Müller, a Software Engineer at think-cell and C++ standardization committee member who chairs the std::ranges study group, as he demonstrates the art of overengineering a fundamental function while exploring whether such sophisticated implementations belong in production code.
Syllabus
Overengineering max(a, b) - Mixed Comparison Functions, Common References, and Rust's Lifetime
Taught by
CppNow