TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: SEBASTIAN NOZZI
from: MARIO SEMO
date: 1998-05-12 09:31:00
subject: Why contructors and destructors PUBLIC?

Hallo Sebastian!
Antwort auf eine Message von Sebastian Nozzi an todos:
 SN>  I think it is terrific, and therefore constructors and destructors 
 SN> should be private. I don't know. What do you think?
but then you should think about how to construct a new object and destroy it. 
eq:
  class Foo
  {
   public:
       Foo * make(arglist) { return new Foo (arglist);} 
       void   destroy(Foo *) ....
ok. in this case you habe to assert, that noone destroys an already destroyed 
object.
PS: the problem you are talking about is a semantic problem. maybe its a ok 
for some classes to be "reconstructed". and maybe its a bug to stop all 
enginges, when the airplance is 10.000m above the ground. 
 eq:
   class plane
   ...
      stopEnginges()
so, i would suggest to ASSERT some conditions as long as you not compile your 
code for public shipment. 
something that the programming Language EIFFEL calls in/out conditions for 
members.
Servus, Mario!
--- FleetStreet 1.21 PR#2
---------------
* Origin: LC/32 Development Team, http://www.kirchnersoft.com (2:310/14.11)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.