3 ms·
Often, but not always. One example is calling virtual functions. There's an extra memory lookup to resolve the function call at runtime. Almost all the time,
by rkangel 11y ago
Often, but not always.
One example is calling virtual functions. There's an extra memory lookup to resolve the function call at runtime.
Almost all the time, that extra single memory lookup is irrelevant. But just occasionally, that cost can have an impact.
In principle it's no different to C - you need to understand the basics of what code the compiler is going to generate to do what you're asking it to. In C++ the constructs are much more complicated and that mapping becomes less clear.