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: a07f3367d7,b92b95c9b5585075 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feedme.ziplink.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Sun, 14 Aug 2011 11:01:40 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> <1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net> <150vz10ihvb5a.1lysmewa1muz4$.dlg@40tude.net> <1q4c610mmuxn7$.1k6s78wa0r8fj.dlg@40tude.net> <1vn800hbyx8k4$.1lsveclj56197$.dlg@40tude.net> <1gu6ni1yb54k3$.4nbvfqqndl8m$.dlg@40tude.net> <9amuf2FdetU3@mid.individual.net> <9an4doFdeuU2@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 14 Aug 2011 11:01:40 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="NeKR7BF+xQYHvjCKjLNMvg"; logging-data="30891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/n51xFWfgyCcSmYXM5XGGXiSYsBK0YSBc=" User-Agent: Pan/0.134 (Wait for Me; GIT cb32159 master) Cancel-Lock: sha1:YuAC9DnkVSN1ru+HHa2CFF/AhZE= Xref: g2news1.google.com comp.lang.c++:82978 comp.lang.ada:20628 Date: 2011-08-14T11:01:40+00:00 List-Id: On Sat, 13 Aug 2011 14:12:51 +0100, Simon Wright wrote: > Brian Drummond writes: > >> Incidentally, the values of "lower" and "upper" need not be determined >> until runtime. The compiler can infer the best base type from whatever >> constraints it finds on "lower" and "upper". > > I don't think that can be true? OK, the range can be postponed until > runtime, but the base type of which the actual bounds are instances must > be known (talking about a compiler here, not an interpreter). Yes, that's what I meant by the constraints on the bounds ... the base type of the range must be wide enough to accommodate both bounds. I see no need to specify it; that's the compiler's job. - Brian