CppCon 2025 The Pattern Matching We Already Have -- Braden Ganetsky
Registration is now open for CppCon 2025! The conference starts on September 13 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2025!
The Pattern Matching We Already Have
Friday, September 19 09:00 - 10:00 MDT
by Braden Ganetsky
Summary of the talk:
All the way since C++98, we have already had pattern matching in C++! It's limited to specific places, but it's there. Template argument deduction, function overload resolution, and class template specializations are all instances of pattern matching in the C++ language, dating all the way back to the original standard.
The C++11 additions to the language also require library constructs to help deal with type deduction in forwarding references, namely std::forward, among others. Even experienced C++ developers may run into unexpected situations using it, especially in newer scenarios like concepts from C++20. This talk will lay clear the rules of forwarding and std::forward, and how you can forward your arguments properly every time.
This interactive talk is a deep dive into template argument deduction, helping you to understand it at deeper level across all of C++'s lifespan. Almost all that applies in C++98 still applies today, so a foundational understanding is important. Additionally, newer language standards have introduced further wrinkles, like C++11's move semantics and variadic template parameters, as well as C++17's class template argument deduction. By the end of this talk, you will have a solid understanding of how C++ deduces the types used in your code.
Braden Ganetsky graduated from the University of Manitoba with a degree in mechanical engineering, fueled by his passion for mechanical puzzles. During his final year of school, when all classes and activities were remote, he discovered C++ and has been hooked ever since. He interned as a C++ developer, which turned into a full time job, completing a successful pivot of his career. Now he spend his nights working on fun projects like parser combinators, and getting involved in the C++ community. Since 2023, Braden sits on the ISO C++ Committee as a representative of Canada.