//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template BinaryOp> // requires OutputIterator && CopyConstructible // OutIter // transform(InIter1 first1, InIter1 last1, InIter2 first2, OutIter result, BinaryOp binary_op); #include #include #include #include "../../iterators.h" template void test() { int ia[] = {0, 1, 2, 3, 4}; const unsigned sa = sizeof(ia)/sizeof(ia[0]); int ib[sa] = {1, 2, 3, 4, 5}; OutIter r = std::transform(InIter1(ib), InIter1(ib+sa), InIter2(ia), OutIter(ib), std::minus()); assert(base(r) == ib + sa); assert(ib[0] == 1); assert(ib[1] == 1); assert(ib[2] == 1); assert(ib[3] == 1); assert(ib[4] == 1); } int main() { test, input_iterator, output_iterator >(); test, input_iterator, input_iterator >(); test, input_iterator, forward_iterator >(); test, input_iterator, bidirectional_iterator >(); test, input_iterator, random_access_iterator >(); test, input_iterator, int*>(); test, forward_iterator, output_iterator >(); test, forward_iterator, input_iterator >(); test, forward_iterator, forward_iterator >(); test, forward_iterator, bidirectional_iterator >(); test, forward_iterator, random_access_iterator >(); test, forward_iterator, int*>(); test, bidirectional_iterator, output_iterator >(); test, bidirectional_iterator, input_iterator >(); test, bidirectional_iterator, forward_iterator >(); test, bidirectional_iterator, bidirectional_iterator >(); test, bidirectional_iterator, random_access_iterator >(); test, bidirectional_iterator, int*>(); test, random_access_iterator, output_iterator >(); test, random_access_iterator, input_iterator >(); test, random_access_iterator, forward_iterator >(); test, random_access_iterator, bidirectional_iterator >(); test, random_access_iterator, random_access_iterator >(); test, random_access_iterator, int*>(); test, const int*, output_iterator >(); test, const int*, input_iterator >(); test, const int*, forward_iterator >(); test, const int*, bidirectional_iterator >(); test, const int*, random_access_iterator >(); test, const int*, int*>(); test, input_iterator, output_iterator >(); test, input_iterator, input_iterator >(); test, input_iterator, forward_iterator >(); test, input_iterator, bidirectional_iterator >(); test, input_iterator, random_access_iterator >(); test, input_iterator, int*>(); test, forward_iterator, output_iterator >(); test, forward_iterator, input_iterator >(); test, forward_iterator, forward_iterator >(); test, forward_iterator, bidirectional_iterator >(); test, forward_iterator, random_access_iterator >(); test, forward_iterator, int*>(); test, bidirectional_iterator, output_iterator >(); test, bidirectional_iterator, input_iterator >(); test, bidirectional_iterator, forward_iterator >(); test, bidirectional_iterator, bidirectional_iterator >(); test, bidirectional_iterator, random_access_iterator >(); test, bidirectional_iterator, int*>(); test, random_access_iterator, output_iterator >(); test, random_access_iterator, input_iterator >(); test, random_access_iterator, forward_iterator >(); test, random_access_iterator, bidirectional_iterator >(); test, random_access_iterator, random_access_iterator >(); test, random_access_iterator, int*>(); test, const int*, output_iterator >(); test, const int*, input_iterator >(); test, const int*, forward_iterator >(); test, const int*, bidirectional_iterator >(); test, const int*, random_access_iterator >(); test, const int*, int*>(); test, input_iterator, output_iterator >(); test, input_iterator, input_iterator >(); test, input_iterator, forward_iterator >(); test, input_iterator, bidirectional_iterator >(); test, input_iterator, random_access_iterator >(); test, input_iterator, int*>(); test, forward_iterator, output_iterator >(); test, forward_iterator, input_iterator >(); test, forward_iterator, forward_iterator >(); test, forward_iterator, bidirectional_iterator >(); test, forward_iterator, random_access_iterator >(); test, forward_iterator, int*>(); test, bidirectional_iterator, output_iterator >(); test, bidirectional_iterator, input_iterator >(); test, bidirectional_iterator, forward_iterator >(); test, bidirectional_iterator, bidirectional_iterator >(); test, bidirectional_iterator, random_access_iterator >(); test, bidirectional_iterator, int*>(); test, random_access_iterator, output_iterator >(); test, random_access_iterator, input_iterator >(); test, random_access_iterator, forward_iterator >(); test, random_access_iterator, bidirectional_iterator >(); test, random_access_iterator, random_access_iterator >(); test, random_access_iterator, int*>(); test, const int*, output_iterator >(); test, const int*, input_iterator >(); test, const int*, forward_iterator >(); test, const int*, bidirectional_iterator >(); test, const int*, random_access_iterator >(); test, const int*, int*>(); test, input_iterator, output_iterator >(); test, input_iterator, input_iterator >(); test, input_iterator, forward_iterator >(); test, input_iterator, bidirectional_iterator >(); test, input_iterator, random_access_iterator >(); test, input_iterator, int*>(); test, forward_iterator, output_iterator >(); test, forward_iterator, input_iterator >(); test, forward_iterator, forward_iterator >(); test, forward_iterator, bidirectional_iterator >(); test, forward_iterator, random_access_iterator >(); test, forward_iterator, int*>(); test, bidirectional_iterator, output_iterator >(); test, bidirectional_iterator, input_iterator >(); test, bidirectional_iterator, forward_iterator >(); test, bidirectional_iterator, bidirectional_iterator >(); test, bidirectional_iterator, random_access_iterator >(); test, bidirectional_iterator, int*>(); test, random_access_iterator, output_iterator >(); test, random_access_iterator, input_iterator >(); test, random_access_iterator, forward_iterator >(); test, random_access_iterator, bidirectional_iterator >(); test, random_access_iterator, random_access_iterator >(); test, random_access_iterator, int*>(); test, const int*, output_iterator >(); test, const int*, input_iterator >(); test, const int*, forward_iterator >(); test, const int*, bidirectional_iterator >(); test, const int*, random_access_iterator >(); test, const int*, int*>(); test, output_iterator >(); test, input_iterator >(); test, forward_iterator >(); test, bidirectional_iterator >(); test, random_access_iterator >(); test, int*>(); test, output_iterator >(); test, input_iterator >(); test, forward_iterator >(); test, bidirectional_iterator >(); test, random_access_iterator >(); test, int*>(); test, output_iterator >(); test, input_iterator >(); test, forward_iterator >(); test, bidirectional_iterator >(); test, random_access_iterator >(); test, int*>(); test, output_iterator >(); test, input_iterator >(); test, forward_iterator >(); test, bidirectional_iterator >(); test, random_access_iterator >(); test, int*>(); test >(); test >(); test >(); test >(); test >(); test(); }