Slow performance compared to C++, ideas?

Paulo Pinto pjmlp at progtools.org
Wed Jun 5 12:05:13 PDT 2013


Am 05.06.2013 16:08, schrieb Regan Heath:
> On Wed, 05 Jun 2013 13:53:58 +0100, Michal Minich
> <michal.minich at 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
>

Me as well, I was used to being able to call virtual methods on the 
constructor in Object Pascal and it took me a while to find out why
my C++ program was crashing, back in the day.





More information about the Digitalmars-d mailing list