incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] std::swap (std::container&, std::container&) in MSVC 7.0
Date Thu, 28 Sep 2006 02:27:43 GMT
Farid Zaripov wrote:
>   If #defined _RWSTD_NO_PART_SPEC_OVERLOAD the functions
> std::swap (std::container&, std::container&) is not defined (where 
> container is vector, list, string, deque, ...).
> 
>   They may be defined the same way, as in the MSVC 7.0 STL:
> 
> class container
> {
> public:
>     friend void swap (container& __lhs, container& __rhs)
>     {
>         __lhs.swap (__rhs);
>     }
> };
> 
>   I have been added this functions with additional test 
> (etc/config/src/INLINE_FRIENDS.cpp).

Cool! Do you know of a compiler that doesn't allow friend functions
to be defined inside the class like this? If not, do we even need
this test?

If we do, I would suggest renaming it to INLINE_FRIEND (without
the 'S' at the end -- it's an unwritten and, unfortunately, not
always followed convention to keep the names as brief as possible
without compromising readability).

Thanks!
Martin

Mime
View raw message