mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-31 05:17:20 +02:00
Whitespace cleanup and formatting fixes in docs.
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:adaptor Iterator Adaptor]
|
[section:adaptor Iterator Adaptor]
|
||||||
|
|
||||||
The `iterator_adaptor` class template adapts some `Base` [#base]_
|
The `iterator_adaptor` class template adapts some `Base` [#base]_
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:archetypes Iterator Archetypes]
|
[section:archetypes Iterator Archetypes]
|
||||||
|
|
||||||
The `iterator_archetype` class constructs a minimal implementation of
|
The `iterator_archetype` class constructs a minimal implementation of
|
||||||
@ -156,5 +155,4 @@ the iterator concept specified by `AccessCategory` and
|
|||||||
arguments. `iterator_archetype` does not model any other access
|
arguments. `iterator_archetype` does not model any other access
|
||||||
concepts or any more derived traversal concepts.
|
concepts or any more derived traversal concepts.
|
||||||
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:concepts Iterator Concepts]
|
[section:concepts Iterator Concepts]
|
||||||
|
|
||||||
[section:access Access]
|
[section:access Access]
|
||||||
@ -326,13 +325,13 @@ constant object of type `Distance`.
|
|||||||
[pre: there exists a value `n` of `Distance` such that `a + n == b`. `b == a + (b - a)`.]
|
[pre: there exists a value `n` of `Distance` such that `a + n == b`. `b == a + (b - a)`.]
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
[`a\[n\]`]
|
[`a[n]`]
|
||||||
[convertible to T]
|
[convertible to T]
|
||||||
[`*(a + n)`]
|
[`*(a + n)`]
|
||||||
[pre: a is a *Readable Iterator*]
|
[pre: a is a *Readable Iterator*]
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
[`a\[n\] = v`]
|
[`a[n] = v`]
|
||||||
[convertible to T]
|
[convertible to T]
|
||||||
[`*(a + n) = v`]
|
[`*(a + n) = v`]
|
||||||
[pre: a is a *Writable iterator*]
|
[pre: a is a *Writable iterator*]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:counting Counting Iterator]
|
[section:counting Counting Iterator]
|
||||||
|
|
||||||
A `counting_iterator` adapts an object by adding an `operator*` that
|
A `counting_iterator` adapts an object by adding an `operator*` that
|
||||||
@ -36,8 +35,10 @@ into the first array via indirection through the second array.
|
|||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
|
[pre
|
||||||
indirectly printing out the numbers from 0 to 7
|
indirectly printing out the numbers from 0 to 7
|
||||||
0 1 2 3 4 5 6
|
0 1 2 3 4 5 6
|
||||||
|
]
|
||||||
|
|
||||||
The source code for this example can be found [example_link counting_iterator_example.cpp..here].
|
The source code for this example can be found [example_link counting_iterator_example.cpp..here].
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:facade Iterator Facade]
|
[section:facade Iterator Facade]
|
||||||
|
|
||||||
While the iterator interface is rich, there is a core subset of the
|
While the iterator interface is rich, there is a core subset of the
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:facade_tutorial Tutorial]
|
[section:facade_tutorial Tutorial]
|
||||||
|
|
||||||
In this section we'll walk through the implementation of a few
|
In this section we'll walk through the implementation of a few
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:filter Filter Iterator]
|
[section:filter Filter Iterator]
|
||||||
|
|
||||||
The filter iterator adaptor creates a view of an iterator range in
|
The filter iterator adaptor creates a view of an iterator range in
|
||||||
@ -19,7 +18,6 @@ This example uses `filter_iterator` and then
|
|||||||
array of integers. Then `make_filter_iterator` is is used to output
|
array of integers. Then `make_filter_iterator` is is used to output
|
||||||
the integers greater than `-2`.
|
the integers greater than `-2`.
|
||||||
|
|
||||||
|
|
||||||
struct is_positive_number {
|
struct is_positive_number {
|
||||||
bool operator()(int x) { return 0 < x; }
|
bool operator()(int x) { return 0 < x; }
|
||||||
};
|
};
|
||||||
@ -70,10 +68,11 @@ the integers greater than `-2`.
|
|||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
|
[pre
|
||||||
4 5 8
|
4 5 8
|
||||||
4 5 8
|
4 5 8
|
||||||
0 -1 4 5 8
|
0 -1 4 5 8
|
||||||
|
]
|
||||||
|
|
||||||
The source code for this example can be found [example_link filter_iterator_example.cpp..here].
|
The source code for this example can be found [example_link filter_iterator_example.cpp..here].
|
||||||
|
|
||||||
@ -238,5 +237,4 @@ operations.
|
|||||||
or `m_pred(*m_iter) == true`.[br]
|
or `m_pred(*m_iter) == true`.[br]
|
||||||
[*Returns: ] `*this`
|
[*Returns: ] `*this`
|
||||||
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:function_output Function Output Iterator]
|
[section:function_output Function Output Iterator]
|
||||||
|
|
||||||
The function output iterator adaptor makes it easier to create custom
|
The function output iterator adaptor makes it easier to create custom
|
||||||
|
@ -66,10 +66,11 @@ using the `make_indirect_iterator` helper function.
|
|||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
|
[pre
|
||||||
a,b,c,d,e,f,g,
|
a,b,c,d,e,f,g,
|
||||||
b,c,d,e,f,g,h,
|
b,c,d,e,f,g,h,
|
||||||
a,b,c,d,e,f,g,
|
a,b,c,d,e,f,g,
|
||||||
|
]
|
||||||
|
|
||||||
The source code for this example can be found
|
The source code for this example can be found
|
||||||
[example_link indirect_iterator_example.cpp..here].
|
[example_link indirect_iterator_example.cpp..here].
|
||||||
|
@ -305,4 +305,3 @@ library you see today.
|
|||||||
Patterns, C++ Report, February 1995, pp. 24-27.]
|
Patterns, C++ Report, February 1995, pp. 24-27.]
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:iterator_traits Iterator Traits]
|
[section:iterator_traits Iterator Traits]
|
||||||
|
|
||||||
`std::iterator_traits` provides access to five associated types
|
`std::iterator_traits` provides access to five associated types
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:permutation Permutation Iterator]
|
[section:permutation Permutation Iterator]
|
||||||
|
|
||||||
The permutation iterator adaptor provides a permuted view of a given
|
The permutation iterator adaptor provides a permuted view of a given
|
||||||
@ -75,13 +74,14 @@ past-the-end iterator to the indices.
|
|||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
|
[pre
|
||||||
The original range is : 0 1 2 3 4 5 6 7 8 9
|
The original range is : 0 1 2 3 4 5 6 7 8 9
|
||||||
The reindexing scheme is : 9 8 7 6
|
The reindexing scheme is : 9 8 7 6
|
||||||
The permutated range is : 9 8 7 6
|
The permutated range is : 9 8 7 6
|
||||||
Elements at even indices in the permutation : 9 7
|
Elements at even indices in the permutation : 9 7
|
||||||
Permutation backwards : 6 7 8 9
|
Permutation backwards : 6 7 8 9
|
||||||
Iterate backward with stride 2 : 6 8
|
Iterate backward with stride 2 : 6 8
|
||||||
|
]
|
||||||
|
|
||||||
The source code for this example can be found
|
The source code for this example can be found
|
||||||
[example_link permutation_iter_example.cpp..here].
|
[example_link permutation_iter_example.cpp..here].
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:reverse Reverse Iterator]
|
[section:reverse Reverse Iterator]
|
||||||
|
|
||||||
The reverse iterator adaptor iterates through the adapted iterator
|
The reverse iterator adaptor iterates through the adapted iterator
|
||||||
@ -9,7 +8,6 @@ range in the opposite direction.
|
|||||||
The following example prints an array of characters in reverse order
|
The following example prints an array of characters in reverse order
|
||||||
using `reverse_iterator`.
|
using `reverse_iterator`.
|
||||||
|
|
||||||
|
|
||||||
char letters_[] = "hello world!";
|
char letters_[] = "hello world!";
|
||||||
const int N = sizeof(letters_)/sizeof(char) - 1;
|
const int N = sizeof(letters_)/sizeof(char) - 1;
|
||||||
typedef char* base_iterator;
|
typedef char* base_iterator;
|
||||||
@ -35,10 +33,11 @@ using `reverse_iterator`.
|
|||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
|
[pre
|
||||||
original sequence of letters: hello world!
|
original sequence of letters: hello world!
|
||||||
sequence in reverse order: !dlrow olleh
|
sequence in reverse order: !dlrow olleh
|
||||||
sequence in double-reversed (normal) order: hello world!
|
sequence in double-reversed (normal) order: hello world!
|
||||||
|
]
|
||||||
|
|
||||||
The source code for this example can be found
|
The source code for this example can be found
|
||||||
[example_link reverse_iterator_example.cpp..here].
|
[example_link reverse_iterator_example.cpp..here].
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:shared_container Shared Container Iterator]
|
[section:shared_container Shared Container Iterator]
|
||||||
|
|
||||||
Defined in header [@../../../boost/shared_container_iterator.hpp `boost/shared_container_iterator.hpp`].
|
Defined in header [@../../../boost/shared_container_iterator.hpp `boost/shared_container_iterator.hpp`].
|
||||||
@ -97,7 +96,9 @@ the underlying vector and thereby extend the container's lifetime.
|
|||||||
|
|
||||||
The output from this part is:
|
The output from this part is:
|
||||||
|
|
||||||
|
[pre
|
||||||
0,1,2,3,4,5,
|
0,1,2,3,4,5,
|
||||||
|
]
|
||||||
|
|
||||||
[table Template Parameters
|
[table Template Parameters
|
||||||
[[Parameter][Description]]
|
[[Parameter][Description]]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:specialized Specialized Adaptors]
|
[section:specialized Specialized Adaptors]
|
||||||
|
|
||||||
[include ./counting_iterator.qbk]
|
[include ./counting_iterator.qbk]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:transform Transform Iterator]
|
[section:transform Transform Iterator]
|
||||||
|
|
||||||
The transform iterator adapts an iterator by modifying the
|
The transform iterator adapts an iterator by modifying the
|
||||||
@ -37,11 +36,12 @@ in this example.
|
|||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
|
[pre
|
||||||
multiplying the array by 2:
|
multiplying the array by 2:
|
||||||
2 4 6 8 10 12 14 16
|
2 4 6 8 10 12 14 16
|
||||||
adding 4 to each element in the array:
|
adding 4 to each element in the array:
|
||||||
5 6 7 8 9 10 11 12
|
5 6 7 8 9 10 11 12
|
||||||
|
]
|
||||||
|
|
||||||
The source code for this example can be found
|
The source code for this example can be found
|
||||||
[example_link transform_iterator_example.cpp..here].
|
[example_link transform_iterator_example.cpp..here].
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[section:zip Zip Iterator]
|
[section:zip Zip Iterator]
|
||||||
|
|
||||||
The zip iterator provides the ability to parallel-iterate
|
The zip iterator provides the ability to parallel-iterate
|
||||||
|
Reference in New Issue
Block a user