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: [Patch] Qualify standard functions with std:: in stl_algo.h


On Sun, Jun 29, 2003 at 11:31:58PM +0200, Gabriel Dos Reis wrote:
> | !       return __unique_copy(__first, __last, __result, __binary_pred, _IterType());
> 
> This should also be qualified -- even though the identifier is in the
> implementor namespace.

I don't agree that this is necessary.  No conforming user program is
affected by such a qualification.  Certainly the patch should not be 
held back waiting for such qualifications.

> | ! 	std::swap(*__first++, *__first2++);
> 
> This swap needs not be qualified.
> 
> swap has sort of become to have an operator-like status: It is
> regarded as a fundamental operator.  In the EWG, we're exploring the
> notion of "regular types", and swap is considered one of the
> fundamental operations on those type.  We need to have them work
> through ADL.

I don't agree.  The standard swap() is in std::, and that's the one we 
want to call.  Herb Sutter would argue otherwise, but he also argues 
otherwise about every other algorithm that users are encouraged to 
specialize.

Users are certainly allowed to declare a global swap, but if they 
expect it to be used by standard algorithms, they need to go the
extra distance and overload the standard one.

Nathan Myers
ncm-nospam@cantrip.org


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