DigiNews

Tech Watch by Johan Denoyer

← Back to articles

When can the C++ compiler devirtualize a call?

Quality: 8/10 Relevance: 9/10

Summary

This article investigates when C++ devirtualization occurs in practice, focusing on two main scenarios: known dynamic type and proof-of-leafness (final or internal linkage). It compares how major compilers (GCC, Clang, MSVC, ICC) handle various corner cases, discusses the role of LTO, and presents a table of results, offering insights into what developers can rely on for performance.

🚀 Service construit par Johan Denoyer