If I have many classes that use other classes with purely virtual interfaces can the compiler optimize this to not have a virtual call in Release Mode with full optimizations enabled?
For instance I have a class HardwareBuffer that contains a pointer to IHardwareResourceManager that has a virtual method:
virtual void ReleaseBuffer(HardwareBuffer* buffer) = 0;
and in the Release method of HardwareBuffer, I call
m_pHardwareResourceManager->Release(this);
There is a single class Render that inherits IHardwareResourceManager, where I actually implement the virtual Release method. When I create a HardwareBuffer, I set its m_pHardwareResourceManager to the Renderer itself.
Can the call to IHardwareResourceManager::Release in the Release method of HardwareBuffer be devirtualized?