Adobe Source Libraries
1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
set_next.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_ITERATOR_SET_NEXT_HPP
9
#define ADOBE_ITERATOR_SET_NEXT_HPP
10
11
#include <
adobe/config.hpp
>
12
13
#include <boost/next_prior.hpp>
14
15
/**************************************************************************************************/
16
17
namespace
adobe
{
18
19
namespace
unsafe
{
20
24
25
/*
26
Example:
27
28
template <>
29
stuct set_next_fn<T>
30
{
31
void operator()(T x, T y) const
32
{
33
//...
34
}
35
};
36
*/
37
38
template
<
typename
I>
// I models NodeIterator
39
struct
set_next_fn
;
// Must be specialized
40
41
/**************************************************************************************************/
42
43
template
<
typename
I>
// I models NodeIterator
44
inline
void
set_next
(I x, I y) {
45
set_next_fn<I>
()(x, y);
46
}
47
48
/**************************************************************************************************/
49
50
/*
51
location: a valid forward node iterator
52
first and last - two valid node iterators
53
54
postcondition: location->first...last->next(location)
55
*/
56
57
template
<
typename
I>
// T models ForwardNodeIterator
58
inline
void
splice_node_range
(I location, I first, I last) {
59
I successor(boost::next(location));
60
set_next
(location, first);
61
set_next
(last, successor);
62
}
63
64
template
<
typename
I>
// I models ForwardNodeIterator
65
inline
void
skip_next_node
(I location) {
66
set_next
(location, boost::next(boost::next(location)));
67
}
68
69
template
<
typename
I>
// I models BidirectionalNodeIterator
70
inline
void
skip_node
(I location) {
71
set_next
(boost::prior(location), boost::next(location));
72
}
73
75
76
/**************************************************************************************************/
77
78
}
// namespace unsafe
79
80
}
// namespace adobe
81
82
/**************************************************************************************************/
83
84
// ADOBE_ITERATOR_SET_NEXT_HPP
85
#endif
config.hpp
adobe::unsafe::skip_node
void skip_node(I location)
Definition
set_next.hpp:70
adobe::unsafe::splice_node_range
void splice_node_range(I location, I first, I last)
Definition
set_next.hpp:58
adobe::unsafe::set_next
void set_next(I x, I y)
Definition
set_next.hpp:44
adobe::unsafe::skip_next_node
void skip_next_node(I location)
Definition
set_next.hpp:65
adobe::unsafe
Definition
reverse.hpp:37
adobe
Definition
class_template.hpp:7
adobe::unsafe::set_next_fn
Definition
set_next.hpp:39
adobe
iterator
set_next.hpp
Generated by
1.14.0