November 04, 2001
It will be extremely nice to make non-virtual methods on structs anyway, and you could then make ctors and dtors for structs and put said structs on the stack... which would then get cleaned up on leaving scope, run the dtors, etc.  That way if you want a small class that just manages a resource, you make it a struct instead.

I can't imagine a language that provides properties, gettors, settors, etc on arrays, and doesn't let you add similar things to structs.

Sean

"Walter" <walter@digitalmars.com> wrote in message news:9njsqc$iis$1@digitaldaemon.com...
>
> Kent Sandvik wrote in message <9nj752$6li$1@digitaldaemon.com>...
> >Would this be a crazy feature, you could allocate objects on the heap
based
> >on a closure, maybe with some syntactic sugar that indicates that when
the
> >closure ends, the object's destructor is automatically called. This would indeed make it possible to write small objects that save and restore
state,
> >those are really handy (the constructor saves state, the destructor
> restores
> >it). --Kent
>
>
> Then it would be C++ <g>.
>
>


1 2 3 4 5 6 7
Next ›   Last »