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_SWAP_HPP
00008 #define INSTIGATE_STL_SWAP_HPP
00009
00059
00060 #include "concept.hpp"
00061 #include "_basis.hpp"
00062
00063
00064 #include <generic/base.hpp>
00065
00066
00067
00068
00069 namespace instigate {
00070 namespace stl {
00071 template <typename I>
00072 void swap(I&, I&);
00073 }
00074 }
00075
00104 template <typename I>
00105 void instigate::stl::swap(I& a, I& b)
00106 {
00107 CHECK(instigate::generic::assignable::requirements<I>);
00108 char k[sizeof(I)];
00109 I* t = 0;
00110 assign(t, copy_constructor(k, a));
00111 assert(0 != t);
00112 assign(a, b);
00113 assign(b, *t);
00114 }
00115
00116
00117
00118 #endif // INSTIGATE_STL_SWAP_HPP