(no title)
CyberRabbi | 2 years ago
Neither implementation guarantees any particular sequence of assembly instructions. Both require hoping that a sufficiently smart compiler will compile it to a sufficiently optimal sequence of instructions.
CyberRabbi | 2 years ago
Neither implementation guarantees any particular sequence of assembly instructions. Both require hoping that a sufficiently smart compiler will compile it to a sufficiently optimal sequence of instructions.
munificent|2 years ago
In practice, non-virtual function calls are reliably compiled to fairly efficient code while virtual calls are much less reliable.
CyberRabbi|2 years ago
Like I said, this echoes the conventional wisdom that most C++ developers seem to retain. The compiler landscape has changed since that wisdom was formed, since the advent of LTO and devirtualization optimizations.