Does template class/function specialization improves compilation/linker speed?
Posted
by
Stormenet
on Stack Overflow
See other posts from Stack Overflow
or by Stormenet
Published on 2011-01-12T10:43:49Z
Indexed on
2011/01/12
11:53 UTC
Read the original article
Hit count: 180
Suppose the following template class is heavily used in a project with mostly int as typename and linker speed is noticeably slower since the introduction of this class.
template <typename T>
class MyClass
{
void Print()
{
std::cout << m_tValue << std::endl;;
}
T m_tValue;
}
Will defining a class specialization benefit compilation speed? eg.
void MyClass<int>::Print()
{
std::cout << m_tValue << std::endl;
}
© Stack Overflow or respective owner