Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

template built functions

jimdempseyatthecove
Honored Contributor III
218 Views

This is a nagging post.

Back in the 1990's, when a template would construct function based on the type and number of arguments. And when the same template would construct function based on the type and number of arguments in multiple source files, the Linker would note the function signature and .obj contents, and when the signature and contents matched would ignore the additional instantiations of that function. Only if the contents differed would an objection be raised.

Today, one must declare the functions with "static inline" which results in substantial code bloat. Omitting "static inline" results in duplicate symbol.

Can someone explain why the old way was abandoned?

Jim Dempsey

0 Kudos
0 Replies
Reply