Boost.Range documentation iteration. Primarily this is the inclusion of Range Return Categories for every Range Adaptor page.

[SVN r61653]
This commit is contained in:
Neil Groves
2010-04-28 18:03:26 +00:00
parent 5364ea2cad
commit e3e1fc43d3
155 changed files with 1788 additions and 3127 deletions

View File

@ -121,30 +121,6 @@ In other words:
[endsect]
[section:adaptors_synopsis Synopsis]
The library provides the following Adapter Generator expressions:
``
rng | boost::adaptors::adjacent_filtered(bi_pred)
rng | boost::adaptors::copied(n,m)
rng | boost::adaptors::filtered(pred)
rng | boost::adaptors::indexed
rng | boost::adaptors::indirected
rng | boost::adaptors::map_keys
rng | boost::adaptors::map_values
rng | boost::adaptors::replaced(new_value, old_value)
rng | boost::adaptors::replaced_if(pred, new_value)
rng | boost::adaptors::reversed
rng | boost::adaptors::sliced(n, m)
rng | boost::adaptors::strided(n)
rng | boost::adaptors::tokenized( <see arguments below> )
rng | boost::adaptors::transformed(fun)
rng | boost::adaptors::uniqued
``
[endsect]
[section:general_requirements General Requirements]
In the description of generator expressions, the following notation is used:

View File

@ -9,7 +9,8 @@
* [*Precondition:] The `value_type` of the range is convertible to both argument types of `bi_pred`.
* [*Postcondition:] For all adjacent elements `[x,y]` in the returned range, `bi_pred(x,y)` is `true`.
* [*Throws:] Whatever the copy constructor of `bi_pred` might throw.
* [*Range Category:] `SinglePassRange`
* [*Range Category:] __single_pass_range__
* [*Returned Range Category:] The minimum of the range category of `rng` and __forward_range__
[section:adjacent_filtered_example adjacent_filtered example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] `0 <= n && n <= m && m < distance(rng)`
* [*Returns:] A new `iterator_range` that holds the sliced range `[n,m)` of the original range.
* [*Range Category:] `RandomAccessRange`
* [*Range Category:] __random_access_range__
* [*Returned Range Category:] __random_access_range__
[section:copied_example copied example]
``

View File

@ -9,8 +9,8 @@
* [*Precondition:] The `value_type` of the range is convertible to the argument type of `pred`.
* [*Postcondition:] For all adjacent elements `[x]` in the returned range, `pred(x)` is `true`.
* [*Throws:] Whatever the copy constructor of `pred` might throw.
* [*Range Category:] `ForwardRange`
* [*Returned Range Category:] `ForwardRange`
* [*Range Category:] __forward_range__
* [*Returned Range Category:] The minimum of the range category of `rng` and __bidirectional_range__
[section:filtered_example filtered example]
``

View File

