Boost logo

Boost :

From: Christopher Lux (christopherlux_at_[hidden])
Date: 2008-04-14 10:36:28

we discovered a compiler bug using Visual C++ 8.0 (SP1). This bug makes
boost namespace items visible in the global namespace and so makes boost
libraries conflict with other libraries. The following example [1]
displays how this bug can make namespace items public. When moving the
exception class definition outside the namespace everything works as

We encountered this problem when using boost::integer in combination
with boost::serialization. After including the file shared_count_132.hpp
all boost::integer types are public and conflict with other libraries.
This leads to the problem shown in the example [0]. The uint32_t type is
publicly visible.

To our knowledge this bug is present in Visual C++ 8.0 (SP1). Visual C++
9.0 does not show this bug anymore.

#include <boost/cstdint.hpp>
#include <boost\serialization\detail\shared_count_132.hpp>

int main(int argc, char **argv)
     uint32_t hallo; // this should not be possible

#include <stdexcept>

namespace fu {
     typedef unsigned int uint32_fu;
} // namespace fu

namespace fu2 {

     using namespace fu;
     class bad_weak_ptr: public std::exception

     namespace detail{

         class sp_counted_base
             void add_ref_lock()
                 throw bad_weak_ptr();

int main(int argc, char **argv)
     uint32_fu hallo;


Christopher Lux |
                 | Bauhaus-Universität Weimar
                 | Faculty of Media - Virtual Reality Systems Group

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