On 1/4/2012 10:53 AM, Manu wrote:
Oh, and virtual-by-default... completely unacceptable for a systems language.
 most functions are NOT virtual, and finding the false-virtuals while
optimising will be extremely tedious and time consuming.

The only reason to use classes in D is for polymorphic behavior - and that means
virtual functions. Even so, a class member function will be called directly if
it is private or marked as 'final'.

An easy way to find functions that are not overridden (what you called false virtuals) is to add:

   final:

at the top of your class definition. The compiler will give you errors for any functions that need to be virtual.

If you don't want polymorphic behavior, use structs instead. Struct member
functions are never virtual.


Worse, if libraries contain false virtuals, there's good chance I may not be
able to use said library on certain architectures (PPC, ARM in particular).

??

Reply via email to