On Wed, 05 Jun 2013 13:53:58 +0100, Michal Minich <michal.min...@gmail.com> wrote:

On Monday, 3 June 2013 at 17:18:55 UTC, Andrei Alexandrescu wrote:
  override is not comparable
because it improves code correctness and maintainability, for which there is ample prior evidence. It's also a matter for which, unlike virtual/final, there is no reasonable recourse.

Virtual by default makes it simpler to call method on object that is not initialized yet (constructor not called yet). This situation is possible regardless if virtual is default or not (it can just happen more easily).

Yeah, it happened to me in C++ .. same with virtuals in the destructor. Lesson learned first time tho :p

I think this calling virtual function in constructor should generate a warning. (I wouldn't be surprised if there is enhancement request filed for this already)

With virtual by default, could D statically verify/deny these? What about with static by default? Does it get easier or harder to detect/deny these in either case?

R

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Reply via email to