mirror of
https://github.com/boostorg/range.git
synced 2025-07-29 04:17:39 +02:00
[range] docs for writing adaptors: removed clarification added in r82315 (it was redundant); fixed typos that messed up numbering
[SVN r82326]
This commit is contained in:
@ -225,10 +225,6 @@ namespace
|
||||
const detail::reverse_forwarder reversed = detail::reverse_forwarder();
|
||||
}
|
||||
``
|
||||
Note that this last step only applies if the adaptor takes no arguments. If the adaptor takes arguments
|
||||
(such as `indexed`), then there is no need for a variable. Instead, give the tag type a
|
||||
constructor that takes the arguments (and store those arguments in the tag object). A usage
|
||||
of the adaptor will then involve construction of an object of the tag type.
|
||||
|
||||
[endsect]
|
||||
|
||||
@ -285,9 +281,7 @@ public:
|
||||
``
|
||||
|
||||
# Implement a holder class to hold the arguments required to construct the RangeAdaptor.
|
||||
|
||||
The holder combines multiple parameters into one that can be passed as the right operand of `operator|()`.
|
||||
|
||||
``
|
||||
template<typename T>
|
||||
class replace_holder : public boost::range_detail::holder2<T>
|
||||
@ -302,14 +296,12 @@ private:
|
||||
``
|
||||
|
||||
# Define an instance of the holder with the name of the adaptor
|
||||
|
||||
``
|
||||
static boost::range_detail::forwarder2<replace_holder>
|
||||
replaced = boost::range_detail::forwarder2<replace_holder>();
|
||||
``
|
||||
|
||||
# Define `operator|`
|
||||
|
||||
``
|
||||
template<typename SinglePassRange>
|
||||
inline replace_range<SinglePassRange>
|
||||
|
Reference in New Issue
Block a user