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,1ed4b5bd91d02f0b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!t54g2000hsg.googlegroups.com!not-for-mail From: Graham Newsgroups: comp.lang.ada Subject: Re: using an Ada.Container as a private type Date: Fri, 4 Apr 2008 01:02:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <42c84166-c7e4-42e0-b1bf-2104d3bb0cda@e10g2000prf.googlegroups.com> <5c9b6d27-d54a-43ae-aba8-8ef4b522fbc5@e10g2000prf.googlegroups.com> NNTP-Posting-Host: 86.161.178.35 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207296151 1501 127.0.0.1 (4 Apr 2008 08:02:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 4 Apr 2008 08:02:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t54g2000hsg.googlegroups.com; posting-host=86.161.178.35; posting-account=04rmagoAAABZ9PN7u3MdbKIs6DPG57E- User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20061201 Firefox/2.0.0.13 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20794 Date: 2008-04-04T01:02:30-07:00 List-Id: On Apr 3, 9:41 pm, Maciej Sobczak wrote: > On 3 Kwi, 17:29, Graham wrote: > > > package Payment_Stream_Package is new Ada.Containers.Ordered_Maps( > > Element_Type => Money, > > Key_Type => Positive ); > > > type Payment_Stream is new Payment_Stream_Package.Map; > > Instead of a solution, I have a question: > > Why do you derive from Map? Which operations of Map do you plan to > override? > > Do you ever plan to pass Payment_Stream where > Payment_Stream_Package.Map'Class is expected? What effect would you > like to achieved this way? > > Why derivation and not composition? > > -- > Maciej Sobczak *www.msobczak.com*www.inspirel.com Good question. The intention was not to derive from Map at all: I simply wanted to keep the fact that it was implemented as a Map private. Is there a better way of doing that, or is keeping it private overdesign? Graham