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,64b29dfa2220a59f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!news.astraweb.com!newsrouter-eu.astraweb.com!proxad.net!feeder1-2.proxad.net!fdn.fr!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <46A85961.4020603@obry.net> Date: Thu, 26 Jul 2007 10:20:49 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: mailbox@dmitry-kazakov.de Subject: Re: Reserve_Capacity for Unbounded_String? References: <1185134043.892012.217560@n2g2000hse.googlegroups.com> <1185203238.701948.307410@m37g2000prh.googlegroups.com> <1185395844.104043.194340@o61g2000hsh.googlegroups.com> <46a7c85b$0$3827$9b4e6d93@newsspool4.arcor-online.net> <1185431043.649372.223760@r34g2000hsd.googlegroups.com> <10fo5wx5wokvq$.1e0lhbpujtpma$.dlg@40tude.net> In-Reply-To: <10fo5wx5wokvq$.1e0lhbpujtpma$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 26 Jul 2007 10:21:04 CEST NNTP-Posting-Host: 81.249.127.84 X-Trace: 1185438064 news.orange.fr 25951 81.249.127.84:3388 X-Complaints-To: abuse@orange.fr Xref: g2news2.google.com comp.lang.ada:1194 Date: 2007-07-26T10:21:04+02:00 List-Id: Dmitry A. Kazakov a �crit : > Perhaps, one could introduce something like that for Unbounded_String: > > X : Unbounded_String := ...; > for X'Initial_Size use 1024*8; -- 1K at least > for X'Increment_Factor use 1.5; -- Multiply by 1.5 upon expanding I really don't see the need for rep attributes here as Unbounded_String is not intrinsic. So Initial_Size (X, 1024*8); Increment_Factor (X, 1.5); looks more appropriate in this case. And mind Randy I do not expect to have to use such artifices in my code. I do expect a compiler to deliver the "expected" best implementation for every supported features. I'm not in the embedded domain and frankly all those low-level details are distractions, I prefer to concentrate on my application and not fighting the compiler :) The main point for Ada to me is the high level abstraction. Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595