Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: C++ coding standards (Comment needed) Message-ID: <56968@microsoft.UUCP> Date: 27 Aug 90 20:50:05 GMT References: <883@zinn.MV.COM> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 13 In article <883@zinn.MV.COM> mjv@objects.mv.com (Michael J. Vilot) writes: |The Timer object `t' is only active in the inner block. Of course, the |object is apparently never used, so I may get into trouble with those |building aggressively-optimizing compilers. | |I hope such optimizations allow this use of constructor/destructor |side-effects. Yes, such usages of objects for the side effects of their constructors and destructors is explicetly allowed in the language, and will not be removed by compiler optimizations. Other common examples are objects that act as locks, and objects that print out debugging info as a side effect of construction or destruction.