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,635cd9622b25ae59 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!j33g2000cwa.googlegroups.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada Subject: Re: Type safety, C++ and code generation Date: 2 May 2006 08:54:24 -0700 Organization: http://groups.google.com Message-ID: <1146585264.765010.101420@j33g2000cwa.googlegroups.com> References: <1146143954.169807.207080@t31g2000cwb.googlegroups.com> <1146148380.102042.119860@y43g2000cwc.googlegroups.com> <2051047.MTAq1HeU7p@linux1.krischik.com> <1146576797.106931.267280@i40g2000cwc.googlegroups.com> NNTP-Posting-Host: 192.91.173.36 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1146585276 26647 127.0.0.1 (2 May 2006 15:54:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 2 May 2006 15:54:36 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j33g2000cwa.googlegroups.com; posting-host=192.91.173.36; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news2.google.com comp.lang.ada:4015 Date: 2006-05-02T08:54:24-07:00 List-Id: Maciej Sobczak wrote: > REH wrote: > > >>>class R1 : ranged_type {}; > >>>class R2 : ranged_type {}; > >>>class R3 : ranged_type {}; > >>> > >>>to create new types. > >> > >>Except that those new types would be problematic to use with operations > >>that are already defined for ranged_type (especially those which return > >>ranged_type), because there is no implicit conversion to the derived class. > > > > That's not true. operators are usually defined using references. > > As written above: "especially those which return ranged_type". > > // some operation on the range type (can be a template) > ranged_type foo() {/* ... */} > > // some "new type" > class R : ranged_type {}; > > R r = foo(); // bang! > Yes, which is why I said that one of the problems was that it was missing necessary constructors. REH