Path: utzoo!attcan!utgpu!watmath!maytag!watstat!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: comp.lang.pascal Subject: Re: experience with tp5.5? Message-ID: <317@maytag.waterloo.edu> Date: 22 Jul 89 19:15:54 GMT References: <799@eutrc3.urc.tue.nl> <390004@hpctdls.HP.COM> <2971@internal.Apple.COM> Sender: daemon@maytag.waterloo.edu Reply-To: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Organization: U. of Waterloo, Ontario Lines: 24 In article <2971@internal.Apple.COM> lsr@Apple.COM (Larry Rosenstein) writes: >In article <390004@hpctdls.HP.COM> wei@hpctdls.HP.COM (Bill Ives) writes: > >> The constructor and destructor methods must be called when the object >> contains virtual methods or unpredicable result may occur. Even if >the >> object is statically allocated and is then assigned to another object > >This is pretty bad, in my opinion. If you are going to define the concept >of constructors and destructors, you should also have them called >automatically. This is one of the nice features of C++, and it is >unfortunate that Borland didn't recognize it as a good feature. In C++ >you can be sure that the internal state of an object is always consistent, >because the constructor would have been called. In TP 5.5, you're allowed multiple constructors in a single object, presumably to allow it to be initialized in different ways depending on the circumstances. You're also allowed to pass parameters to the constructor, and the different constructors don't need to take the same parameters. Both of these mean the constructor can't be called automatically. Isn't this a problem in C++? Duncan Murdoch