Adobe Source Libraries
1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
find_match.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_FIND_MATCH_HPP
9
#define ADOBE_ALGORITHM_FIND_MATCH_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
21
namespace
adobe
{
22
23
/**************************************************************************************************/
34
/**************************************************************************************************/
40
template
<
class
InputIterator,
class
T,
class
Compare>
41
inline
InputIterator
find_match
(InputIterator first, InputIterator last,
const
T& value,
42
Compare comp) {
43
return
std::find_if(first, last, std::bind(comp, value, std::placeholders::_1));
44
}
45
51
template
<
class
InputRange,
class
T,
class
Compare>
52
inline
typename
boost::range_iterator<InputRange>::type
find_match
(InputRange& range,
53
const
T& value, Compare comp) {
54
return
adobe::find_match
(boost::begin(range), boost::end(range), value, comp);
55
}
56
62
template
<
class
InputRange,
class
T,
class
Compare>
63
inline
typename
boost::range_const_iterator<InputRange>::type
64
find_match
(
const
InputRange& range,
const
T& value, Compare comp) {
65
return
adobe::find_match
(boost::begin(range), boost::end(range), value, comp);
66
}
67
73
template
<
class
InputIterator,
class
T,
class
Compare>
74
inline
InputIterator
find_match
(InputIterator first, InputIterator last,
const
T& value) {
75
return
std::find_if(first, last, std::bind(std::equal_to<T>(), value, std::placeholders::_1));
76
}
77
83
template
<
class
InputRange,
class
T,
class
Compare>
84
inline
typename
boost::range_iterator<InputRange>::type
find_match
(InputRange& range,
85
const
T& value) {
86
return
adobe::find_match
(boost::begin(range), boost::end(range), value);
87
}
88
94
template
<
class
InputRange,
class
T,
class
Compare>
95
inline
typename
boost::range_const_iterator<InputRange>::type
find_match
(
const
InputRange& range,
96
const
T& value) {
97
return
adobe::find_match
(boost::begin(range), boost::end(range), value);
98
}
99
100
101
/**************************************************************************************************/
102
103
}
// namespace adobe
104
105
/**************************************************************************************************/
106
107
#endif
108
109
/**************************************************************************************************/
config.hpp
adobe::find_match
InputIterator find_match(InputIterator first, InputIterator last, const T &value, Compare comp)
find_match implementation
Definition
find_match.hpp:41
adobe
Definition
class_template.hpp:7
adobe
algorithm
find_match.hpp
Generated by
1.14.0