You don't need anything like this for C++
You don't need anything like this for C++
Posted Jul 9, 2012 10:46 UTC (Mon) by jwakely (subscriber, #60262)In reply to: You don't need anything like this for C++ by cmccabe
Parent article: Calling for a new openSUSE development model
It's not really "very similar" to using namespace version2, an inline namespace is a lot more transparent so users never need know it exists (unless they look at the mangled symbols in their objects.)
A using-directive just makes names visible, but they are not treated as first-class members of the namespace containing the using-directive and will not be found by qualified name lookup if there are declarations of the same name in the namespace containing the using-directive. That's not the case for inline namespaces.
Templates defined in an inline namespace can be instantiated and specialized as though they are members of the enclosing namespace, not possible via a using-directive.
An inline namespace is an associated namespace of types in its enclosing namespace and vice versa, so it plays nicely with ADL.
Don't dismiss the feature because you don't understand it yet.
