forked from boostorg/range
[range] Merge documentation fixes and minor refactoring of docs (refs #5160; refs #5314; refs #5440; refs #5775; refs #6212; refs #7585; refs #7843; refs #7866).
[SVN r82487]
This commit is contained in:
@@ -17,34 +17,13 @@
|
||||
* [*Returned Range Category:] The range category of `rng`.
|
||||
|
||||
[section:strided_example strided example]
|
||||
``
|
||||
#include <boost/range/adaptor/strided.hpp>
|
||||
#include <boost/range/algorithm/copy.hpp>
|
||||
#include <boost/assign.hpp>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
using namespace boost::adaptors;
|
||||
using namespace boost::assign;
|
||||
|
||||
std::vector<int> input;
|
||||
input += 1,2,3,4,5,6,7,8,9,10;
|
||||
|
||||
boost::copy(
|
||||
input | strided(2),
|
||||
std::ostream_iterator<int>(std::cout, ","));
|
||||
|
||||
return 0;
|
||||
}
|
||||
``
|
||||
[import ../../../test/adaptor_test/strided_example.cpp]
|
||||
[strided_example]
|
||||
[endsect]
|
||||
|
||||
This would produce the output:
|
||||
``
|
||||
1,3,5,7,9
|
||||
1,3,5,7,9,
|
||||
``
|
||||
[endsect]
|
||||
|
||||
|
Reference in New Issue
Block a user