Last updated
Last updated
Function generics are special functions that can operate with generic types. This allows us to create a function template whose functionality can be adapted to multiple types or classes without repeating the entire code for each type.
A generic parameter is a special parameter that can be used to pass a type as an argument: just like regular function parameters can be used to pass values to a function, template parameters allow to pass also types to a function. These function templates can use these parameters like any other regular type.