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_GENERATE_HPP 00008 #define INSTIGATE_STL_GENERATE_HPP 00009 00059 // Headers from this project 00060 #include "concept.hpp" 00061 #include "_basis.hpp" 00062 00063 // Headers from other project 00064 00065 // Headers from standard library 00066 00067 // Forward declaration 00068 namespace instigate { 00069 namespace stl { 00070 template <typename F, typename G> 00071 void generate(F b, F e, G g); 00072 } 00073 } 00102 template <typename F, typename G> 00103 void instigate::stl::generate(F b, F e, G g) 00104 { 00105 typedef typename instigate::stl::writable_iterator::interface<F>:: 00106 value_type value_type; 00107 CHECK(instigate::stl::forward_iterator::requirements<F>); 00108 CHECK(instigate::stl::writable_iterator::requirements<F>); 00109 CHECK(instigate::stl::generator::requirements<G>); 00110 CHECK_CONVERTIBILITY(value_type, 00111 typename instigate::stl::generator::interface<G>::result_type ); 00112 for (; !equal(b, e); increment(b)) { 00113 dereference_assign(b, invoke(g)); 00114 } 00115 } 00116 00117 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq:textwidth=80: 00118 00119 #endif //INSTIGATE_STL_GENERATE_HPP 00120