Well, MinGW implements it like this:
Code:
template<typename _ForwardIterator1, typename _ForwardIterator2>
inline void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
{
typedef typename iterator_traits<_ForwardIterator1>::value_type
_ValueType1;
typedef typename iterator_traits<_ForwardIterator2>::value_type
_ValueType2;
// concept requirements
//...
const _ValueType1 __tmp = *__a;
*__a = *__b;
*__b = __tmp;
}
Whereas MSVC uses std::swap:
Code:
template<class _FwdIt1,
class _FwdIt2> inline
void iter_swap(_FwdIt1 _Left, _FwdIt2 _Right)
{ // swap *_Left and *_Right
std::swap(*_Left, *_Right);
}
I'm really tempted to modify MinGW's stl_algobase.h since it doesn't even attempt to use swap...