Index » D » RAII (page 4)

August 27, 2002
>I think that the best approach would be to allow both auto classes and auto
>objects.
>Every instance of an auto class _must_ be declared as auto, otherwise it is an
>error. Non-auto classes can still have auto instances.
>
>Why require auto for classes if they are auto already? It'd make clear that
>class
>is actually auto.

Now that sounds like a plan.  Explicitness is good.
Mac


August 27, 2002
"Russell Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D6BBF0D.3010000@deming-os.org...
> > I've been thinking about that. Some classes should never be 'auto'
(because
> > they might squirrel a reference to themselves away remotely), and some should always be 'auto'.
> How about being able to check "auto" in the invariant of the class?

Since such errors could be detected at compile time, I think it would be better to do it that way.


August 27, 2002
"Russell Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D6A8F2A.40902@deming-os.org...
> You probably should be able to declare certain members of a class to be "auto" as well, so that they are dof'ed whenever the class goes away. Otherwise, the programmer has to code an explicit 'delete' in a
destructor.

That adds some significant complexity to the compiler (I know, I did it for C++!), so I'd like to defer that for some future variant of the language.


August 28, 2002
Walter wrote:

> "Russell Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D6A8F2A.40902@deming-os.org...
> > You probably should be able to declare certain members of a class to be "auto" as well, so that they are dof'ed whenever the class goes away. Otherwise, the programmer has to code an explicit 'delete' in a
> destructor.
>
> That adds some significant complexity to the compiler (I know, I did it for C++!), so I'd like to defer that for some future variant of the language.

Details?  I've learned to trust it when you say "too complex"...but I'm curious what happens...

--
The Villagers are Online! villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]


August 29, 2002
"Russ Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D6D1A90.910A1A30@deming-os.org...
> Walter wrote:
>
> > "Russell Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D6A8F2A.40902@deming-os.org...
> > > You probably should be able to declare certain members of a class to
be
> > > "auto" as well, so that they are dof'ed whenever the class goes away. Otherwise, the programmer has to code an explicit 'delete' in a
> > destructor.
> >
> > That adds some significant complexity to the compiler (I know, I did it
for
> > C++!), so I'd like to defer that for some future variant of the
language.
>
> Details?  I've learned to trust it when you say "too complex"...but I'm
curious
> what happens...

You have to add the member destructor code into existing destructors, and create destructors where there aren't any.


1 2 3 4
Next ›   Last »