@ -7,7 +7,8 @@
]
* [*Returns:] A range adapted to return both the element and the associated index. The returned range consists of iterators that have in addition to the usual iterator member functions an `index()` member function that returns the appropriate index for the element in the sequence corresponding with the iterator.
* [*Range Category:] `SinglePassRange`
* [*Range Category:] __single_pass_range__
* [*Returned Range Category:] The range category of `rng`
[section:indexed_example indexed example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] The `value_type` of the range defines unary `operator*()`
* [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `*y` where `y` is the corresponding element in the original range.
* [*Range Category:] `SinglePassRange`
* [*Range Category:] __single_pass_range__
* [*Returned Range Category:] The range category of `rng`
[section:indirected_example indirected example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] The `value_type` of the range is an instantiation of `std::pair`.
* [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `y.first` where `y` is the corresponding element in the original range.
* [*Range Category:] `SinglePassRange`
* [*Range Category:] __single_pass_range__
* [*Returned Range Category:] The range category of `rng`.
[section:map_keys_example map_keys example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] The `value_type` of the range is an instantiation of `std::pair`.
* [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `y.second` where `y` is the corresponding element in the original range.
* [*Range Category:] `SinglePassRange`
* [*Range Category:] __single_pass_range__
* [*Returned Range Category:] The range category of `rng`.
[section:map_values_example map_values example]
``

View File

@ -10,7 +10,8 @@
* `new_value` is convertible to the `value_type` of the range.
* `old_value` is convertible to the `value_type` of the range.
* [*Postcondition:] For all elements `x` in the returned range, the value `x` is equal to the value of `(y == old_value) ? new_value : y` where `y` is the corresponding element in the original range.
* [*Range Category:] `ForwardRange`
* [*Range Category:] __forward_range__
* [*Returned Range Category:] The range category of `rng`.
[section:replaced_example replaced example]
``

View File

@ -10,7 +10,8 @@
* The range `value_type` is convertible to the argument type of `pred`.
* `new_value` is convertible to the `value_type` of the range.
* [*Postconditions:] For all elements `x` in the returned range, the value `x` is equal to the value of `pred(y) ? new_value : y` where `y` is the corresponding element in the original range.
* [*Range Category:] `ForwardRange`
* [*Range Category:] __forward_range__
* [*Returned Range Category:] The range category of `rng`.
[section:replaced_if_example replaced_if example]
``

View File

@ -7,7 +7,8 @@
]
* [*Returns:] A range whose iterators behave as if they were the original iterators wrapped in `reverse_iterator`.
* [*Range Category:] `BidirectionalRange`
* [*Range Category:] __bidirectional_range__
* [*Returned Range Category:] The range category of `rng`.
[section:reversed_example reversed example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] `0 <= n && n <= m && m < distance(rng)`
* [*Returns:] `make_range(rng, n, m)`
* [*Range Category:] `RandomAccessRange`
* [*Range Category:] __random_access_range__
* [*Returned Range Category:] __random_access_range__
[section:sliced_example sliced example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] `0 <= n && n < distance(rng)`
* [*Returns:] A new range based on `rng` where traversal is performed in steps of `n`.
* [*Range Category:] `RandomAccessRange`
* [*Range Category:] __random_access_range__
* [*Returned Range Category:] __random_access_range__
[section:strided_example strided example]
``

View File

@ -35,7 +35,8 @@
* `flags` has the type `regex_constants::syntax_option_type`.
* [*Returns:] A range whose iterators behave as if they were the original iterators wrapped in `regex_token_iterator`. The first iterator in the range would be constructed by forwarding all the arguments of `tokenized()` to the `regex_token_iterator` constructor.
* [*Throws:] Whatever constructing and copying equivalent `regex_token_iterator`s might throw.
* [*Range Category:] `RandomAccessRange`
* [*Range Category:] __random_access_range__
* [*Returned Range Category:] __random_access_range__
[endsect]

View File

@ -9,7 +9,8 @@
* [*Precondition:] The `value_type` of the range is convertible to the argument type of `fun`.
* [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `fun(y)` where `y` is the corresponding element in the original range.
* [*Throws:] Whatever the copy-constructor of `fun` might throw.
* [*Range Category:] `SinglePassRange`
* [*Range Category:] __single_pass_range__
* [*Returned Range Category:] The range category of `rng`.
[section:transformed_example transformed example]
``

View File

@ -8,7 +8,8 @@
* [*Precondition:] The `value_type` of the range is comparable with `operator==()`.
* [*Postcondition:] For all adjacent elements `[x,y]` in the returned range, `x==y` is false.
* [*Range Category:] `ForwardRange`
* [*Range Category:] __forward_range__
* [*Returned Range Category:] The minimum of the range concept of `rng` and __forward_range__.
[section:uniqued_example uniqued example]
``

View File

@ -74,7 +74,7 @@ The same task may be accomplished simply with
``
boost::erase(vec, boost::unique<boost::return_next_end>(vec));
``
and there is no need to worry about generating an invalid range. Furthermore, if the container is complex, calling `vec.begin()` several times will be more expensive than using a range algorithm.
and there is no need to worry about generating an invalid range. Furthermore, if the container is complex, calling `vec.end()` several times will be more expensive than using a range algorithm.
[endsect]

View File

@ -4,17 +4,17 @@
``
template<class Integer>
integer_range< range_detail::integer_iterator<Integer> >
iterator_range< range_detail::integer_iterator<Integer> >
irange(Integer first, Integer last);
template<class Integer, class StepSize>
integer_range< range_detail::integer_iterator_with_step<Integer, StepSize> >
iterator_range< range_detail::integer_iterator_with_step<Integer, StepSize> >
irange(Integer first, Integer last, StepSize step_size);
``
[heading Description]
`irange` is a function to generate an Integer Range.
`irange` is a function to generate an Integer Range.
`irange` allows treating integers as a model of the __random_access_range__ Concept. It should be noted that the `first` and `last` parameters denoted a half-open range.