All challenges
Multiple ChoiceHard 45s

Devirtualization opportunities

Under which condition can a compiler most reliably devirtualize a call through Base* to a virtual method?
Options
  1. 1Whenever the object is heap-allocated, so the type is known
  2. 2When the dynamic type is provably final or a known concrete type
  3. 3Only when LTO is disabled, or the types would be merged
  4. 4Only for inline virtual functions defined in a header body

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle