Jump to content

C++ Language/Templates/TemplateParameters/DeducingTemplateParameters

From Wikibooks, open books for an open world

Traditionally, template object initialization needed to explicitly list types: std::pair<float,int> fiVar = std::pair<float,int>(1.1F,2);. Modern C++ compilers can automatically deduce those types: std::pair fiVar = std::pair(1.1F,2);.

Additional information about deducing template-parameters (includes interactive examples)