Overengineering max(a, b) - Mixed Comparison Functions, Common References, and Rusts Lifetime @CppNow
Overengineering max(a, b) - Mixed Comparison Functions, Common References, and Rusts Lifetime  @CppNow
Uploaded October 2025 | Updated December 2026, 3 hours ago
cppnow.org
---

Overengineering max(a, b) - Mixed Comparison Functions, Common References, and Rust's Lifetime Annotations - Jonathan Müller - C++Now 2025
---

max is a function that returns the maximum of two numbers. While it seems simple on the surface, there are some nuances if you want to make max fully generic. For starters, what is max(-1, 1u) or max(lvalue, prvalue)?Let's go on a journey of overengineering max. We'll implement better mixed comparison functions, discuss common types and common references, wish for time machines to correct language semantics, and end up implementing Rust-style lifetime annotations using template metaprogramming and lots and lots of macros. The end result is a true work of art that we may or may not be using in actual production code.
---

Slides: github.com/boostcon/cppnow_presentations_2025/blob/main/Presentations/Overengineering_max.pdf

think-cell develops one of the world’s leading PowerPoint applications, with C++ at the core of everything we build, from layout algorithms to deep integration with Microsoft Office. Interested in working on challenging C++ problems with real-world impact? Explore our open roles: think-cell.com/en/career/tech---

Jonathan Müller

Jonathan is a Software Engineer at think-cell. There, he is responsible for maintaining think-cell's core libraries, which include a custom range library, a fast and convenient JSON parser, and many other utilities and data structures to write elegant C++ code. Before working at think-cell, he wrote many useful open-source C++ libraries. Jonathan is also a member of the C++ standardization committee, where he serves as the chair of the std::ranges study group and is a frequent conference speaker.


---

C++Now 2026 - 4th May - 8th May
C++Now is an annual onsite international C++ programming and coding conference held in Aspen, Colarado. For all C++ developers, C++ software engineers and those involved with the C++ language, CppNow provides an indepth and technical content provided by the best and brightest C++ experts of the C++ world.
Annual CppNow Conference - cppnow.org
linkedin.com/company/cppnow
twitter.com/cppnow
facebook.com/CppNow
reddit.com/r/CppNow
https://mastodon.social/@cppnow
Video Sponsors: think-cell and Bloomberg
---

Videos Filmed & Edited By Bash Films: bashfilms.com
YouTube Channel Managed & Optimized By Digital Medium Ltd: events.digital-medium.co.uk
---

#boost #cpp #cplusplus #programming #coding #softwareengineering #softwaredeveloper #code #cplusplusprogramming #cplusplustutorial #cplus #softwaredevelopment #coder #talk
Overengineering max(a, b) - Mixed Comparison Functions, Common References, and Rusts LifetimeLasting Quality - Michael Caisse - C++Now 2026A Deep Dive Into C++ Object Lifetimes - Jonathan Müller - C++Now 2024C++ Type Erasure Demystified - Fedor G Pikus - C++Now 2024Lightning Talk: The Average Lies: A 5-Minute Lesson in Tail Latency - Sampad Acharya - C++Now 2026Parallel Range Algorithms - The Evolution of Parallelism in C++ - Ruslan Arutyunyan - C++Now 2025Beyond Sequential Consistency - Leveraging Atomics for Fun & Profit - Christopher Fretz  C++Now 2025C++ Should Be C++ - David Sankel - C++Now 2024Exclusive Interview With C++Now 2024 Program Chair Inbal Levi with @cppevents!Lightning Talk: Organic Evolution of Reflection in Apache Thrift  - Shai Szulanski - C++Now 2026The C++ Vector Challenge - Lisa Lippincott - C++Now 2024Lightning Talk: Finding My First Compiler Bug - Braden Ganetsky - CppNow 2023
CppNow |

Overengineering max(a, b) - Mixed Comparison Functions, Common References, and Rust's Lifetime

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER