
23 Mar
2007
23 Mar
'07
12:33 a.m.
Anthony Williams wrote:
If you define a C API, and people stick to it, then it doesn't matter what you use internally: you can ship a .LIB file or .DLL with just that API exposed, and Bob's your uncle. If you want to use a templated API, you just can. You can even provide the necessary specializations of the templates as part of the library, and declare them as explicit specializations in the headers.
Case A, call_once implemented in the header. You ship an improved call_once.hpp. User program needs recompilation to take advantage of the improvement. Case B, call_once a thin wrapper over a C API, as in N2178. You ship an improved .lib/.dll. User program doesn't need recompilation (lib) or relink (dll).