CppCon 2025 Back to Basics: Master C++ Friendship -- Mateusz Pusz
Registration is now open for CppCon 2026! The conference starts on September 12 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2026!
Back to Basics: Master C++ Friendship
by Mateusz Pusz
Summary of the talk:
C++ offers a rich set of access specifiers to control the visibility of class members. However, the friend keyword introduces a unique and often misunderstood concept. This talk explores the nuances of friendship, examining its role in code design, testing, and compilation performance optimization.
We'll delve into the intricacies of friendship, exploring its benefits and potential pitfalls. We'll examine how to leverage friendship effectively, discuss best practices, and uncover hidden gems and common misconceptions. We will see how friendship affects name lookup and compile-time error messages. We will discuss best practices for using it effectively and learn how to avoid or resolve compilation problems that may occur when C++ templates are involved.
By the end of this session, you'll have a solid grasp of friendship and be able to use it to write more elegant, efficient, and maintainable C++ code.

Registration is now open for CppCon 2026! The conference starts on September 12 and will be held
Mixing your units can be disastrous. Wu Yongwei takes a quick look at C++ unit libraries that can help keep everything in order.
Registration is now open for CppCon 2026! The conference starts on September 12 and will be held
Registration is now open for CppCon 2026! The conference starts on September 12 and will be held