Adobe Source Libraries 2.0.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
algorithm/mismatch.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6/**************************************************************************************************/
7
8#ifndef ADOBE_ALGORITHM_MISMATCH_HPP
9#define ADOBE_ALGORITHM_MISMATCH_HPP
10
11#include <adobe/config.hpp>
12
13#include <boost/range/begin.hpp>
14#include <boost/range/end.hpp>
15
16#include <algorithm>
17#include <functional>
18
19
20#if ADOBE_HAS_CPLUS0X_CONCEPTS
21
22namespace std {
23concept_map CopyConstructible<pair<const unsigned char*, const unsigned char*>> {}
24} // namespace std
25
26#endif
27/**************************************************************************************************/
28
29namespace adobe {
30
31/**************************************************************************************************/
39/**************************************************************************************************/
45template <class InputRange1, class InputIterator2>
46inline std::pair<typename boost::range_iterator<InputRange1>::type, InputIterator2>
47mismatch(InputRange1& range1, InputIterator2 first2) {
48 return std::mismatch(boost::begin(range1), boost::end(range1), first2);
49}
50
51
57template <class InputRange1, class InputIterator2>
58inline std::pair<typename boost::range_const_iterator<InputRange1>::type, InputIterator2>
59mismatch(const InputRange1& range1, InputIterator2 first2) {
60 return std::mismatch(boost::begin(range1), boost::end(range1), first2);
61}
62
68template <class InputIterator1, class InputIterator2, class BinaryPredicate>
69inline std::pair<InputIterator1, InputIterator2>
70mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred) {
71 return std::mismatch(first1, last1, first2,
72 std::bind(pred, std::placeholders::_1, std::placeholders::_2));
73}
74
80template <class InputRange1, class InputIterator2, class BinaryPredicate>
81inline std::pair<typename boost::range_iterator<InputRange1>::type, InputIterator2>
82mismatch(InputRange1& range1, InputIterator2 first2, BinaryPredicate pred) {
83 return adobe::mismatch(boost::begin(range1), boost::end(range1), first2, pred);
84}
85
91template <class InputRange1, class InputIterator2, class BinaryPredicate>
92inline std::pair<typename boost::range_const_iterator<InputRange1>::type, InputIterator2>
93mismatch(const InputRange1& range1, InputIterator2 first2, BinaryPredicate pred) {
94 return adobe::mismatch(boost::begin(range1), boost::end(range1), first2, pred);
95}
96
97/**************************************************************************************************/
98
99} // namespace adobe
100
101/**************************************************************************************************/
102
103#endif
104
105/**************************************************************************************************/
std::pair< typename boost::range_iterator< InputRange1 >::type, InputIterator2 > mismatch(InputRange1 &range1, InputIterator2 first2)
mismatch implementation
STL namespace.