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,703c4f68db81387d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 24 Mar 2005 20:23:53 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> <4793664.vi5Yol0h1t@linux1.krischik.com> <1111682141.541662.113720@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1111713833 9898 192.74.137.71 (25 Mar 2005 01:23:53 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 25 Mar 2005 01:23:53 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:9943 Date: 2005-03-24T20:23:53-05:00 List-Id: "Jerry Coffin" writes: > While bounded vs. unbounded strikes me as a reasonable distinction, I'm > not at all convinced that two separate string classes are necessary to > accomplish it. I see nothing here that can't be accomplished by single > class with a parameter specifying its bound (or lack thereof). In fact, > std::basic_string in the C++ library indirectly supports that right > now: what we're reallly talking about is the memory allocation for the > string, and std::basic_string takes a parameter to specify the > allocator to use. All that's needed for a bounded_string is an > allocator that only ever allocates a block of the initially-specified > size. Bounded strings should be allocated on the stack (or inside the containing record or whatever) and should not incur the inefficiency of the indirection required for unboundedness. I'm not sure how to accomplish that with memory allocators (storage pools, in Ada terms). - Bob