Re: New Coding Rule

2002-03-12 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Mar 12, 2002 at 09:32:07AM +0100, Lars Gullik Bjønnes wrote: >> | Bad example. No class should contain more than one raw 'owned' pointer >> | is a better rule... >> >> And _way_ harder to enforce..., and also please explain why this is a >> bad

Re: New Coding Rule

2002-03-12 Thread Andre Poenitz
On Tue, Mar 12, 2002 at 09:32:07AM +0100, Lars Gullik Bjønnes wrote: > | Bad example. No class should contain more than one raw 'owned' pointer > | is a better rule... > > And _way_ harder to enforce..., and also please explain why this is a > bad example? And why shouldn't a class contain more t

Re: New Coding Rule

2002-03-12 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Mar 12, 2002 at 12:28:10AM +0100, Lars Gullik Bjønnes wrote: >> | Can you please give an example for the brain dead amongst us ? >> >> class Foo { >> // unsafe variant >> Foo() >> : bar1(new Bar), bar2(new Bar) >> {} >>

Re: New Coding Rule

2002-03-11 Thread Andre Poenitz
On Tue, Mar 12, 2002 at 12:28:10AM +0100, Lars Gullik Bjønnes wrote: > | Can you please give an example for the brain dead amongst us ? > > class Foo { > // unsafe variant > Foo() > : bar1(new Bar), bar2(new Bar) > {} > // safer variant > Foo() { >

Re: New Coding Rule

2002-03-11 Thread Andre Poenitz
On Mon, Mar 11, 2002 at 11:24:49PM +0100, Lars Gullik Bjønnes wrote: > I just got a new book :-) That's fine for you. > - > Always perform unmanaged resource acquisition in the constructor body, > never in initializer lists. > - > > - > Perform every explicit resource allocation (fo

Re: New Coding Rule

2002-03-11 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes: | On Mon, Mar 11, 2002 at 11:24:49PM +0100, Lars Gullik Bjønnes wrote: > >> Always perform unmanaged resource acquisition in the constructor body, >> never in initializer lists. > | Can you please give an example for the brain dead amongst us ? class Foo {

Re: New Coding Rule

2002-03-11 Thread John Levon
On Mon, Mar 11, 2002 at 11:24:49PM +0100, Lars Gullik Bjønnes wrote: > Always perform unmanaged resource acquisition in the constructor body, > never in initializer lists. Can you please give an example for the brain dead amongst us ? regards john -- I am a complete moron for forgetting about

New Coding Rule

2002-03-11 Thread Lars Gullik Bjønnes
I just got a new book :-) More Exceptional C++, and I found a couple of nice rules that I want us to adopt: - Always perform unmanaged resource acquisition in the constructor body, never in initializer lists. - - Perform every explicit resource allocation (for example, new) in its