Re: Ada exception block does NOT work?
- From: "Frank J. Lhota" <NOSPAM.lhota@xxxxxxxxxxx>
- Date: Thu, 18 Aug 2005 20:52:49 GMT
Hyman Rosen wrote:
Ada types incorporate values that depend upon runtime values. Array size is probably the simplest example - you can declare an array inside a procedure whose size is determined by a parameter to that procedure. I don't know Ada, but I'm pretty sure that you can also have types whose discriminants are set using values determined at runtime. As such, Ada types require local storage (in principle) for their representation, and it makes sense to free that storage once the scope in which the type is declared is exited. C++ types never depend on runtime values - they are always fully determined at compile time.
It is true that C++ types are static, but it is still possible to have scope problems with C++ exceptions, for example:
class CBadException
{
public:
int& m_Count;
CBadException (int& Count) : m_Count (Count) {}
};void foo ()
{
int Count;
CBadException Expt (Count); throw Expt; // Expt now references Count,
// which is going out of scope
}-- "All things extant in this world, Gods of Heaven, gods of Earth, Let everything be as it should be; Thus shall it be!" - Magical chant from "Magical Shopping Arcade Abenobashi"
"Drizzle, Drazzle, Drozzle, Drome, Time for the this one to come home!" - Mr. Lizard from "Tutor Turtle" .
- References:
- Ada exception block does NOT work?
- From: bubble
- Re: Ada exception block does NOT work?
- From: Georg Bauhaus
- Re: Ada exception block does NOT work?
- From: bubble
- Re: Ada exception block does NOT work?
- From: Jeffrey R. Carter
- Re: Ada exception block does NOT work?
- From: Maciej Sobczak
- Re: Ada exception block does NOT work?
- From: Jeffrey R. Carter
- Re: Ada exception block does NOT work?
- From: Maciej Sobczak
- Re: Ada exception block does NOT work?
- From: Jeffrey Carter
- Re: Ada exception block does NOT work?
- From: Hyman Rosen
- Re: Ada exception block does NOT work?
- From: jimmaureenrogers@xxxxxxxxxxxxxxxx
- Re: Ada exception block does NOT work?
- From: Hyman Rosen
- Ada exception block does NOT work?
- Prev by Date: Re: Ada exception block does NOT work?
- Next by Date: Re: Ada exception block does NOT work?
- Previous by thread: Re: Ada exception block does NOT work?
- Next by thread: Re: Ada exception block does NOT work?
- Index(es):
Relevant Pages
|
Loading