From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, TVD_PH_BODY_ACCOUNTS_PRE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,29fe9a340e0d180d X-Google-Attributes: gid103376,public From: Geert Bosch Subject: Re: Depending on passing mechanism Date: 1997/10/21 Message-ID: <62hra6$5j5$1@gonzo.sun3.iaf.nl>#1/1 X-Deja-AN: 284782040 References: Organization: La Calandre Infortunee Newsgroups: comp.lang.ada Date: 1997-10-21T00:00:00+00:00 List-Id: Tucker Taft wrote: ``As others have pointed out, in Ada 95 you *do* have control when implementing a type to either force by-reference (by making the underlying type tagged, protected, task, or limited record)'' For those cases where you do not want a type to be limited, but you want to enforce passing-by-reference semantics, it is also possible to use a record with a volatile component. type Volatile_Type is null record; pragma Volatile (Volatile_Type); type Account is record Force_By_Reference : Volatile_Type; Amount : Currency_Type; end record; This enforces pass-by-reference semantics for any object of type account without extra space or time overhead and without limiting assignment. Regards, Geert