This is the mail archive of the gcc-bugs@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]

Re: A specialization bug?



> Gcc 2.95.3 in default configuration compiles it well.

GCC 2.x did not fully support namespace std.  GCC 3 does.  Code which assumes
the existence or non-existence of std:: will often behave differently when
moving from 2.x to 3.x.

> I have to wrap the definition in namespace std to make it compile,
> which seems against the C++ standard.

It's required by the standard.  If you are going to specialize a template
declared in namespace std, then you must re-open namespace std to write
the specialization.  Writing std::hash isn't enough.

Note that hash_map and the hash template are /not/ part of the C++ standard.
They're sitting in namespace std in GCC 3.0 for hysterical raisins.
For a future GCC release they will be in a different namespace.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


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