Re: limited types (Was: Records that could be arrays)
- From: "Randy Brukardt" <randy@xxxxxxxxxxxxxx>
- Date: Sat, 25 Feb 2006 19:01:06 -0600
"Matthew Heaney" <matthewjheaney@xxxxxxxxxxxxx> wrote in message
news:ufym7tr6w.fsf@xxxxxxxxxxxxxxxx
....
You could pass in a copy constructor if this were an unbounded form (Ithik),
something like:know
procedure Insert
(C : in out CT;
E : in ET;
Copy : not null access function (E : ET) return ET)
is
Node : Node_Access :=
new Node_Type'(Element => Copy (E), others => <>);
begin
...
end;
Wouldn't that work? I don't have a compiler that can do that yet, but I
this would be legal:
Yes, that's legal (a limited function can be an aggregate element, and an
aggregate can be used to initial an object). The compiler is required to
build the object in place for such aggregates and functions; no temporaries
are allowed.
Randy.
.
- References:
- limited types (Was: Records that could be arrays)
- From: Thierry Bernier
- Re: limited types (Was: Records that could be arrays)
- From: Randy Brukardt
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- limited types (Was: Records that could be arrays)
- Prev by Date: Complete Rationale for Ada 2005 available on AdaIC
- Next by Date: Re: Records that could be arrays
- Previous by thread: Re: limited types (Was: Records that could be arrays)
- Next by thread: Re: limited types (Was: Records that could be arrays)
- Index(es):
Relevant Pages
|
|