blob: e36076e6fc5c7989e656695b5f264a468f62be21 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <algorithm>
11
Howard Hinnant664ae812010-08-22 00:08:10 +000012// template<InputIterator Iter1, InputIterator Iter2>
13// requires HasEqualTo<Iter1::value_type, Iter2::value_type>
Howard Hinnant3e519522010-05-11 19:42:16 +000014// bool
15// equal(Iter1 first1, Iter1 last1, Iter2 first2);
16
17#include <algorithm>
18#include <cassert>
19
20#include "../../iterators.h"
21
22int main()
23{
24 int ia[] = {0, 1, 2, 3, 4, 5};
25 const unsigned s = sizeof(ia)/sizeof(ia[0]);
26 int ib[s] = {0, 1, 2, 5, 4, 5};
27 assert(std::equal(input_iterator<const int*>(ia),
28 input_iterator<const int*>(ia+s),
29 input_iterator<const int*>(ia)));
30 assert(!std::equal(input_iterator<const int*>(ia),
31 input_iterator<const int*>(ia+s),
32 input_iterator<const int*>(ib)));
33}