![]() ![]() If variables are typed in the given language, it is permissible that the two variables be constrained to having a mutually compatible type, such that each is permitted to hold the value previously stored in the other without a type violation. If your solution language is statically typed please describe the way your language provides genericity. 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. You are encouraged to solve this task according to the task description, using any language you may know.
0 Comments
Leave a Reply. |