Boost logo

Boost :

Subject: Re: [boost] Any interest in static plugins?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-11-30 08:56:47

Christian Schladetsch
> Rob Stewart wrote:
> > > The second issue is global scope pollution. Systems based on
> > > pre-main()
> > > initialisation are necessarily polluting the global namespace
> > > (you can hide
> > > the variables in a namespace, but they are still global). As
> >
> > That is nonsensical. How can a name in a namespace pollute
> > the global namespace? Perhaps you're trying to say that such
> > variables contribute to the global system state.
> Either or both my and the general terminology is lacking
> here. I don't know
> what the convention is for this, but to clarify: when I say
> 'global' I mean
> 'globally accessible, given matching declaration'. A variable
> in namespace *
> foo* can still be globally accessible, and remains traumatic
> when used in threaded applications.

I'm still not sure I understand your concern. Any namespace name, regardless of how it is nested, is "globally accessible" according to your definition. IOW, unless something is a non-static member of a class, it is always accessible by appropriately resolving the name with enclosing namespace and class names.

Why does that matter?

> > In the OP's environment, such statics may well be initialized before
> > main() runs, thus avoiding threading problems.
> >
> How could such a reprehensible act of creating a thread
> before main() runs avoid problems?

If the OP never creates threads until main(), and all statics are initialized before main() runs, then threading need not be an issue.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

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