Jump to content

Generic swap: Difference between revisions

m
No edit summary
Line 67:
<lang ada>generic
type Swap_Type is private; -- Generic parameter
procedure Generic_Swap (Left : in out Swap_Type;, Right : in out Swap_Type);
 
procedure Generic_Swap (Left : in out Swap_Type;, Right : in out Swap_Type) is
Temp : constant Swap_Type := Left;
begin
Left := Right;
Line 82:
...
type T is ...
package T_Swap is new Generic_Swap (Swap_Type => T);
A, B : T;
...
T_Swap (A, B);
</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.