On Tue, Oct 11, 2011 at 8:13 AM, Ranadheer
The only advantage of using explicit template instantiation is that it seems like it would result in least compilation time and small object sizes (http://download.oracle.com/docs/cd/E19205-01/819-5267/bkagp/index.html). As a note, I don't know how good this is from relying on compiler to instantiate.
As I said, I also understand that it doesn't make sense to instantiate all internal boost templates explicitly but we are planning to use this library in a legacy binary which is using "--instances=explicit" option. So, just wanted to confirm before I remove "--instances=explicit" and resolve the other issues which might be resulting of this removal.
The two justifiable reasons for explicit instantiation I have encountered in the past 15+ years of C++ development are: 1. a library uses templates in its implementation and needs to provide instantiations that the compiler wouldn't implicitly determine but that, as a provider of the library, you know will be required by code linking the library 2. the implicit instantiation engine sucks Fortunately, #2 isn't often the case any more. And #1 doesn't really justify demanding that the compiler ONLY do explicit instantiation, because it's entirely okay (in my experience) to explicitly instantiate templates as one would do in #1 and still let the compiler do implicit instantiation for the general case.