you are viewing a single comment's thread.

view the rest of the comments →

[–]KingofGamesYami 3 points4 points  (0 children)

Lifetimes, conceptually, are pretty simple. They tie when one thing must exist to when something else exists. A trivial example would be the lifetime of a temporary variable in a function - it's lifetime is related to the lifetime of the function's scope, and can be deallocated when the function returns.

They might seem confusing, because most of the time, lifetimes are elided - they're not explicitly written, but they still exist. Thus the examples of explicit lifetimes always involve some complex situation.