Skip to content

Instantly share code, notes, and snippets.

@Risca
Created May 27, 2015 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Risca/5315a1d40b87df8797c9 to your computer and use it in GitHub Desktop.
Save Risca/5315a1d40b87df8797c9 to your computer and use it in GitHub Desktop.
#include <vector>
#include <boost/range/algorithm_ext/iota.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/lambda/lambda.hpp>
using namespace boost::adaptors;
using namespace boost::lambda;
int main()
{
std::vector<int> numbers(10);
boost::copy(boost::iota(numbers, 1) | transformed(_1 * 100),
std::ostream_iterator<int>(std::cout,", "));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment