
Pavel Antokolsky aka Zigmar wrote:
On 5/7/05, Jason Hise <chaos@ezequal.com> wrote:
What if I were to move the implementation details that require being only defined once to source files, and by default have those source files included by the headers. Then if some macro is specified, I could omit these inclusions and instead link to a separate dll that is a build of these files. Would this solve the problem?
I think it would solve the problem on windows. Although it must be stated clear enough in documentation, otherwise the user may run into a very unpleasant problems when porting from *nix where it worked with header-only implementation to windows - the code will compile and run, but not behave as expected - he will get multiple instances of singletons. Maybe even dll implementation should be even default on Windows - till user have not configured it differently.
OK, I will add this to the singleton to-do list. BTW, which macro should I check to see if the target operating system is windows? -Jason