D
Dave
Hello all,
Consider this function template definition:
template<typename T>
void foo(T) {}
If foo is never called, this template will never be instantiated.
Now consider this explicit instantiation of foo:
template
void foo<int>(int);
Code will be generated for this explicit instantiation whether it is ever
called or not.
Now, let's assume the explicit instantiation above never occurred and
consider instead an explicit specialization:
template<>
void foo<int>(int) {}
My question is: Will code be generated for this explicit specialization if
it is never called?
Thanks,
Dave
Consider this function template definition:
template<typename T>
void foo(T) {}
If foo is never called, this template will never be instantiated.
Now consider this explicit instantiation of foo:
template
void foo<int>(int);
Code will be generated for this explicit instantiation whether it is ever
called or not.
Now, let's assume the explicit instantiation above never occurred and
consider instead an explicit specialization:
template<>
void foo<int>(int) {}
My question is: Will code be generated for this explicit specialization if
it is never called?
Thanks,
Dave