Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121978955
lambda_loop.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
Tue, Jul 15, 04:24
Size
241 B
Mime Type
text/x-c++
Expires
Thu, Jul 17, 04:24 (2 d)
Engine
blob
Format
Raw Data
Handle
27420508
Attached To
R9360 PCSC_git
lambda_loop.cpp
View Options
#include <vector>
template <typename V, typename T> void for_each(V &vec, T f) {
for (auto d : vec) {
auto res = f(d);
}
}
int main() {
int a = 2;
std::vector<double> vec(10);
for_each(vec, [a](double d) { return d * a; });
}
Event Timeline
Log In to Comment