boost::adaptors::sliced
References
Headers
boost::adaptors::sliced
is available by including
any of the following headers:
boost/range/adaptor/sliced.hpp
orboost/range/adaptor/copied.hpp
orboost/range/adaptors.hpp
Examples
slice_stride-pipe.cpp
#include <iostream>
#include <map>
#include <string>
#include <boost/range/adaptors.hpp>
const std::string str = "abcde";
int main() {
std::cout << "\"" << str << "\" sliced to (1, 4): "
<< (str | boost::adaptors::sliced(1, 4))
<< std::endl;
std::cout << "\"" << str << "\" | strided(2): "
<< (str | boost::adaptors::strided(2))
<< std::endl;
return 0;
}
Output:
"abcde" sliced to (1, 4): bcd
"abcde" | strided(2): ace
Boost Range for Humans
This reference is part of Boost Range for Humans. Click the link to the overview.