Repeated calls to QueryInterface with the same parameters are guaranteed to return the same thing. The modern C++ projection uses a new compiler optimization to annotate the function as being pure so the compiler can eliminate such (virtual) calls that would otherwise have a high runtime overhead.
Repeated calls to
QueryInterface
with the same parameters are guaranteed to return the same thing. The modern C++ projection uses a new compiler optimization to annotate the function as being pure so the compiler can eliminate such (virtual) calls that would otherwise have a high runtime overhead.It is also explained here: https://www.youtube.com/watch?v=lm4IwfiJ3EU#t=50m03s
Maybe we can find (or build) a way to have the Rust compiler do a similar thing.