3 with Tagged3_Pkg
; use Tagged3_Pkg
;
6 type Ref
is tagged private;
8 procedure Set
(Self
: in out Ref
'Class; Data
: Parent
'Class);
10 type Reference_Type
(Element
: access Parent
'Class)
11 is limited null record with Implicit_Dereference
=> Element
;
13 function Get
(Self
: Ref
'Class) return Reference_Type
;
16 type Element_Access
is access all Parent
'Class;
17 type Ref
is tagged record
18 Data
: Element_Access
;
23 procedure Set
(Self
: in out Ref
'Class; Data
: Parent
'Class) is
25 Self
.Data
:= new Parent
'Class'(Data);
28 function Get (Self : Ref'Class) return Reference_Type is
30 return Reference_Type'(Element
=> Self
.Data
);
38 Prim1
(RC
.Get
.Element
); -- Test
39 if not Tagged3_Pkg
.Child_Prim1_Called
then