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
00057 #ifndef _EXT_MEMORY
00058 #define _EXT_MEMORY 1
00059
00060 #pragma GCC system_header
00061
00062 #include <memory>
00063 #include <bits/stl_tempbuf.h>
00064
00065 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
00066 {
00067 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00068
00069 using std::ptrdiff_t;
00070 using std::pair;
00071 using std::__iterator_category;
00072 using std::_Temporary_buffer;
00073
00074 template<typename _InputIter, typename _Size, typename _ForwardIter>
00075 pair<_InputIter, _ForwardIter>
00076 __uninitialized_copy_n(_InputIter __first, _Size __count,
00077 _ForwardIter __result, std::input_iterator_tag)
00078 {
00079 _ForwardIter __cur = __result;
00080 __try
00081 {
00082 for (; __count > 0 ; --__count, ++__first, ++__cur)
00083 std::_Construct(&*__cur, *__first);
00084 return pair<_InputIter, _ForwardIter>(__first, __cur);
00085 }
00086 __catch(...)
00087 {
00088 std::_Destroy(__result, __cur);
00089 __throw_exception_again;
00090 }
00091 }
00092
00093 template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
00094 inline pair<_RandomAccessIter, _ForwardIter>
00095 __uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
00096 _ForwardIter __result,
00097 std::random_access_iterator_tag)
00098 {
00099 _RandomAccessIter __last = __first + __count;
00100 return (pair<_RandomAccessIter, _ForwardIter>
00101 (__last, std::uninitialized_copy(__first, __last, __result)));
00102 }
00103
00104 template<typename _InputIter, typename _Size, typename _ForwardIter>
00105 inline pair<_InputIter, _ForwardIter>
00106 __uninitialized_copy_n(_InputIter __first, _Size __count,
00107 _ForwardIter __result)
00108 { return __gnu_cxx::__uninitialized_copy_n(__first, __count, __result,
00109 __iterator_category(__first)); }
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 template<typename _InputIter, typename _Size, typename _ForwardIter>
00122 inline pair<_InputIter, _ForwardIter>
00123 uninitialized_copy_n(_InputIter __first, _Size __count,
00124 _ForwardIter __result)
00125 { return __gnu_cxx::__uninitialized_copy_n(__first, __count, __result,
00126 __iterator_category(__first)); }
00127
00128
00129
00130
00131 template<typename _InputIter, typename _Size, typename _ForwardIter,
00132 typename _Allocator>
00133 pair<_InputIter, _ForwardIter>
00134 __uninitialized_copy_n_a(_InputIter __first, _Size __count,
00135 _ForwardIter __result,
00136 _Allocator __alloc)
00137 {
00138 _ForwardIter __cur = __result;
00139 __try
00140 {
00141 for (; __count > 0 ; --__count, ++__first, ++__cur)
00142 __alloc.construct(&*__cur, *__first);
00143 return pair<_InputIter, _ForwardIter>(__first, __cur);
00144 }
00145 __catch(...)
00146 {
00147 std::_Destroy(__result, __cur, __alloc);
00148 __throw_exception_again;
00149 }
00150 }
00151
00152 template<typename _InputIter, typename _Size, typename _ForwardIter,
00153 typename _Tp>
00154 inline pair<_InputIter, _ForwardIter>
00155 __uninitialized_copy_n_a(_InputIter __first, _Size __count,
00156 _ForwardIter __result,
00157 std::allocator<_Tp>)
00158 {
00159 return __gnu_cxx::uninitialized_copy_n(__first, __count, __result);
00160 }
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 template <class _ForwardIterator, class _Tp
00183 = typename std::iterator_traits<_ForwardIterator>::value_type >
00184 struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
00185 {
00186
00187 temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
00188 : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { }
00189
00190
00191 ~temporary_buffer() { }
00192 };
00193
00194 _GLIBCXX_END_NAMESPACE_VERSION
00195 }
00196
00197 #endif
00198