Generic swap: Difference between revisions

Content deleted Content added
Petelomax (talk | contribs)
m added a ;Task: (bold) header, added other whitespace to the task's preamble.
Line 1: Line 1:
{{task|Basic language learning}}
{{task|Basic language learning}}


;Task:
The task is to write a generic swap function or operator which exchanges the values of two variables (or, more generally, any two storage places that can be assigned), regardless of their types.
Write a generic swap function or operator which exchanges the values of two variables (or, more generally, any two storage places that can be assigned), regardless of their types.

If your solution language is statically typed please describe the way your language provides genericity.
If your solution language is statically typed please describe the way your language provides genericity.