virtual-by-default rant

Artur Skawina art.08.09 at gmail.com
Sat Mar 24 09:27:28 PDT 2012


On 03/24/12 16:16, Adam D. Ruppe wrote:
> On Saturday, 24 March 2012 at 10:56:27 UTC, Manu wrote:
>> My objection to virtual-by-default, but, acknowledging that can't be changed, insistence on a virtual keyword
>> is this.
> 
> I like the idea of a virtual keyword btw.
> 
>> Adding a system like you describe to validate virtuals is not a complexity I'm interested in implementing
> 
> 
> You already have! Let me quote one of your previous posts:
> 
> "I sincerely fear finding myself false-virtual hunting on build night until
> 2am trying to get the game to hold its frame rate (I already do this in
> C++, but at least you can grep for and validate them!)."
> 
> 
> In C++, you're hunting for false virtuals right now.
> 
> Your solution is to grep for and validate them.
> 
> 
> That's what I'm talking about here, but instead of grepping,
> using the language's reflection capabilities for an automated
> test.
> 
> Check out the example I pasted at the end of this message.

The question is -- are there false positives? 
(Ie situations where the compiler managed to devirtualize
methods which __traits reported earlier as being virtual)

artur


More information about the Digitalmars-d mailing list