I might wish for tool chain vendors to change their name mangling schemes in ways that break link compatibility every time they change the inline implementation in their header files in ways that break binary compatibility, but wishing might be tantamount to backsliding. I'm in Accepting mode.
With respect to the specific problem I talked about last time, I've decided to change my approach. I've discovered that I can get rid of the Visual C++ warnings if I never refer to template instantiations by value in DLL-exported classes, only by pointer or reference. (A combination of pure virtual classes and the PImpl pattern -- depending on whether I need to create automatic objects of a particular type -- help here.) I'm also getting rid of the explicit template instantiations altogether. Let the compiler instantiate those templates whenever, wherever, and as many times as it wants. If the language and its runtime can't save me or my users from ourselves or each other, so be it.
No comments:
Post a Comment