-----Ursprüngliche Nachricht----- Von: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]Im Auftrag von John Maddock Gesendet: Mittwoch, 25. April 2007 11:38 An: boost-users@lists.boost.org Betreff: [SPAM] - Re: [Boost-users] [bind,regex] strange MSVC 7.1 compiler effect: Members ofunnamednamespace are put in boost::re_detail when stdafx.hincludesbind.hpp and regex.hpp - E-Mail-Adresse wurde in Betreff-Zeile gefunden.
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
Stefan Felkel wrote: 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.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I think you're right - Microsoft Visual Studio.NET 2005 doesn't have this problem. Stefan