00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #ifndef _BACKWARD_ITERATOR_H
00057 #define _BACKWARD_ITERATOR_H 1
00058
00059 #include "backward_warning.h"
00060 #include "function.h"
00061 #include <stddef.h>
00062 #include "iostream.h"
00063 #include <iterator>
00064
00065 #include <bits/stl_construct.h>
00066 #include <bits/stl_raw_storage_iter.h>
00067
00068 #include <ext/iterator>
00069
00070
00071 using std::input_iterator_tag;
00072 using std::output_iterator_tag;
00073 using std::forward_iterator_tag;
00074 using std::bidirectional_iterator_tag;
00075 using std::random_access_iterator_tag;
00076
00077 #if 0
00078 using std::iterator;
00079 #endif
00080
00081
00082
00083
00084
00085 template<typename _Tp, typename _Distance>
00086 struct input_iterator {
00087 typedef input_iterator_tag iterator_category;
00088 typedef _Tp value_type;
00089 typedef _Distance difference_type;
00090 typedef _Tp* pointer;
00091 typedef _Tp& reference;
00092 };
00093
00094 struct output_iterator {
00095 typedef output_iterator_tag iterator_category;
00096 typedef void value_type;
00097 typedef void difference_type;
00098 typedef void pointer;
00099 typedef void reference;
00100 };
00101
00102 template<typename _Tp, typename _Distance>
00103 struct forward_iterator {
00104 typedef forward_iterator_tag iterator_category;
00105 typedef _Tp value_type;
00106 typedef _Distance difference_type;
00107 typedef _Tp* pointer;
00108 typedef _Tp& reference;
00109 };
00110
00111 template<typename _Tp, typename _Distance>
00112 struct bidirectional_iterator {
00113 typedef bidirectional_iterator_tag iterator_category;
00114 typedef _Tp value_type;
00115 typedef _Distance difference_type;
00116 typedef _Tp* pointer;
00117 typedef _Tp& reference;
00118 };
00119
00120 template<typename _Tp, typename _Distance>
00121 struct random_access_iterator {
00122 typedef random_access_iterator_tag iterator_category;
00123 typedef _Tp value_type;
00124 typedef _Distance difference_type;
00125 typedef _Tp* pointer;
00126 typedef _Tp& reference;
00127 };
00128
00129 using std::iterator_traits;
00130
00131 template <class _Iter>
00132 inline typename iterator_traits<_Iter>::iterator_category
00133 iterator_category(const _Iter& __i)
00134 { return __iterator_category(__i); }
00135
00136 template <class _Iter>
00137 inline typename iterator_traits<_Iter>::difference_type*
00138 distance_type(const _Iter&)
00139 { return static_cast<typename iterator_traits<_Iter>::difference_type*>(0); }
00140
00141 template<class _Iter>
00142 inline typename iterator_traits<_Iter>::value_type*
00143 value_type(const _Iter& __i)
00144 { return static_cast<typename iterator_traits<_Iter>::value_type*>(0); }
00145
00146 using std::distance;
00147 using __gnu_cxx::distance;
00148 using std::advance;
00149
00150 using std::insert_iterator;
00151 using std::front_insert_iterator;
00152 using std::back_insert_iterator;
00153 using std::inserter;
00154 using std::front_inserter;
00155 using std::back_inserter;
00156
00157 using std::reverse_iterator;
00158
00159 using std::istream_iterator;
00160 using std::ostream_iterator;
00161
00162
00163 template<class _T1, class _T2>
00164 inline void
00165 construct(_T1* __p, const _T2& __value)
00166 { std::_Construct(__p, __value); }
00167
00168 template<class _T1>
00169 inline void
00170 construct(_T1* __p)
00171 { std::_Construct(__p); }
00172
00173 template <class _Tp>
00174 inline void
00175 destroy(_Tp* __pointer)
00176 { std::_Destroy(__pointer); }
00177
00178 template <class _ForwardIterator>
00179 inline void
00180 destroy(_ForwardIterator __first, _ForwardIterator __last)
00181 { std::_Destroy(__first, __last); }
00182
00183
00184
00185 using std::raw_storage_iterator;
00186
00187 #endif
00188
00189
00190
00191