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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: Thomas Schmidt Newsgroups: comp.lang.ada Subject: Howto declare an Ada container with access to objects of a class hierachy Date: Thu, 13 Jun 2013 00:43:22 +0000 (UTC) Organization: albasani.net Message-ID: <78030778392775583.757462tc.schmidt-gmx.net@news1.open-news-network.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net GXZnTndf+nFiCHcNDhZeNa2vzUVntlN6MoN2zsyw1PzKfxVXH0XOR12kw5HwwOPXzvq3+DBBVrzVM+nveYoNIahba/hTSZxOfsrJLNnGqFUr4aF6F5bmCfN63pGQexoQ NNTP-Posting-Date: Thu, 13 Jun 2013 00:43:22 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="1VYmerPZ7AnWGER+utx0ob/BU7R8rV/bxSjyWKK+OHSP3EeBOYLu2UMllHuGi+iBku8TQCKJQ2cARtjAymWyJljVX0W4WRc/4p53I45BONSiqpmbsnPdePafhay+/TZg"; mail-complaints-to="abuse@albasani.net" User-Agent: NewsTap/4.0.1 (iPad) Cancel-Lock: sha1:Ia2iPjfwlGCbMF1xVyWO4HvSf5g= Xref: news.eternal-september.org comp.lang.ada:15737 Date: 2013-06-13T00:43:22+00:00 List-Id: Hi, Hoping this Is the right newsgroup for asking my question. I want to set up a hashed set of accesses (allocated from heap) to objects of a given class hierarchie (the top class may f.e. be called "Top"). I decided to use "Ada.Containers.Indefinite_Hashed_Sets". The hash method should be a primitive which may be overwritten by derived classes. I've declared Tops hash functions formal parameter as of type "access Top". How do I've to declare the sets Element_Type? I think if I use "Top'Access" it wouldn't fit the hash functions parameter type nor could I store objects of classes derived from "Top". Sorry, i'm just a beginner coming from C/C++. Thomas