~ubuntu-branches/ubuntu/saucy/libc++/saucy

« back to all changes in this revision

Viewing changes to libcxx/test/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-14 10:41:44 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130514104144-3ifapir21ql5hkjl
Tags: 1.0~svn181765-1
* New snapshot release
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "test_iterators.h"
23
23
 
 
24
#if _LIBCPP_STD_VER > 11
 
25
#define HAS_FOUR_ITERATOR_VERSION
 
26
#endif
 
27
 
 
28
 
24
29
int main()
25
30
{
26
31
    int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
34
39
                                    input_iterator<const int*> >(
35
40
                            input_iterator<const int*>(ia+3),
36
41
                            input_iterator<const int*>(ib+3))));
 
42
#ifdef HAS_FOUR_ITERATOR_VERSION
 
43
    assert(std::mismatch(input_iterator<const int*>(ia),
 
44
                         input_iterator<const int*>(ia + sa),
 
45
                         input_iterator<const int*>(ib),
 
46
                         input_iterator<const int*>(ib + sa),
 
47
                         std::equal_to<int>()) ==
 
48
                         (std::pair<input_iterator<const int*>,
 
49
                                    input_iterator<const int*> >(
 
50
                            input_iterator<const int*>(ia+3),
 
51
                            input_iterator<const int*>(ib+3))));
 
52
#endif
 
53
 
37
54
    assert(std::mismatch(ia, ia + sa, ib, std::equal_to<int>()) ==
38
55
           (std::pair<int*,int*>(ia+3,ib+3)));
 
56
#ifdef HAS_FOUR_ITERATOR_VERSION
 
57
    assert(std::mismatch(ia, ia + sa, ib, ib + sa, std::equal_to<int>()) ==
 
58
           (std::pair<int*,int*>(ia+3,ib+3)));
 
59
    assert(std::mismatch(ia, ia + sa, ib, ib + 2, std::equal_to<int>()) ==
 
60
           (std::pair<int*,int*>(ia+2,ib+2)));
 
61
#endif
39
62
}