00001 00002 #ifndef _INSTIGATE_STL_INTERNAL_HEADER_IN_ALGORITHM 00003 #error This is an internal header file used to implement Instigate STL.\ 00004 It should never be included directly by a program. 00005 #endif 00006 00007 #ifndef INSTIGATE_STL_ITER_SWAP_HPP 00008 #define INSTIGATE_STL_ITER_SWAP_HPP 00009 00059 // headers from this project 00060 #include "concept.hpp" 00061 #include "_basis.hpp" 00062 00063 // headers from other project 00064 #include <generic/base.hpp> 00065 00066 // headers from standard library 00067 00068 // forward declaration 00069 namespace instigate { 00070 namespace stl { 00071 template <typename I1, typename I2> 00072 inline void iter_swap(I1, I2); 00073 } 00074 } 00075 00100 template <typename I1, typename I2> 00101 inline void instigate::stl::iter_swap(I1 a, I2 b) 00102 { 00103 typedef typename stl::lvalue_iterator::interface<I1>::value_type T1; 00104 typedef typename stl::lvalue_iterator::interface<I2>::value_type T2; 00105 CHECK_SAME_TYPE(T1, T2); 00106 CHECK(stl::forward_iterator::requirements<I1>); 00107 CHECK(stl::forward_iterator::requirements<I2>); 00108 CHECK(stl::lvalue_iterator::requirements<I1>); 00109 CHECK(stl::lvalue_iterator::requirements<I2>); 00110 T1 t; 00111 assign(t, const_dereference(a)); 00112 assign(dereference(a), const_dereference(b)); 00113 dereference_assign(b, t); 00114 } 00115 00116 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq:textwidth=80: 00117 00118 #endif // INSTIGATE_STL_ITER_SWAP_HPP