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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2866100c9a2b8ce7 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Type conversion between access types (was: Free'ing extended types) Date: 1996/05/23 Message-ID: #1/1 X-Deja-AN: 156325330 references: <3183AC75.335C@ehs.ericsson.se> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-05-23T00:00:00+00:00 List-Id: In article , Scott Leschke wrote: >So what about 'all' causes the conversion to be allowed? I looked at >section 4.6 of the LRM but got a tad confused? If you write "all", then it's called a "general access type". 4.6(13) allows conversion from an access type (general or pool-specific) to a general access type. 4.6(21) says that if the target type doesn't fall into one the cases allowed previously, then you can only convert within the same tree of derived types. (I suspect that derived access types are unusual, so that would probably not apply.) In retrospect, I think the added complexity of "all" was a mistake. We should have dropped the "all", and just let 4.6(13) apply to any access type. The intention of having the "all" in the language was to allow implementations to use clever representations for pool-specific access types. For example, if you know that the storage pool is only 64 K bytes, then you can use a 16-bit offset for a pool-specific access type, because you know it always points into that pool. For a general access type, however, you need a full pointer (say, 32 bits), because it can point into any pool, and can point into the stack. Another advantage of pool-specific access types is that you know you can't erroneously deallocate from the wrong storage pool. But in my programs, I almost always end up writing "all". I suggest that you always use "all" for access-to-class-wide types, since you will often need to do the conversions allowed by 4.6(13). - Bob