Become an AI & ML Engineer with Cal Poly EPaCE — IBM-Certified Training
NY State-Licensed Certificates in Design, Coding & AI — Online
Overview
Google, IBM & Meta Certificates – 40% Off
One plan covers every Professional Certificate on Coursera.
Unlock All Certificates
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