Loading…
CppCon 2025 has ended
Monday September 15, 2025 14:00 - 15:00 MDT
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.

Presenters
avatar for Mateusz Pusz

Mateusz Pusz

C++ Trainer, Train IT
Mateusz Pusz is a C++ architect and voting member of the ISO C++ Committee (WG21), with 100% meeting attendance since 2017. As an active contributor to Library Evolution, he originated variable template template parameters (P2008, now part of C++26), co-authored heterogeneous lookup... Read More →
Monday September 15, 2025 14:00 - 15:00 MDT
Summit 10/11

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Share Modal

Share this link via

Or copy link