STL in global or std namespace?
Matthew Brown
mbrown@mediadb.net
Wed Nov 24 12:17:00 GMT 1999
>On Wed, 24 Nov 1999, John Law
wrote:
ÃÂ
[... snip ...]
ÃÂ
>gcc contains a hack that ignores the
std:: namespace; anything in >ÃÂ the std namespace is also
simultaneously in the global namespace. >ÃÂ E.g. , gcc is happy to
accept 'using std::vector;' but you can still use >ÃÂ vector whether
or not you have an appropriate using decl.
>
>IIRC, the hack is entirely in gcc, and
libstdc++ hasn't got anything to >ÃÂ say about it.
>
>If you want namespace std to be
honored, compile with -fhonor-std ... but >ÃÂ since namespaces get
mangled into signatures, I bet you will need to >ÃÂ re-compile
libstdc++ with -fhonor-std.
>
>However, I can't recall having used
-fhonor-std recently ... anyone else >ÃÂ used it?
ÃÂ
I am using libstdc++ 2.90.6 and gcc
2.95.1.
ÃÂ
I have usedÃÂ '-fhonor-std' successfully
when I ran into a similar problem -- only this was with a structure declared in
one of the Solaris system headers that conflicted with std::map. This caused a
real headache until I rebuilt libstdc++ with '-fhonor-std' -- so far, so good.
Incidentally, I also am using the new
'-fsquangle' flag with success in shortening the symbols of the templates; it
does cause all debuggers that I have used so far to not recognize the mangling
of symbols for which the new algorithm is used, but I find the 'squangled' names
to be sufficiently readable.
ÃÂ
-- Matthew Brown
BEGIN:VCARD
VERSION:2.1
N:Brown;Matthew
FN:Matthew Brown
ORG:Concord Software, Inc.
TITLE:Senior Programmer
TEL;WORK;VOICE:(603) 880-8151
TEL;WORK;FAX:(603) 886-1780
ADR;WORK:;;4 John Tyler Street;Merrimack;New Hampshire;03054;USA
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:4 John Tyler Street=0D=0AMerrimack, New Hampshire 03054=0D=0AUSA
X-WAB-GENDER:2
URL:
URL: http://www.concordsw.com
EMAIL;PREF;INTERNET:mbrown@mediadb.net
REV:19991124T201620Z
END:VCARD
More information about the Libstdc++
mailing list