Boost logo

Boost :

From: Joshua Storck (josh_at_[hidden])
Date: 2003-11-05 14:27:27

I am trying to compile boost with STLPort on VC6. The cpp_regex_traits.cpp file will not compile because of the BOOST_REGEX_STD definition which is the following:

#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
   using namespace std;
# define BOOST_REGEX_STD std::

The problem has to do with the fact that the "using namespace std" declaration is declared within function scope, but the BOOST_REGEX_STD is later used in another function that is missing the "using namespace std" declaration. I think that VC6 is following the standard here, in so much that "using namespace" declarations follow usual C++ scoping rules.

Here is an example snippet that does not use the regex lib nor STLPort, but exhibits the same problem:

void withUsing () {
        using namespace std;

        USING_NAMESPACE_STD string;

void withoutUsing () {

        USING_NAMESPACE_STD string; // Error: string is not in the global namespace




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