MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / main

Function main

tests/ForStmtWithLambdaInInitTest.cpp:3–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <cstdio>
2
3int main()
4{
5 int x = 0;
6
7 for(int i = [&]{ return x*2; }(); i < 20; ++i) {
8 x += i;
9 }
10
11 for(int i = [&]{ return x*2; }(), z = [&]{ return x*2; }(); i < 20; ++i) {
12 x += i;
13 }
14
15 for([]{printf("started\n");}(); [&]{ return --x; }(); []{printf("after\n");}())
16 {}
17
18
19 for([]{printf("started\n");}(),
20 []{printf("started\n");}(); [&]{ return --x; }(); []{printf("after\n");}())
21 {}
22
23}
24
25

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected