4 ms·
> A C++ compiler can infer nothing about aliasing from a function declaration. True. but you don't solely rely on the declaration, do you? lots of power comes
by j16sdiz 2y ago
> A C++ compiler can infer nothing about aliasing from a function declaration.
True.
but you don't solely rely on the declaration, do you?
lots of power comes from static analysis.
- steveklabnik 2y agoIt’s important to only rely on the declaration, for a few reasons. One of the simpler ones is that the body may be in another translation unit.
- seanbax 2y agoYou do solely rely on the declaration. From P3465: "why this is a scalable compile-time solution, because it requires only function-local analysis" Profiles uses local analysis, as does borrow checking. Whole program analysis is something you don't want to mess with.