Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2006-04-06 12:08:30


Hi all,

The typeof library defines some templates in the unnamed namespace. This
was done to avoid ODR violations in certain contexts (although it introduces
them in other contexts). The unnamed namespace used now is:

boost::type_of::<unnamed>

It turnes out MSVC 7.1 and 8.0 cannot handle this kind of namespace
correctly in conjunction with precompiled headers. Specifically, if a
template is defined inside such a namespace in the precompiled header, it
cannot be specialized outside this precompiled header (for typeof this means
types cannot be registered outside pch).

The problem can be worked around by using a different kind of unnamed
namespace, like, for example:

<unnamed>::boost_typeof

(<unnamed>::boost::type_of introduces ambiguity in some contexts)

This kind of unnamed namespace can be handled correctly by both MS
compilers, with respect to pch, but I don't believe it satisfies the Boost
naming convention. OTOH, if no other solution is found, this is the only
way we can achieve typeof compliance with pch, while still staying in the
unnamed namespace.

Thoughts?

Regards,
Arkadiy


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