4 ms·
This wouldn't be possible in a practical sense. One could imagine a static analyzer of some kind which infers all lifetimes, though that would likely quickly be
by pirocks 6y ago
This wouldn't be possible in a practical sense. One could imagine a static analyzer of some kind which infers all lifetimes, though that would likely quickly be unworkably slow on real codebases, since you need to infer programmer intent. Additionally c static analyzers intended to catch all memory errors/UB etc. have existed for decades, and no one uses them, b/c they don't work or have too many false positives. For example did you know that until C++20 allocating an int with malloc was UB in C++? Would you want to work in a language where the linter marked every other line as UB?