Mandatory template arguments

Consider the following function declaration:

Though the declaration may seem rather involved, the actual application of this function is quite simple:

The compiler knows how to create an instance of  print_as_csv by a mechanism called template argument deduction. It works only for functions, because the compiler needs arguments to deduce the types from. There are, however, template functions for which not all template arguments can be deduced by the compiler.

Continue reading “Mandatory template arguments”