Re: important proposal: scope keyword for class members

2009-03-11 Thread John Simon
Sean Kelly Wrote: > John Simon wrote: > > > > Oh man I've tried, believe me. > > I couldn't figure out how to call the destructors in-place. Also, structs > > can't have parameter-less constructors > > Have you tried just calling delete on the

Re: important proposal: scope keyword for class members

2009-03-09 Thread John Simon
Denis Koroskin Wrote: > On Sat, 07 Mar 2009 08:15:59 +0300, John Simon wrote: > > > I'd like to propose a new use for the 'scope' keyword within an > > aggregate body. > > > > Members of class type declared with the scope keyword are alloc

Re: important proposal: scope keyword for class members

2009-03-09 Thread John Simon
Yigal Chripun Wrote: > On 09/03/2009 00:12, John Simon wrote: > > Sean Kelly Wrote: > > > >> John Simon wrote: > >>> Sean Kelly Wrote: > >>>> Oh, I should mention that I'm not sure how the compiler would > >>>> handle this sc

Re: important proposal: scope keyword for class members

2009-03-08 Thread John Simon
Sean Kelly Wrote: > John Simon wrote: > > Sean Kelly Wrote: > >> > >> Oh, I should mention that I'm not sure how the compiler would handle > >> this scenario: > >> > >> class A { byte[16]; } > >> class B { byte[32]; } >

Re: important proposal: scope keyword for class members

2009-03-07 Thread John Simon
Sean Kelly Wrote: > Sean Kelly wrote: > > John Simon wrote: > >> I'd like to propose a new use for the 'scope' keyword within an > >> aggregate body. > >> > >> Members of class type declared with the scope keyword are allocated > &g

Re: important proposal: scope keyword for class members

2009-03-07 Thread John Simon
Christopher Wright Wrote: > John Simon wrote: > > You can always upcast and downcast safely, since it isn't actually a > > 'value' type, only the address is passed around. The type of the class > > remains intact. > > Right, but a scope variable has i

Re: important proposal: scope keyword for class members

2009-03-07 Thread John Simon
Christopher Wright Wrote: > dsimcha wrote: > > But the whole point of classes is that they're supposed to be polymorphic. > > If you > > don't need polymorphism, that's what structs are for. You can store them > > either > > inline (default) or in separate heap space (using pointers). If you

important proposal: scope keyword for class members

2009-03-06 Thread John Simon
I'd like to propose a new use for the 'scope' keyword within an aggregate body. Members of class type declared with the scope keyword are allocated not as references or pointers, but initialized directly inside the container. Instead of a default initializer of 'null', it will initialize with t