On 12/7/2013 1:52 AM, Joseph Rushton Wakeling wrote:
On 07/12/13 02:10, Walter Bright wrote:
I know well that people used to C++ will likely do this. However, one can get in
the habit of by default adding "final:" as the first line in a class definition,
and then the compiler will tell you which ones need to be made virtual.

The disadvantage of this approach is that, if one forgets to add that "final",
it doesn't just produce a performance hit -- it means that it may be impossible
to correct without breaking downstream code, because users may have overridden
class methods that weren't meant to be virtual.

D doesn't allow overriding non-virtual functions (unlike C++).

Reply via email to