|
|
|
|
|
by klodolph
12 days ago
|
|
In this case you’re really setting a lower bound on the borrow of B, not an upper bound on the lifetime of A. I assure you this is not pedantry or a nitpick. The classic case here is if you want to borrow a local variable inside a thread… you need to ensure that the thread lifetime is bounded from above by the lifetime of the borrowed variable. This is why we have weird workarounds like std::thread::scope. If we could just express an upper bound on lifetime, it wouldn’t be necessary. |
|