Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Template argument deduction?

Definition 4.2 University Computer Science — Year 2 · Capítulo 4 — Templates and Generic Programming

At a call of a function template with no explicit arguments, the compiler finds the template arguments by template argument deduction: it matches each parameter type against the type of the corresponding argument. Each template parameter must be deduced to a single type from all the arguments in which it appears; a parameter that appears in no function parameter (only in the return type, say) cannot be deduced, and must be given explicitly, as in larger<double>(3, 7.5).

Leer en el capítulo →