4 ms·
It wouldn't cost memory though, because you free up a slot in the virtual table. No?
by euyyn 9y ago
It wouldn't cost memory though, because you free up a slot in the virtual table. No?
- jonhohle 9y agoVirtual table should be one per class. A type field would be once per instance.
- euyyn 9y agoAh, right, static fields in C++ can't be overridden. If they could, they could be implemented by stuffing them in the virtual table and the cost in space would be O(classes) instead of O(instances).
- deleted 9y ago[deleted]