Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

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

cpponsea via YouTube

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 an in-depth conference talk from C++ on Sea 2024 where Jonathan Müller, a Software Engineer at think-cell, delves into the complexities of implementing a seemingly simple max() function. Learn how to handle mixed comparison functions, understand common references, and implement Rust-style lifetime annotations using template metaprogramming and macros. Discover the nuances of making max() fully generic, addressing challenges like comparing signed and unsigned numbers (max(-1, 1u)) and different value categories (max(lvalue, prvalue)). Follow along as the speaker demonstrates advanced C++ techniques, discusses language semantics, and presents a sophisticated implementation that bridges C++ and Rust concepts. While the resulting solution may be considered overengineered, gain valuable insights into template metaprogramming, macro usage, and modern C++ design patterns that can be applied to real-world programming challenges.

Syllabus

Overengineering max(a, b) Mixed Comparison Functions, Common References & Rust Lifetime Annotations

Taught by

cpponsea

Reviews

Start your review of Overengineering max(a, b) - Mixed Comparison Functions, Common References and Rust Lifetime Annotations

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.