Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78976417
for_each.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Aug 24, 02:15
Size
325 B
Mime Type
text/x-c
Expires
Mon, Aug 26, 02:15 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
20130527
Attached To
R9360 PCSC_git
for_each.cpp
View Options
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
int main() {
std::vector<double> v(10);
std::iota(v.begin(), v.end(), 0);
std::for_each(v.begin(), v.end(), [](double &x) { x = x * x; });
std::for_each(v.begin(), v.end(),
[](double x) { std::cout << x << std::endl; });
}
Event Timeline
Log In to Comment