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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: donh@syd.csa.com.au (Don Harrison) Subject: Re: OO, C++, and something much better! Date: 1997/01/14 Message-ID: #1/1 X-Deja-AN: 209660280 sender: news@syd.csa.com.au x-nntp-posting-host: dev50 references: organization: CSC Australia, Sydney reply-to: donh@syd.csa.com.au newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1997-01-14T00:00:00+00:00 List-Id: Robert Dewar writes: :Don Harrison said : :"Yes, these mechanisms are inherently unsafe but their purpose is to allow :different views of the same data. There are different ways of acheiving :that and some ways are safer than others. For example, UNCHECKED_CONVERSION :is safer than overlaying because the data is copied thus protecting the :original object." : : :That is a misconception. Unchecked_Conversion does not require the data :to be copied. The whole point of 13.9(12) is to remove this requirement: : :12 An implementation may return the result of an unchecked conversion by :reference, if the Source type is not a by-copy type. In this case, the :result of the unchecked conversion represents simply a different (read-only) :view of the operand of the conversion. Okay. So, in both cases - whether a copy or a reference is returned - the source object is protected. Correct? If so, I don't follow why you might bother making a copy: :The design principle here is that since this is a d0-it-at-your-own-risk :and make-sure-you-know-what-you-are-doing operation, it is inappropriate :to waste time trying to increase the safety of the operation. If you :want to ensure that a copy is made, you must make the copy. Don. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison donh@syd.csa.com.au