comp.lang.ada
 help / color / mirror / Atom feed
From: "Bertrand Augereau" <baugereau@ifrance.kom>
Subject: Construction/Destruction and copy semantics
Date: Sun, 22 Jul 2001 18:33:43 +0200
Date: 2001-07-22T16:28:27+00:00	[thread overview]
Message-ID: <9jeuvb$not$1@wanadoo.fr> (raw)

One of the (many) features I like in C++ is constructors/destructors
semantics.
I find it better than calling a construct procedure and destroy procedure
for non-trivial data types (those that have pointers to other ressources, or
sockets, or whetever, for instance).
You can't forget it this way.
Is the problem that I want to stick a C++ pattern in Ada? How do you Ada
programmers manage this problem?

Second thing, I tried to write some basic containers, and they rely on the
:= 'operator'. It seems to me you can't overload it in Ada.
So if you have a type which needs lazy copying for instance, you have to
define a 'copy' procedure for this type.
And then your container relies on this procedure. It is not that generic any
more at this point.
It seems bad to me as you can't instantiate your generic containers with the
types of somebody else who uses 'clone' instead.
Is it right? How do you adress this problem?

Thanks.
Bertrand

Btw, this is just for getting informed, not to start a language holy war
(some people tend to be paranoid)






             reply	other threads:[~2001-07-22 16:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-22 16:33 Bertrand Augereau [this message]
2001-07-22 17:42 ` Construction/Destruction and copy semantics Ehud Lamm
2001-07-22 17:52 ` James Rogers
2001-07-22 18:16   ` Bertrand Augereau
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox