20template<
typename _IT,
typename _IT_Index,
typename _IT_RES >
21void copy_out_of_indexs(_IT input_begin, _IT input_end, _IT_Index index_begin, _IT_Index index_end, _IT_RES output_begin,
size_t inputIndexStart = 0)
23 if (index_begin == index_end) {
24 std::copy(input_begin, input_end, output_begin);
27 while (input_begin != input_end) {
28 if (inputIndexStart == (
size_t)(*index_begin)) {
32 if (index_begin == index_end) {
37 *output_begin = *input_begin;
42 std::copy(input_begin, input_end, output_begin);
58template<
typename _IT,
typename _IT_Index,
typename _IT_RES >
59void copy_inner_indexs(_IT input_begin, _IT input_end, _IT_Index index_begin, _IT_Index index_end, _IT_RES output_begin,
size_t inputIndexStart = 0)
61 if (index_begin == index_end) {
64 while (input_begin != input_end) {
65 if (inputIndexStart == *index_begin) {
66 *output_begin = *input_begin;
69 if (index_begin == index_end) {
89template<
typename _IT,
typename _IT_Index,
typename _IT_RES >
90void copy_inner_indexs(_IT input_begin, _IT_Index index_begin, _IT_Index index_end, _IT_RES output_begin)
92 if (index_begin == index_end) {
95 while (index_begin != index_end) {
96 *output_begin = *(input_begin + *index_begin);
114template<
typename _IT_Index,
typename _IT_Data,
typename _IT_OldDataArr,
typename _IT_NewDataArr >
116 _IT_Index index_be_insert_end,
117 _IT_Data data_be_insert_begin,
118 _IT_OldDataArr old_data_begin,
119 _IT_OldDataArr old_data_end,
120 _IT_NewDataArr new_data_begin)
124 while (old_data_begin != old_data_end) {
125 if (i == (
size_t)(*index_be_insert_begin)) {
127 *new_data_begin = *data_be_insert_begin;
129 ++index_be_insert_begin;
130 ++data_be_insert_begin;
133 *new_data_begin = *old_data_begin;
139 while (index_be_insert_begin != index_be_insert_end) {
140 *new_data_begin = *data_be_insert_begin;
141 ++index_be_insert_begin;
142 ++data_be_insert_begin;
162template<
typename _IT,
typename _IT_Index,
typename _IT_RES >
165 _IT_Index index_begin,
167 _IT_RES outputInnerIndex_begin,
168 _IT_RES outputOutOfIndex_begin,
169 size_t inputIndexStart = 0)
171 if (index_begin == index_end) {
172 std::copy(input_begin, input_end, outputOutOfIndex_begin);
175 while (input_begin != input_end) {
176 if (inputIndexStart == (
size_t)(*index_begin)) {
177 *outputInnerIndex_begin = *input_begin;
178 ++outputInnerIndex_begin;
180 if (index_begin == index_end) {
185 *outputOutOfIndex_begin = *input_begin;
186 ++outputOutOfIndex_begin;
191 std::copy(input_begin, input_end, outputOutOfIndex_begin);
204template<
class InputIterator1,
class InputIterator2,
class InputIterator3,
class OutputIterator,
class ThreeOperation >
205OutputIterator
transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator3 first3, OutputIterator result_first, ThreeOperation three_op)
207 while (first1 != last1) {
208 *result_first = three_op(*first1, *first2, *first3);
214 return (result_first);
228template<
class InputIterator1,
class InputIterator2,
class InputIterator3,
class InputIterator4,
class OutputIterator,
class FourOperation >
230 InputIterator1 last1,
231 InputIterator2 first2,
232 InputIterator3 first3,
233 InputIterator4 first4,
234 OutputIterator result_first,
235 FourOperation four_op)
237 while (first1 != last1) {
238 *result_first = four_op(*first1, *first2, *first3, *first4);
245 return (result_first);
260template<
class InputIterator1,
class InputIterator2,
class InputIterator3,
class InputIterator4,
class InputIterator5,
class OutputIterator,
class FiveOperation >
262 InputIterator1 last1,
263 InputIterator2 first2,
264 InputIterator3 first3,
265 InputIterator4 first4,
266 InputIterator5 first5,
267 OutputIterator result_first,
268 FiveOperation five_op)
270 while (first1 != last1) {
271 *result_first = five_op(*first1, *first2, *first3, *first4, *first5);
279 return (result_first);
295template<
class InputIterator1,
class InputIterator2,
class InputIterator3,
class InputIterator4,
class InputIterator5,
class InputIterator6,
class OutputIterator,
class SixOperation >
297 InputIterator1 last1,
298 InputIterator2 first2,
299 InputIterator3 first3,
300 InputIterator4 first4,
301 InputIterator5 first5,
302 InputIterator6 first6,
303 OutputIterator result_first,
306 while (first1 != last1) {
307 *result_first = six_op(*first1, *first2, *first3, *first4, *first5, *first6);
316 return (result_first);
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44
void copy_inner_indexs(_IT input_begin, _IT input_end, _IT_Index index_begin, _IT_Index index_end, _IT_RES output_begin, size_t inputIndexStart=0)
把索引范围之内的内容拷贝
Definition da_algorithm.hpp:59
void insert_inner_indexs(_IT_Index index_be_insert_begin, _IT_Index index_be_insert_end, _IT_Data data_be_insert_begin, _IT_OldDataArr old_data_begin, _IT_OldDataArr old_data_end, _IT_NewDataArr new_data_begin)
此函数作用是根据提供的待插入数组insert_data和待插入索引index_be_insert(这两者长度需要一致) ,以及需要插入的数组old_data,程序根据insert_data和index_...
Definition da_algorithm.hpp:115
void split_with_indexs(_IT input_begin, _IT input_end, _IT_Index index_begin, _IT_Index index_end, _IT_RES outputInnerIndex_begin, _IT_RES outputOutOfIndex_begin, size_t inputIndexStart=0)
根据提供的索引把一个序列分解为两个结集 ,其中 outputInnerIndex_begin存放在提供范围内的结果 outputOutOfIndex_begin存放提供的索引范围外的结果
Definition da_algorithm.hpp:163
OutputIterator transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator3 first3, OutputIterator result_first, ThreeOperation three_op)
transform 3参数的transform,对std::transform的扩展,适用于3参数
Definition da_algorithm.hpp:205
void copy_out_of_indexs(_IT input_begin, _IT input_end, _IT_Index index_begin, _IT_Index index_end, _IT_RES output_begin, size_t inputIndexStart=0)
把索引范围之外的内容拷贝
Definition da_algorithm.hpp:21