//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // requires HasEqualTo // Iter1 // find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include #include #include "../../iterators.h" int main() { int ia[] = {0, 1, 2, 3, 0, 1, 2, 3}; const unsigned sa = sizeof(ia)/sizeof(ia[0]); int ib[] = {1, 3, 5, 7}; const unsigned sb = sizeof(ib)/sizeof(ib[0]); assert(std::find_first_of(input_iterator(ia), input_iterator(ia + sa), forward_iterator(ib), forward_iterator(ib + sb)) == input_iterator(ia+1)); int ic[] = {7}; assert(std::find_first_of(input_iterator(ia), input_iterator(ia + sa), forward_iterator(ic), forward_iterator(ic + 1)) == input_iterator(ia+sa)); assert(std::find_first_of(input_iterator(ia), input_iterator(ia + sa), forward_iterator(ic), forward_iterator(ic)) == input_iterator(ia+sa)); assert(std::find_first_of(input_iterator(ia), input_iterator(ia), forward_iterator(ic), forward_iterator(ic+1)) == input_iterator(ia)); }