9. Function patterns
Introduced with version 3, the notion of function templates enables the definition of what are often referred to as "generic functions". More precisely, using a single definition with "type parameters", a whole family of functions is described; the compiler then "builds" (or "instantiates") the function(s) required for the application (these instances are often referred to as "template functions").
We specify the (mute) type parameters, preceding each with the (relatively arbitrary) word class in template form . The function definition is classic, except for the fact that mute type parameters can be used anywhere an effective type is permitted.
You do not have access to this resource.
Exclusive to subscribers. 97% yet to be discovered!
Already subscribed?
Log in!
Ongoing reading
Function patterns