00001 00002 #ifndef INSTIGATE_STL_ALGORITHM_HPP 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_SWAP_RANGES_HPP 00008 #define INSTIGATE_STL_SWAP_RANGES_HPP 00009 00059 // headers from this project 00060 #include "concept.hpp" 00061 #include "_iter_swap.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 I2 swap_ranges(I1, I1, I2); 00073 } 00074 } 00075 00104 template <typename I1, typename I2> 00105 I2 instigate::stl::swap_ranges(I1 b1, I1 e1, I2 b2) 00106 { 00107 CHECK(instigate::generic::assignable::requirements<I1>); 00108 CHECK(instigate::generic::assignable::requirements<I2>); 00109 for (; !equal(b1, e1); increment(b1), increment(b2)) { 00110 stl::iter_swap(b1, b2); 00111 } 00112 return b2; 00113 } 00114 00115 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq: 00116 00117 #endif // INSTIGATE_STL_SWAP_RANGES_HPP