[bind, regex] strange MSVC 7.1 compiler effect: Members of unnamed namespace are put in boost::re_detail when stdafx.h includes bind.hpp and regex.hpp
Hi there,
I have a strange compiler effect with Microsoft Visual Studio.NET 2003 and boost 1.33.1 in a project that uses bind and regex. All Symbols defined in an unnamed namespace are part of the namespace boost::re_detail::'anonymous-namespace'.
The effect occurres when I use precompiled headers and bind.hpp is included before regex.hpp.
This is my stdafx.h which is used to generate the precompiled header:
#pragma once
#include
Stefan Felkel wrote:
Hi there,
I have a strange compiler effect with Microsoft Visual Studio.NET 2003 and boost 1.33.1 in a project that uses bind and regex. All Symbols defined in an unnamed namespace are part of the namespace boost::re_detail::'anonymous-namespace'. The effect occurres when I use precompiled headers and bind.hpp is included before regex.hpp.
This is my stdafx.h which is used to generate the precompiled header:
#pragma once
#include
#include This is the main source file:
#include "stdafx.h" #include "boost/current_function.hpp"
namespace { void foo( void ) { printf( "%s\n", BOOST_CURRENT_FUNCTION ); } }
int main( int argc, char * argv[] ) { foo(); return 1; }
The program generates this output:
void __cdecl boost::re_detail::`anonymous-namespace'::foo(void)
instead of the expected output:
void __cdecl `anonymous-namespace'::foo(void)
When I change the include order in stdafx.h so that regex.hpp is included before bind.hpp the output is as expected. Has someone else came across such a problem? Is it a compiler bug?
Weird indeed, I don't believe it's our problem as such: except that both regex and bind use unnamed namespaces. Looks like the poor compiler is getting confused :-( John.
participants (2)
-
John Maddock
-
Stefan Felkel