Re: Ada exception block does NOT work?



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"
.



Relevant Pages

  • Re: NotSupportedException TomTomSDK
    ... The easiest way to marshal this data is as a byte array. ... use the System.Text.Encoding.Unicode.GetString to extract the inline string. ... BitConverter will allow you to get the int members out of the byte ... > Any ideas how to declare the TCHAR? ...
    (microsoft.public.pocketpc.developer)
  • Re: static array initialization in a class
    ... you declare a pointer and use it as an "array". ... For starters, you don't initialise arr. ... Even if those blocks were totally empty before you declared the int*, ...
    (comp.lang.cpp)
  • Cursor operations
    ... DECLARE @array TABLE (nameID INT NOT NULL, ... DECLARE arrayCursor CURSOR SCROLL FOR SELECT nameID, ... DECLARE @index INT, @count INT, @offset INT ...
    (microsoft.public.sqlserver.programming)
  • Re: Warning on assigning a function-returning-a-pointer-to-arrays
    ... declare pfunc as function returning pointer to array 5 of int ... I used cdecl myself to figure out how to declare a function ...
    (comp.lang.c)
  • Re: Really tough ADO Stored Procedure Question. Please Help!!!
    ... @lScenarioID_CopyFrom int, ... DECLARE @ErrMSG varchar--This is the max msg size ... ROLLBACK TRANSACTION ... SELECT @lRowCountHolder = MIN ...
    (microsoft.public.sqlserver.odbc)

Loading