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_IOTA_HPP
00008 #define INSTIGATE_STL_IOTA_HPP
00009
00058
00059 #include "_basis.hpp"
00060 #include "concept.hpp"
00061
00062
00063
00064
00065
00066
00067 namespace instigate {
00068 namespace stl {
00069 template <typename I, typename T>
00070 void iota(I b, I e, T v);
00071 }
00072 }
00073
00105 template <typename I, typename T>
00106 void instigate::stl::iota(I b, I e, T v)
00107 {
00108 typedef typename instigate::stl::writable_iterator::
00109 interface<I>::value_type value_type;
00110 CHECK(instigate::stl::forward_iterator::requirements<I>);
00111 CHECK(instigate::generic::assignable::requirements<T>);
00112 CHECK_CONVERTIBILITY(T, value_type);
00113 while (!equal(b, e)) {
00114 dereference_assign(b, v);
00115 increment(b);
00116 ++v;
00117 }
00118 }
00119
00120
00121
00122 #endif // INSTIGATE_STL_IOTA_HPP
00123