Skip to content

Commit 7ef95ed

Browse files
committed
Constants are not captured
1 parent 56da654 commit 7ef95ed

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎tests/unit/lambda_basic.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@ int main() {
1010
auto three = [](int x, int y, int z) { return x * 100 + y * 10 + z; };
1111
assert(three(1, 2, 3) == 123);
1212

13+
const int k = 3;
14+
constexpr int m = 4;
15+
auto constants = [](int x) { return x + k + m; };
16+
assert(constants(1) == 8);
17+
1318
return 0;
1419
}

0 commit comments

Comments
 (0)