Adobe Source Libraries
1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
for_each_position.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_FOR_EACH_POSITION_HPP
9
#define ADOBE_ALGORITHM_FOR_EACH_POSITION_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
/**************************************************************************************************/
35
/**************************************************************************************************/
36
#ifndef ADOBE_NO_DOCUMENTATION
37
namespace
implementation {
38
39
/**************************************************************************************************/
40
41
template
<
class
InputIterator,
class
UnaryFunction>
42
void
for_each_position(InputIterator first, InputIterator last, UnaryFunction f) {
43
while
(first != last) {
44
f(first);
45
++first;
46
}
47
}
48
49
/**************************************************************************************************/
50
51
}
// namespace implementation
52
#endif
53
/**************************************************************************************************/
59
template
<
class
InputIterator,
class
UnaryFunction>
60
inline
void
for_each_position
(InputIterator first, InputIterator last, UnaryFunction f) {
61
adobe::implementation::for_each_position(first, last, std::bind(f, std::placeholders::_1));
62
}
63
69
template
<
class
InputRange,
class
UnaryFunction>
70
inline
void
for_each_position
(InputRange& range, UnaryFunction f) {
71
adobe::for_each_position
(boost::begin(range), boost::end(range), f);
72
}
73
79
template
<
class
InputRange,
class
UnaryFunction>
80
inline
void
for_each_position
(
const
InputRange& range, UnaryFunction f) {
81
adobe::for_each_position
(boost::begin(range), boost::end(range), f);
82
}
83
84
/**************************************************************************************************/
85
86
}
// namespace adobe
87
88
/**************************************************************************************************/
89
90
#endif
91
92
/**************************************************************************************************/
config.hpp
adobe::for_each_position
void for_each_position(InputIterator first, InputIterator last, UnaryFunction f)
for_each_position implementation
Definition
for_each_position.hpp:60
adobe
Definition
class_template.hpp:7
adobe
algorithm
for_each_position.hpp
Generated by
1.14.0