mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 04:44:34 +03:00
Minor improvement.
This commit is contained in:
@@ -3155,8 +3155,8 @@ Pointers and references to locals shouldn't outlive their scope. Lambdas that ca
|
||||
int local = 42;
|
||||
thread_pool.queue_work([&]{ process(local); }); // Want a reference to local.
|
||||
// Note, that after program exists this scope,
|
||||
// local does no longer exist,
|
||||
// therefore process() call will have undefined behavior!
|
||||
// local does no longer exist, therefore
|
||||
// process() call will have undefined behavior!
|
||||
}
|
||||
|
||||
##### Example, good
|
||||
|
||||
Reference in New Issue
Block a user