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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!feeder.xsnews.nl!feeder.news-service.com!post.news-service.com!news1.surfino.com!not-for-mail Message-Id: <1748738.b1akuuDCEK@linux1.krischik.com> From: Martin Krischik Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Newsgroups: comp.lang.ada,comp.lang.c++ Reply-To: martin@krischik.com Date: Thu, 24 Mar 2005 12:33:53 +0100 References: <1110329098.642196@athnrd02> <1110361741.551255@athnrd02> <422edaec$0$26554$9b4e6d93@newsread4.arcor-online.net> <1111464133.508323@athnrd02> <423fe9df$0$11476$9b4e6d93@newsread2.arcor-online.net> <1111521825.653841@athnrd02> <424094b0$0$11481$9b4e6d93@newsread2.arcor-online.net> <1111568404.687226@athnrd02> <1111572591.296439@athnrd02> <1111574207.72969@athnrd02> <42414f88$0$9217$9b4e6d93@newsread4.arcor-online.net> <1111576802.823362@athnrd02> <1111577078.934620@athnrd02> <1111586334.958702.249050@o13g2000cwo.googlegroups.com> <1111608867.922129@athnrd02> <1111631889.495954@athnrd02> <1111634628.927041@athnrd02> Organization: None User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@surfino.com NNTP-Posting-Host: 83.169.175.19 (83.169.175.19) NNTP-Posting-Date: Thu, 24 Mar 2005 13:00:17 +0100 X-Trace: f14114242abd1f60c0ab620626 Xref: g2news1.google.com comp.lang.ada:9901 comp.lang.c++:47053 Date: 2005-03-24T12:33:53+01:00 List-Id: Ioannis Vranos wrote: > Jim Rogers wrote: > >> My reading of the information at that url indicates that GMP allows >> the specification of precision, but not the specification of a limited >> range of valid values. > > Since I have had enough with this signed value range of Ada, here is a > quick implementation of mine and some uses of it. > > I am sure one can create a better one or a container directly that > supports ranges, if he devotes some time, so the question again arises, > since it is possible and nothing exists, probably it is not considered > useful to have such a feature in C++: Shure it is usefull, very usefull indeed. Only you started off wrong: namespace Ada { template < class Base_Type, Base_Type The_First, Base_Type The_Last> class Range { ..... } template < class Element_Type, class Index_Type> // derived from Range. class Array { ..... } } Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com