[Insight-developers] Explicit instantiation

William A. Hoffman billlist at nycap.rr.com
Fri Apr 21 09:34:15 EDT 2006


At 09:09 AM 4/21/2006, Miller, James V (GE, Research) wrote:
>Also, it appears that we are using a one-file-per-instantiation model. Is this the best approach? Or would it be better to lump a number of related instantiations into one file (as long as it wouldn't get too big to compile)?

I will let Brad answer the rest, but I can take a try at this one.
With manual template instantiation lumping them into one file never
really works that well.  It causes code bloat with static links, and
often times unnecessary dependencies between unrelated classes.  You really
have to think about each instantiation as a new class.  We do not put
more than one class into a single file for the same reasons.  The linker
granularity is the object file, and if you stuff more than one class into
a single object file, the are stuck together forever.  

-Bill





More information about the Insight-developers mailing list