00001 00002 #ifndef _INSTIGATE_OPEN_SOURCE_INTERNAL_HEADER_IN_CONCEPT 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_READABLE_ITERATOR_HPP 00008 #define INSTIGATE_STL_READABLE_ITERATOR_HPP 00009 00058 // Headers from this project 00059 #include "iterator_interface.hpp" 00060 00061 // Headers from other projects 00062 #include <generic/_assignable.hpp> 00063 00064 // Headers from standard library 00065 #include <iostream> 00066 00067 // Forward declarations 00068 namespace instigate { 00069 namespace stl { 00088 namespace readable_iterator { 00089 struct tag; 00090 template<typename T> struct interface; 00091 template<typename T> struct requirements; 00092 } 00093 } 00094 } 00095 00102 struct instigate::stl::readable_iterator::tag 00103 : instigate::generic::assignable::tag 00104 { 00105 }; 00106 00111 template <typename T> 00112 struct instigate::stl::readable_iterator::interface 00113 : instigate::generic::assignable::interface<T> 00114 { 00116 typedef typename instigate::stl::interface<T>::value_type value_type; 00117 00119 typedef const typename instigate::stl::interface<T>::value_type& 00120 const_reference; 00128 static const_reference const_dereference(const T& a) 00129 { 00130 return instigate::stl::interface<T>::const_dereference(a); 00131 } 00132 }; 00133 00142 template <typename T> 00143 struct instigate::stl::readable_iterator::requirements 00144 : instigate::generic::assignable::requirements<T> 00145 { 00150 static void require_nested_typename_value_type() 00151 { 00152 typedef typename instigate::stl::readable_iterator:: 00153 interface<T>::value_type value_type; 00154 } 00155 00161 static void require_dereference(const T& a) 00162 { 00163 instigate::stl::readable_iterator:: 00164 interface<T>::const_dereference(a); 00165 } 00166 00173 requirements() 00174 { 00175 (void)require_nested_typename_value_type; 00176 (void)require_dereference; 00177 } 00178 }; 00179 00180 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq:textwidth=80: 00181 00182 #endif // INSTIGATE_STL_READABLE_ITERATOR_HPP