Index: etc/config/src/INLINE_FRIENDS.cpp =================================================================== --- etc/config/src/INLINE_FRIENDS.cpp (revision 0) +++ etc/config/src/INLINE_FRIENDS.cpp (revision 0) @@ -0,0 +1,24 @@ +// checking for inline friends + +struct A +{ + friend void foo (A) { } +}; + + +template +struct B +{ + friend void foo (B) { } +}; + + +// check that friends are usable +void foo (A a, B b, B ba) +{ + foo (a); + + foo (b); + + foo (ba); +} Index: include/deque =================================================================== --- include/deque (revision 450357) +++ include/deque (working copy) @@ -651,6 +651,16 @@ _RWSTD_ASSERT (_C_is_valid (1 /* valid and empty */)); } +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (deque& __lhs, deque& __rhs) + { + __lhs.swap (__rhs); + } +#endif + + private: ////////////////////////////////////////////////////////////////// @@ -983,6 +993,8 @@ } +#ifndef _RWSTD_NO_PART_SPEC_OVERLOAD + template inline void swap (deque<_TypeT, _Allocator> &__lhs, deque<_TypeT, _Allocator> &__rhs) @@ -990,6 +1002,7 @@ __lhs.swap (__rhs); } +#endif // _RWSTD_NO_PART_SPEC_OVERLOAD } // namespace end Index: include/list =================================================================== --- include/list (revision 450357) +++ include/list (working copy) @@ -664,6 +664,15 @@ erase (begin (), end ()); } +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (list& __lhs, list& __rhs) + { + __lhs.swap (__rhs); + } +#endif + protected: void _C_transfer (iterator, iterator, iterator, list&); Index: include/map =================================================================== --- include/map (revision 450357) +++ include/map (working copy) @@ -300,6 +300,16 @@ equal_range (const key_type& __x) const { return _C_rep.equal_range (__x); } + +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (map& __lhs, map& __rhs) + { + __lhs.swap (__rhs); + } +#endif + }; @@ -529,6 +539,16 @@ equal_range (const key_type& __x) const { return _C_rep.equal_range (__x); } + +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (multimap& __lhs, multimap& __rhs) + { + __lhs.swap (__rhs); + } +#endif + }; Index: include/set =================================================================== --- include/set (revision 450357) +++ include/set (working copy) @@ -301,6 +301,16 @@ equal_range (const key_type& __x) const { return _C_rep.equal_range (__x); } + +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (set& __lhs, set& __rhs) + { + __lhs.swap (__rhs); + } +#endif + }; @@ -505,6 +515,16 @@ equal_range (const key_type& __x) const { return _C_rep.equal_range (__x); } + +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (multiset& __lhs, multiset& __rhs) + { + __lhs.swap (__rhs); + } +#endif + }; Index: include/string =================================================================== --- include/string (revision 450357) +++ include/string (working copy) @@ -823,6 +823,15 @@ // lwg Issue 5 int compare (size_type, size_type, const_pointer, size_type) const; +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (basic_string& __lhs, basic_string& __rhs) + { + __lhs.swap (__rhs); + } +#endif + #if !defined (_RWSTD_NO_INLINE_MEMBER_TEMPLATES) \ && (!defined (_MSC_VER) || _MSC_VER >= 1300 || defined (__INTEL_COMPILER)) \ && defined (_RWSTD_NO_MEMBER_TEMPLATES) Index: include/vector =================================================================== --- include/vector (revision 450357) +++ include/vector (working copy) @@ -370,6 +370,15 @@ erase (begin (), end ()); } +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (vector& __lhs, vector& __rhs) + { + __lhs.swap (__rhs); + } +#endif + private: // implements assign with repetition @@ -1432,6 +1441,16 @@ { erase(begin(),end()); } + +#if defined (_RWSTD_NO_PART_SPEC_OVERLOAD) && \ + !defined (_RWSTD_NO_INLINE_FRIENDS) + + friend void swap (vector& __lhs, vector& __rhs) + { + __lhs.swap (__rhs); + } +#endif + }; #undef _Allocator