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]

Re: libsupc++ nit picks


On Thu, Jan 03, 2002 at 06:35:23PM -0500, Phil Edwards wrote:
> On Thu, Jan 03, 2002 at 11:36:26PM +0000, Nathan Myers wrote:
> > Standard names used within standard implementations should always 
> > be qualified with "std::", either explicitly or through a 
> > using-declaration in an enclosing (not global!) scope.  Without
> > a qualification, you may risk ambiguity with or (worse) diversion 
> > to another function of the same name in a user's namespace, through
> > Koenig lookup.
> 
> This is still an open issue, isn't it?  Core DR 229, Library DR 225,
> 226, 229 all deal with this question.  The latest Issues Lists still have
> "we don't know what to do here" for these points.
> 
> Clearly for libsupc++ we should only use std:: names, but for the rest of
> the library that is not so clear.

What is clear is that implementations are allowed to use std:: names
within.  It's not clear whether they are allowed *not* to, and while 
it's well enough established that users are allowed to specialize
(e.g.) std::swap for their types, it's not established that an
implementation is required to use their specialization.  

It's also not quite clear enough that users are allowed to overload 
(e.g.) std::swap<> for their types, although that's the only way to 
get the effect of partial specialization for function templates.  It
is clear that it was meant to it be allowed.

We do users a favor by providing the more predictable behavior.     
The committee may eventually require it, or not, depending on how 
squidgy it happens to be when the vote comes up.

Nathan Myers
ncm at cantrip dot org


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