Weird that to statically prevent a method from being hidden by a derived class in C++, you have to make it virtual, then final.
-
-
Vastauksena käyttäjälle @tloch14
But will that create a vtable entry? I hope not. Kinda wish C++ would just not let you hide base methods at all.
#programming2 vastausta 0 uudelleentwiittausta 1 tykkäys -
Vastauksena käyttäjälle @torokokill
@torokokill Some googling yields that compilers can optimize the vtable away, but I haven't found yet that they particularly do here.1 vastaus 0 uudelleentwiittausta 0 tykkäystä
@torokokill Tho, it almost seems like to write good C++11, you make all methods virtual and either final them or not. Sounds like Java.
13.23 - 11. helmik. 2016
0 vastausta
0 uudelleentwiittausta
2 tykkäystä
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.