CS 1337 Lecture 17: 2018-04-02 Templates Pt1
Document Summary
When our code calls a function template, the compiler automatically generates. A pattern for a function that can work with many data types. When we write a function template, we leave out the exact data types and. // description : hello world in c++, ansi-style. * can have a function of the same name as long as it has different parameters. * function templates instead we use place holders code for the specific data type we"re. * all the data types in the template prefix must be used in the template definition. * function call must pass parameters for all the data types specified in the prefix. * like regular functions, function templates must be defined before they are called. * no actual code is generated from the function template. * a template does not use any memory. * instead, when a template is called, the compiler generates code for those particular type(s)