This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] | |
This converts various internal namespaces to use anonymous namespaces.
This is considered a complete transition, but there is undoubtedly
still more that could be done.
Previously, we had:
namespace Internal
namespace __gnu_cxx::_Rope_constants
namespace std::tr1::_Private
namespace __gnu_internal __attribute__((__visibility("hidden")))
These are all inferior to anonymous namespaces, which are now local
linkage only, with ISO C++ standard syntax. Plus, you get informative
error messages now when trying to determine if interface elements are
really local.
I think a good rule of thumb might be that when you have constant,
internal, private or other such names or designations for namespaces or
classes, or static const linkage, you can now use anonymous namespaces.
Some of the lookup rules seem to be different than what I'd expect. No
doubt, I'm wrong about my expectations. In any case, I've opened up a
bugzilla for this. In any case, these can always be simplified later.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28514
tested x86/linux
2006-07-27 Benjamin Kosnik <bkoz@wells.artheist.org>
PR libstdc++/19664 round 3
* include/Makefile.am (tr1_headers): Add hashtable_policy.h.
* include/Makefile.in: Regenerate.
* include/tr1/hashtable: Move policy classes into...
* include/tr1/hashtable_policy.h: ... this. New.
* src/globals_locale.cc: Move contents....
* src/locale_init.cc: ... to here, put in anonymous namespace.
* src/Makefile.am: Remove globals_locale.cc.
* src/Makefile.in: Regenerate.
* src/locale.cc: Convert __gnu_internal to anonymous namespace.
* src/debug.cc: Same.
* src/ext-inst.cc: Same.
* src/mt_allocator.cc: Same.
* src/pool_allocator.cc: Same.
* include/tr1/random: Convert std::tr1::_Private to anonymous
namespace.
* include/tr1/random.tcc: Same.
* include/tr1/hashtable: Move ::Internal to std::tr1::detail and
enclose bits that can actually be internal in in anonymous
namespace.
* include/tr1/unordered_set: Adjust explicit qualifications for
namespace changes.
* include/tr1/unordered_map: Same.
* include/tr1/cmath: Convert __gnu_internal to nested detail namespace.
* include/bits/cpp_type_traits.h: Move __type_type into anonymous
namespace.
* include/ext/rope: Change _Rope_constants to anonymous namespace.
* include/ext/ropeimpl.h: Same.
* src/ext-inst.cc: Same.
Attachment:
p.20060727.bz2
Description: BZip2 compressed data
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |