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,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!wanadoo.fr!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: 11 Sep 2004 11:59:33 +0200 Organization: Home - http://www.obry.org Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <413e2fbd$0$30586$626a14ce@news.free.fr> NNTP-Posting-Host: avelizy-151-2-7-46.w82-120.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news-reader4.wanadoo.fr 1094896775 7928 82.120.25.46 (11 Sep 2004 09:59:35 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 11 Sep 2004 09:59:35 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.95 Xref: g2news1.google.com comp.lang.ada:3581 Date: 2004-09-11T09:59:35+00:00 List-Id: kevin.cline@gmail.com (Kevin Cline) writes: > > Does the C++ standard directly address the behavior of handwritten > > bounded numbers? How many lines of template code will it take > > to get the effect of > > > > type A is array(Some_Index_Type) of Foo;? > > I don't know. It could be done in C++ if Some_Index_Type had the > right properties. But as a practical matter, no one seems to care, at > least no one in the C++ community. I very rarely have any need or use > for a statically sized array. That's why working with strings in C/C++ is a nightmare! strcpy/strcat,++,-- and so on... Look at some real world C/C++ code handling strings ! For memory, a string in Ada is: type String is array (Positive range <>) of Character; And you can do something like: function Some_Value return String is begin return "..."; end Some_Value; S1 : constant String := "a long string"; S2 : constant String := "this is definitly " & S1 & Some_Value; S3 : constant String := S1 (S1'First + 2 .. S1'First + 5); Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.org --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595