Conference | Live Schedule | Talks | Get your ticket | Slides | Set your timezone
Back to the basics: Namespaces 101
Sandor Dargo
On Day 2 at 13:15 (CET/Berlin) in Track C [Bernstein Room and online]
In this beginner-friendly talk, we are going to explore namespaces. They are an essential tool for organizing our codebase around different concerns and across different layers. But we cannot call it a day by simply stating that.
We also need to discuss their evolution. Over time, C++ introduced features like inline namespaces, which are a handy tool for API versioning. Additionally, namespace usage has been simplified—nested namespaces and even nested inline namespaces can now be opened directly.
After covering the syntactic basics, we will dive into how the compiler performs name lookup. Which namespaces will it check from a given scope? And if it cannot find a symbol, how can we bring in all or specific members of a namespace into our current scope? What advantages anonymous namespaces offer?
In the final section of our talk, we'll move beyond language rules to cover best practices based on the Core Guidelines, the Google Style Guide, and personal experience. This includes not just naming and formatting conventions, but also guidance on how and when to bring the contents of a namespace into a scope—and the potential pitfalls of the using keyword for your codebase.
Please login to comment