Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-09-14 14:36:14


Gennaro Prota wrote:
> On Thu, 14 Sep 2006 07:00:26 -0400, David Abrahams
> <dave_at_[hidden]> wrote:
>
>> Gennaro Prota <gennaro_prota_at_[hidden]> writes:
>>
>>> On Wed, 13 Sep 2006 22:00:09 +0200, Thorsten Ottosen
>>> <thorsten.ottosen_at_[hidden]> wrote:
>>>
>>>> What is the problem with an unnamed namespace in a header anyway?
>>>> Is it illegal according to the standard?
>>>
>>> Thorsten, this is not addressed to you, but I find shameful that so
>>> many boosters don't know this C++ 101.
>>
>> Now, now, Genny. I don't recall anyone ever talking about the
>> problem until I raised it a year or two ago.
>
> And here's the ego I was talking about. You may feel like the first
> man who brought the light on all us, but that light is common advice
> for any comp.lang.c++.moderated regular.

Not quite... the general advice against putting unnamed namespaces in
headers is one thing, explaining how the constant variable (unnamed)::_1
technically causes ODR violations is another.

In practice, Bind is getting away with this kind of a technical ODR
violation on every supported compiler.

But my question wasn't about ODR violations or egos. I asked what is the
proper course of action for a library developer whose library has been
flagged by the report. And it seems that nobody knows. I can remove the
unnamed namespace (at some cost) but this is a potentially destabilizing
change and not suited for 1.34, against which the report is being run.


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