Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Generic-swap/Ada/generic-swap-1.ada
Normal file
10
Task/Generic-swap/Ada/generic-swap-1.ada
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
generic
|
||||
type Swap_Type is private; -- Generic parameter
|
||||
procedure Generic_Swap (Left, Right : in out Swap_Type);
|
||||
|
||||
procedure Generic_Swap (Left, Right : in out Swap_Type) is
|
||||
Temp : constant Swap_Type := Left;
|
||||
begin
|
||||
Left := Right;
|
||||
Right := Temp;
|
||||
end Generic_Swap;
|
||||
7
Task/Generic-swap/Ada/generic-swap-2.ada
Normal file
7
Task/Generic-swap/Ada/generic-swap-2.ada
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
with Generic_Swap;
|
||||
...
|
||||
type T is ...
|
||||
procedure T_Swap is new Generic_Swap (Swap_Type => T);
|
||||
A, B : T;
|
||||
...
|
||||
T_Swap (A, B);
|
||||
Loading…
Add table
Add a link
Reference in a new issue