comp.lang.ada
 help / color / mirror / Atom feed
From: b.mcguinness747@gmail.com
Subject: Re: How can I create an empty array of a generic type?
Date: Sat, 13 Jul 2019 14:02:29 -0700 (PDT)
Date: 2019-07-13T14:02:29-07:00	[thread overview]
Message-ID: <287024ef-def7-43fe-8bb5-94cae597ffa7@googlegroups.com> (raw)
In-Reply-To: <5f53e122-6b99-48ca-b6cc-4ae43c0a2221@googlegroups.com>

On Friday, July 12, 2019 at 11:36:02 PM UTC-4, b.mcgui...@gmail.com wrote:
> I have a generic package
> 
> 
> generic
>   type Element_Type is private;
>   type Key_Component_Type is private;
>   with function "<" (Left, Right : Key_Component_Type) return Boolean is <>;
>   with function "=" (Left, Right : Element_Type) return Boolean is <>;
> package Ternary_Trees is
> 
> ...
> 
> 
> private
> 
> ...
> 
>   Empty_Key  : constant Key_Type(1..0) := (others => Key_Component_Type'First);
> 
> ...
> 
> end Ternary_Trees;
> 
> 
> When I try to compile the package, I get an error message:
> 
> ternary_trees.ads:77:54: prefix for "First" attribute may not be private type
> 
> 
> How can I make this work?  I want to create an empty array so I can build up a key through concatenation as I descend recursively through a tree.
> 
> Thanks.
> 
> --- Brian McGuinness

Ok.  Thanks for the help

--- Brian McGuinness


  parent reply	other threads:[~2019-07-13 21:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13  3:36 How can I create an empty array of a generic type? b.mcguinness747
2019-07-13  4:11 ` Keith Thompson
2019-07-13  5:24   ` J-P. Rosen
2019-07-13 21:19     ` Keith Thompson
2019-07-14 11:09       ` reinert
2019-07-14 11:15     ` reinert
2019-07-14 11:27       ` Jeffrey R. Carter
2019-07-14 12:49       ` J-P. Rosen
2019-07-13 21:02 ` b.mcguinness747 [this message]
2019-07-14 16:41   ` bj.mooremr
2019-10-16  2:03     ` Andrew Shvets
2019-10-16  4:49       ` Egil H H
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox