
1 Sep
2011
1 Sep
'11
5:14 a.m.
Hi all,
I do not think you can initialize a class static in a header. If you include any.hpp in more than one cpp you will have the same static been initialized more than once.
Out of curiosity, would a static member function with a static variable solve that kind of issue ? (Let's forget potential threading issues mentioned in the Singularity discussion). If yes, by what magic can the compiler (or the linker?) solve the unicity of the static member function ? Can't it (the magic ;) be applied to a static member ? Thanks for your insight, Julien