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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.137.105 with SMTP id qh9mr6809327pab.30.1401202205658; Tue, 27 May 2014 07:50:05 -0700 (PDT) X-Received: by 10.50.128.108 with SMTP id nn12mr652719igb.1.1401202205555; Tue, 27 May 2014 07:50:05 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!hl10no6302065igb.0!news-out.google.com!qf4ni13600igc.0!nntp.google.com!c1no18314319igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 27 May 2014 07:50:04 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <43be22bf-904b-4fb4-b8a8-de5bcef03cbb@googlegroups.com> Subject: Re: Empty Bounded Containers From: Adam Beneschan Injection-Date: Tue, 27 May 2014 14:50:05 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:20065 Date: 2014-05-27T07:50:04-07:00 List-Id: On Thursday, May 22, 2014 6:05:19 PM UTC-7, Adam Beneschan wrote: I wrote: > The assignment operator in Ada, however, isn't set up to copy "values" in= a way that could change the representation, and it can't be overloaded the= way assignment can in C++. (This is actually a pretty cool feature of C++= , as long as your program works perfectly the first time and never needs to= be debugged or changed.) What might be useful, that I don't see in the Bo= unded_Vectors spec, is a function that would return a vector with the same = elements as an input parameter, but with a different capacity, e.g. >=20 > x : BC.Vector :=3D BC.Copy_And_Change_Capacity (BC.Empty_Vector, Capacity= =3D> 42); As Randy pointed out, there *is* already a function like that, Copy, that w= as added in Ada 2012. I don't know how I missed it. I looked through the = RM chapter on Containers.Vectors several times looking for this, and I stil= l couldn't find it. Time to stop putting off that appointment with my opht= halmologist, I guess. Sigh ... -- Adam