mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-17 01:54:36 +03:00
Merge pull request #10 from dkorolev/master
Typo: `s/would no compile/would not compile/`.
This commit is contained in:
@@ -393,7 +393,7 @@ int factory(int i) { return i * 10; }
|
||||
auto f = [x = factory(2)] { return x; }; // returns 20
|
||||
|
||||
auto generator = [x = 0] () mutable {
|
||||
// this would no compile without 'mutable' as we are modifying x on each call
|
||||
// this would not compile without 'mutable' as we are modifying x on each call
|
||||
return x++;
|
||||
};
|
||||
auto a = generator(); // == 0
|
||||
|
||||
Reference in New Issue
Block a user