You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
381 B
21 lines
381 B
#include "counting_iterator.hpp"
|
|
#include <vector>
|
|
#include <iostream>
|
|
|
|
int main(){
|
|
std::vector<int> v{1,3,37,1337,7};
|
|
|
|
for(auto x : counted(v)){
|
|
std::cout << "v[" << x.index << "] = " << x.value << std::endl;
|
|
}
|
|
|
|
for(auto x : counted(v)){
|
|
x.value *= x.index;
|
|
}
|
|
|
|
for(auto x : counted(v)){
|
|
std::cout << "v[" << x.index << "] = " << x.value << std::endl;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|