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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!t11g2000vbc.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Thu, 23 Sep 2010 01:02:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <965254c1-a0d3-40d7-b306-99d13265b132@t11g2000vbc.googlegroups.com> References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <4c8dec8e$0$6990$9b4e6d93@newsspool4.arcor-online.net> <8f6cceFrv2U1@mid.individual.net> <135a7dc9-3943-45e4-884b-3cc6bce3db0a@q18g2000vbm.googlegroups.com> <81799aab-a2e8-4390-8f42-abceaa5fc032@m1g2000vbh.googlegroups.com> <5c0d7798-ba09-4bd0-a28f-f1b028cce927@y3g2000vbm.googlegroups.com> <87r5gl8tky.fsf@ludovic-brenta.org> <8762xxd0az.fsf@mid.deneb.enyo.de> <87mxr98rff.fsf@ludovic-brenta.org> <87tylha55t.fsf@mid.deneb.enyo.de> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285228963 20549 127.0.0.1 (23 Sep 2010 08:02:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 23 Sep 2010 08:02:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t11g2000vbc.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14206 Date: 2010-09-23T01:02:40-07:00 List-Id: Florian Weimer wrote on comp.lang.ada: >>> Iterators are examples of pool-specific allocators in C++. > >> How so? =A0IIUC, iterators are not even a language construct, only an >> idiom in the standard library. > > C++ is so flexible that you can express the concept of a pointer in a > library. =A0In the same way, you could argue that C++ does not support > numerics because it hasn't got a power operator. 8-) Ah, I think I understand what you mean now: any type that has a dereference operator (operator*() or operator->(), IIRC) is a pointer type, right? Sorry, I disagree with that. Pointer types are definite and elementary. An arbitrary C++ type with operator* is not always definite or elementary. This becomes important in the context of safety-critical software; the fact that pointer types are elementary guarantees that no dynamic dispatching occurs when you call an operator of the type; that you can store them in registers, convert them to and from hardware addresses and apply representation clauses to them without worrying where to store the tag. The fact that they are definite means you can store them efficiently in containers, with shallow copy semantics. Ah but perhaps C++ lacks indefinite types, too? -- Ludovic Brenta.