|
|
Darren New <dne### [at] sanrrcom> wrote:
> OK, that would be my second statement, then. The template is actually
> getting recompiled down to object code each time you instantiate it,
> even if it's an "export" template.
But it's compiled only once even if the same template function is used
with a given type at several places in the program. (Without the export
template mechanism the function would be compiled every time it's used.)
And, as I said, I can imagine that compilers could implement optimizations
where they cache compiled export templates. IOW, if you compile your project
for the first time, the template code gets compiled, but if you recompile
the project a second time, the already-compiled template code is used.
(But I doubt any C++ compiler so far uses this kind of optimization.)
--
- Warp
Post a reply to this message
|
|