Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61400207
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
Mon, May 6, 10:35
Size
241 B
Mime Type
text/x-c++
Expires
Wed, May 8, 10:35 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17506859
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