
On Sun, 16 Jul 2006 01:16:10 -0400, "Sean Huang" <huangsean@hotmail.com> wrote:
Interestingly, I notice that boost::none is defined in an unnamed namespace.
That really surprised me. As a rule of thumb unnamed namespaces shouldn't be used in headers. In the rare cases where a good reason exists for doing the contrary, that should be adequately commented.
Since boost::none is const and thus has internal linkage so I removed the unnamed namespace and everything started working again. So my questions is what purpose the unnamed namespace serves? Can it be removed in light of this problem with precompiled headers?
If there are good reasons for having it, it should be removed regardless of the precompiled header problem. An unnamed namespace has a name which is unique to its translation unit, not source file. I'm also surprised that both none.hpp and none_t.hpp are in the boost root dir. Do they have any general usage that justifies that? (I think I was guilty of a similar sin with non_type.hpp and I'd be happy to move it) -- [ Gennaro Prota, C++ developer for hire ] [ resume: available on request ]