|
Boost : |
From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2007-06-12 14:31:36
"Bryan Ewbank" <ewbank_at_[hidden]> wrote
> To say this another way, there is never an unnamed namespace; any
> namespace
> for which you do not specify a name is effectively given a randomly
> generated name. That means each time you include a header file with an
> "unnamed" namespace, you are creating a separate instance of everything in
> that namespace.
Which by itself is not a problem, unless it is used in the definition of yet
another class, defined in a header and _not_ inside unnamed namespace. This
another class, when #included from different TUs, becomes defined
differently in different TUs, hence ODR violation.
Regards,
Arkadiy
>
> On 6/10/07, Arkadiy Vertleyb <vertleyb_at_[hidden]> wrote:
>>
>> "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote
>>
>> > Are there any problems with unnamed namespace usage within Boost.Test?
>>
>> Using unnamed namespace inside a header represents a potential ODR
>> violation. See if you have this kind of usage.
>>
>> Regards,
>> Arkadiy
>>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk