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_REMOVE_HPP
00008 #define INSTIGATE_STL_REMOVE_HPP
00009
00058
00059 #include "concept.hpp"
00060 #include "_find.hpp"
00061 #include "_remove_copy.hpp"
00062 #include "_basis.hpp"
00063
00064
00065
00066
00067
00068
00069 namespace instigate {
00070 namespace stl {
00071 template <typename F, typename V>
00072 F remove(F b, F e, const V& v);
00073 }
00074 }
00075
00113 template <typename F, typename V>
00114 F instigate::stl::remove(F b, F e, const V& v)
00115 {
00116 namespace FI = instigate::stl::forward_iterator;
00117 namespace WR = instigate::stl::writable_iterator;
00118 namespace EQ = instigate::generic::equality_comparable;
00119 CHECK(FI::requirements<F>);
00120 CHECK(WR::requirements<F>);
00121 CHECK(EQ::requirements<V>);
00122 assign(b, instigate::stl::find(b, e, v));
00123 char c[sizeof(F)];
00124 F* i = 0;
00125 assign(i, copy_constructor(c, b));
00126 assert(0 != i);
00127 increment(*i);
00128 return equal(b, e) ? b : instigate::stl::remove_copy(*i, e, b, v);
00129 }
00130
00131
00132
00133 #endif // INSTIGATE_STL_REMOVE_HPP