Adobe Source Libraries
2.0.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
partition.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_PARTITION_HPP
9
#define ADOBE_ALGORITHM_PARTITION_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
/**************************************************************************************************/
32
/**************************************************************************************************/
38
template
<
class
B
id
irectionalIterator,
class
Predicate>
39
inline
BidirectionalIterator
partition
(BidirectionalIterator first, BidirectionalIterator last,
40
Predicate pred) {
41
return
std::partition(first, last, std::bind(pred, std::placeholders::_1));
42
}
43
49
template
<
class
B
id
irectionalRange,
class
Predicate>
50
inline
typename
boost::range_iterator<BidirectionalRange>::type
partition
(BidirectionalRange& range,
51
Predicate pred) {
52
return
adobe::partition
(boost::begin(range), boost::end(range), pred);
53
}
54
60
template
<
class
B
id
irectionalIterator,
class
Predicate>
61
inline
BidirectionalIterator
stable_partition
(BidirectionalIterator first,
62
BidirectionalIterator last, Predicate pred) {
63
return
std::stable_partition(first, last, std::bind(pred, std::placeholders::_1));
64
}
65
71
template
<
class
B
id
irectionalRange,
class
Predicate>
72
inline
typename
boost::range_iterator<BidirectionalRange>::type
73
stable_partition
(BidirectionalRange& range, Predicate pred) {
74
return
adobe::stable_partition
(boost::begin(range), boost::end(range), pred);
75
}
76
77
/**************************************************************************************************/
78
79
}
// namespace adobe
80
81
/**************************************************************************************************/
82
83
#endif
84
85
/**************************************************************************************************/
config.hpp
adobe::partition
BidirectionalIterator partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred)
partition implementation
Definition
partition.hpp:39
adobe::stable_partition
BidirectionalIterator stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred)
partition implementation
Definition
partition.hpp:61
adobe
Definition
class_template.hpp:7
adobe
algorithm
partition.hpp
Generated by
1.14.0