This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strong using directives


Jason,
looking at how we implement inline namespaces on the back of strong using directives, I notice that strong using is much more general. One can name a target namespace from multple different strong using directives in different namespaces. (The DECL_NAMESPACE_ASSOCIATIONS is a list of the namespaces that strongly use this one.) Abuse of that could lead to horrible performance of ADL searching and the like. And simply restricting to inline namespace semantics of being an immediate child namespace would permit some simplifications and presumably speed ups of name-lookup (even with transitivity).

The documentation though says that a strong using is equivalent to an inline namespace, and strong using will be removed in a future release:


{Caution:} The semantics of this extension are equivalent
to C++ 2011 inline namespaces.  Users should use inline namespaces
instead as this extension will be removed in future versions of G++.
(added Jul 2012, which, in addition to noting inline namespace is now a thing, changed an existing 'may be removed' to 'will be removed')

1) the extra functionality of strong using seems pretty odd -- do you know of any uses of it?

2) what are your thoughts of actively deprecating strong using in gcc 7? I.e. emit a deprecation warning.

nathan
--
Nathan Sidwell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]