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!t31g2000cwb.googlegroups.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada Subject: Re: Type safety, C++ and code generation Date: 27 Apr 2006 08:10:13 -0700 Organization: http://groups.google.com Message-ID: <1146150613.238540.89130@t31g2000cwb.googlegroups.com> References: <1146143954.169807.207080@t31g2000cwb.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 1146150628 3312 127.0.0.1 (27 Apr 2006 15:10:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Apr 2006 15:10:28 +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: t31g2000cwb.googlegroups.com; posting-host=192.91.173.36; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news2.google.com comp.lang.ada:3958 Date: 2006-04-27T08:10:13-07:00 List-Id: Maciej Sobczak wrote: > REH wrote: > > >>http://www.msobczak.com/prog/typegen/ > > > You maybe interested in a C++ class that I wrote. > > Been there, done that: > > http://www.msobczak.com/prog/downloads.html > > (see safetypes.tar.gz and range.tar.gz) > > I have dropped this idea because I think that the external code > generator is much more flexible and more powerful with regard to the > type safety that can be gained. Range checking is just one little part > of what is needed. Template classes are fine if you can afford limiting > yourself only to this little part, but that's not usually the case. > > Not to beat a dead horse, but your logic is also flawed in that it will not detect overflows. If an operation overflows, and wraps around into range, your code will be non-the-wiser. REH