Thoughts on __gnu_cxx
Stephen M. Webb
stephen.webb@bregmasoft.com
Fri Jan 25 13:56:00 GMT 2002
On January 25, 2002 04:11 pm, Phil Edwards wrote:
>
> Some possibilities:
>
> Maybe we should leave the implemenation details in __gnu_cxx, and
> move the public extensions to 'gnu' or 'gnu_cxx'?
This is my favorite, because anything starting with underscores screams
"hands off" to me. By putting provided extensions in the gnu namespace
it looks and acts like other libraries, for example boost or loki.
Since the extensions are not part of the standard library, there's no
need to uglify them. It's just that if you get the GNU standard C++
library, you get this other library of extensions for free. Now how
much would you pay? No other standard library gives you so much.
That, and gnu and std both have 3 lower case letters. The symmetry
cannot be ignored.
> Maybe we should leave everything in __gnu_cxx, and make gnu_cxx (or
> whatever) an alias?
This gains nothing. Users will still try to use the implementation
functions as if it's their right.
> Maybe leave everything in __gnu_cxx, and make gnu_cxx a separate
> namespace completely, which simply brings __gnu_cxx members into view
> via 'using'? Or wraps them in non-uglified names? Frex:
>
> namespace nifty_gnu_extensions
> {
> void verbose_terminate_handler()
> {
> __gnu_cxx::verbose_terminate_handler();
> }
>
> ... other bits ...
> }
That sounds like more work than just separating the functions. Of
course, it may be the best way to jack some implementation names (like
__gnu_cxx::__verbose_terminate_handler()) into the extension library
(as gnu::verbose_terminate_handler()).
I think anything that is published as an extension should __not__ have
uglified names, and that anything that has uglified names should
__not__ be published as an extension.
--
Stephen M. Webb
More information about the Libstdc++
mailing list