Boost logo

Boost :

Subject: Re: [boost] [any] new version
From: Julien Nitard (julien.nitard_at_[hidden])
Date: 2011-09-01 01:14:30

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,


Boost list run by bdawes at, gregod at, cpdaniel at, john at