Parametric polymorphism: Difference between revisions
Content added Content deleted
(Parametric polymorphism isn't generic programming, just as run-time polymorphism isn't OOP. Also, parametric polymorphism isn't restricted to types.) |
No edit summary |
||
Line 7: | Line 7: | ||
=={{header|Ada}}== |
=={{header|Ada}}== |
||
<ada> |
<lang ada> |
||
generic |
generic |
||
type Element_Type is private; |
type Element_Type is private; |
||
Line 22: | Line 22: | ||
end record; |
end record; |
||
end Container; |
end Container; |
||
</ |
</lang> |
||
<ada> |
<lang ada> |
||
package body Container is |
package body Container is |
||
procedure Replace_All(The_Tree : in out Tree; New_Value : Element_Type) is |
procedure Replace_All(The_Tree : in out Tree; New_Value : Element_Type) is |
||
Line 36: | Line 36: | ||
end Replace_All; |
end Replace_All; |
||
end Container; |
end Container; |
||
</ |
</lang> |
||
=={{header|C++}}== |
=={{header|C++}}== |