Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
equal.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_EQUAL_HPP
9#define ADOBE_ALGORITHM_EQUAL_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
21namespace adobe {
22
23/**************************************************************************************************/
31/**************************************************************************************************/
35template <class InputIterator1, class InputIterator2, class BinaryPredicate>
36inline bool equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
37 BinaryPredicate pred) {
38 return std::equal(first1, last1, first2,
39 std::bind(pred, std::placeholders::_1, std::placeholders::_2));
40}
41
45template <class InputRange1, class InputIterator2>
46inline bool equal(const InputRange1& range1, InputIterator2 first2) {
47 return std::equal(boost::begin(range1), boost::end(range1), first2);
48}
49
53template <class InputRange1, class InputIterator2, class BinaryPredicate>
54inline bool equal(const InputRange1& range1, InputIterator2 first2, BinaryPredicate pred) {
55 return adobe::equal(boost::begin(range1), boost::end(range1), first2, pred);
56}
57
58/**************************************************************************************************/
59
60} // namespace adobe
61
62/**************************************************************************************************/
63
64#endif
65
66/**************************************************************************************************/
bool equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred)
Definition equal.hpp:36