Summary
This episode explores C++14's variable templates, a feature that Jason admits he didn't fully appreciate until years after its introduction. He demonstrates how variable templates work by creating a templated pi constant with different numeric type specializations. Jason then shows more powerful applications including specialization patterns similar to class templates, implementing type traits like is_same, and using variable templates to generate typed lambda functions.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[temp.arg.template]60% match -
[temp.dep.type]57% match -
[temp.arg.nontype]51% match -
[temp.expl.spec]49% match -
[temp.inst]49% match -
[temp.fct.spec]49% match -
[temp.spec]49% match -
[meta.help]48% match