Generics-based programming

Programming with generics lets you write flexible code that works with any type and that follows the requirements you settle at compile time. Let's first see how generics can be applied to functions and then to classes and structures.