Boost logo

Boost :

From: Carlo Wood (carlo_at_[hidden])
Date: 2006-05-29 19:49:45


On Mon, May 29, 2006 at 10:49:29PM +0200, Maarten Kronenburg wrote:
> Gerhard,
> Unfortunately I know nothing about threading.
> The integer class itself also has static variables,
> although not static integers.
> Will this then also be a threading problem?

I think that it would be bad idea to have static variables
for more than one reason. If they can be changed, then
that would be a problem for threading; but static variables
give rise to other problems as well, like the global-initialization
ordering fiasco. It would make it near impossible to use
those types in constructors in a safe way (because the objects
of those constructors COULD be used globally/statically too)
or use them in a singleton for example.

Imho, static members == huge problems, and should be avoided
at all costs in something as general as a library.

-- 
Carlo Wood <carlo_at_[hidden]>

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk