Re: limited types (Was: Records that could be arrays)



"Matthew Heaney" <matthewjheaney@xxxxxxxxxxxxx> wrote in message
news:ufym7tr6w.fsf@xxxxxxxxxxxxxxxx
....
You could pass in a copy constructor if this were an unbounded form (I
thik),
something like:

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
know
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.


.



Relevant Pages

  • Re: Compiler and How It Handles Scope
    ... compiler allocates space for is unrelated to the name, ... but is memory usage really a problem ... > in that aggregate data area. ... >> relative addresses in that aggregate data area. ...
    (microsoft.public.vb.winapi)
  • Re: One-element constant array
    ... enumeration type, was expected. ... I think the problem is that if your aggregate contains only ... the compiler thinks its parentheses are just ... DOULOS - Developing Design Know-how ...
    (comp.lang.vhdl)
  • How to return an empty aggregate
    ... type Concrete is new Middle with null record; ... I would like to return the emptyaggregate instead of the dummy ... results in segmentation fault on my system (compiler version as ... understand the language corners involved with the aggregate. ...
    (comp.lang.ada)
  • Re: string class question..
    ... > non-aggregate data member are not aggregate ... The compiler is demonstrating it's stupidity. ...
    (comp.lang.cpp)