40 typedef std::list<int, std::allocator<int> > List;
42 const List::value_type
a1[] = { 0, 1, 6, 5, 3, 2, 2, 6, 5, 7 };
43 const List::value_type
a2[] = { 6, 5, 0, 0 };
46 const List l1 (
a1,
a1 +
sizeof a1 /
sizeof *
a1);
47 const List l2 (
a2,
a2 + 2);
50 List::const_iterator it1 =
51 std::find_first_of (l1.begin (), l1.end (), l2.begin (), l2.end ());
53 List::const_iterator it2 =
54 std::find_first_of (l1.begin (), l1.end (), l2.begin (), l2.end (),
55 std::equal_to<List::value_type>());
58 List::const_iterator it3 =
59 std::find_end (l1.begin (), l1.end (), l2.begin (), l2.end ());
61 List::const_iterator it4 =
62 std::find_end (l1.begin (), l1.end (), l2.begin (), l2.end (),
63 std::equal_to<List::value_type>());
69 std::ostream_iterator<List::value_type,
71 std::char_traits<char> >
out (std::cout,
" " );
73 if (it3 == it4 && it1 == it2) {
75 std::cout <<
"For the sequences { ";
76 std::copy (l1.begin (), l1.end (),
out);
78 std::cout <<
"} and { ";
79 std::copy (l2.begin (), l2.end (),
out);
81 std::cout <<
"} \nboth versions of find_first_of point to: "
88 std::cout <<
"both versions of find_end point to: "