stlab.adobe.com Adobe Systems Incorporated
algorithm/mismatch.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_MISMATCH_HPP
10 #define ADOBE_ALGORITHM_MISMATCH_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 #if ADOBE_HAS_CPLUS0X_CONCEPTS
22 
23 namespace std { concept_map CopyConstructible<pair<const unsigned char*, const unsigned char*> > {}}
24 
25 #endif
26 /*************************************************************************************************/
27 
28 namespace adobe {
29 
30 /*************************************************************************************************/
38 /*************************************************************************************************/
44 template <class InputRange1, class InputIterator2>
45 inline std::pair<typename boost::range_iterator<InputRange1>::type, InputIterator2>
46 mismatch(InputRange1& range1, InputIterator2 first2)
47 {
48  return std::mismatch(boost::begin(range1), boost::end(range1), first2);
49 }
50 
51 
57 template <class InputRange1, class InputIterator2>
58 inline std::pair<typename boost::range_const_iterator<InputRange1>::type, InputIterator2>
59 mismatch(const InputRange1& range1, InputIterator2 first2)
60 {
61  return std::mismatch(boost::begin(range1), boost::end(range1), first2);
62 }
63 
69 template <class InputIterator1, class InputIterator2, class BinaryPredicate>
70 inline std::pair<InputIterator1, InputIterator2> mismatch(InputIterator1 first1,
71  InputIterator1 last1,
72  InputIterator2 first2,
73  BinaryPredicate pred)
74 {
75  return std::mismatch(first1, last1, first2, boost::bind(pred, _1, _2));
76 }
77 
83 template <class InputRange1, class InputIterator2, class BinaryPredicate>
84 inline std::pair<typename boost::range_iterator<InputRange1>::type, InputIterator2>
85 mismatch(InputRange1& range1, InputIterator2 first2, BinaryPredicate pred)
86 {
87  return adobe::mismatch(boost::begin(range1), boost::end(range1), first2, pred);
88 }
89 
95 template <class InputRange1, class InputIterator2, class BinaryPredicate>
96 inline std::pair<typename boost::range_const_iterator<InputRange1>::type, InputIterator2>
97 mismatch(const InputRange1& range1, InputIterator2 first2, BinaryPredicate pred)
98 {
99  return adobe::mismatch(boost::begin(range1), boost::end(range1), first2, pred);
100 }
101 
102 /*************************************************************************************************/
103 
104 } // namespace adobe
105 
106 /*************************************************************************************************/
107 
108 #endif
109 
110 /*************************************************************************************************/

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