stlab.adobe.com Adobe Systems Incorporated
equal.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_ALGORITHM_EQUAL_HPP
10 #define ADOBE_ALGORITHM_EQUAL_HPP
11 
12 #include <adobe/config.hpp>
13 
14 #include <boost/range/begin.hpp>
15 #include <boost/range/end.hpp>
16 #include <boost/bind.hpp>
17 
18 #include <algorithm>
19 
20 /*************************************************************************************************/
21 
22 namespace adobe {
23 
24 /*************************************************************************************************/
32 /*************************************************************************************************/
36 template <class InputIterator1, class InputIterator2, class BinaryPredicate>
37 inline bool
38 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred)
39 {
40  return std::equal(first1, last1, first2, boost::bind(pred, _1, _2));
41 }
42 
46 template <class InputRange1, class InputIterator2>
47 inline bool equal(const InputRange1& range1, InputIterator2 first2)
48 {
49  return std::equal(boost::begin(range1), boost::end(range1), first2);
50 }
51 
55 template <class InputRange1, class InputIterator2, class BinaryPredicate>
56 inline bool equal(const InputRange1& range1, InputIterator2 first2, BinaryPredicate pred)
57 {
58  return adobe::equal(boost::begin(range1), boost::end(range1), first2, pred);
59 }
60 
61 /*************************************************************************************************/
62 
63 } // namespace adobe
64 
65 /*************************************************************************************************/
66 
67 #endif
68 
69 /*************************************************************************************************/
bool equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred)
Definition: equal.hpp:38
bool equal(const InputRange1 &range1, InputIterator2 first2, BinaryPredicate pred)
Definition: equal.hpp:56

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google