[Spirit] puts namespace std into the global scope

It seems that the header boost/spirit.hpp puts
the entire namespace std into the global scope.
That is not very nice!
--- Example 1 --------
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include

Johan Råde wrote:
It seems that the header boost/spirit.hpp puts the entire namespace std into the global scope. That is not very nice!
--- Example 1 --------
#include <string> #include <sstream> #include <fstream> #include <vector> #include
void f() { string s; istringstream iss; ofstream ofs; vector<int> v; }
----------------------
Example 1 should not compile (undefined symbols), but does compile. If the line #include
is removed, then Example 1 does not compile. --- Example 2 --------
#include
#include #include
using boost::filesystem::path; using boost::filesystem::ifstream;
void g() { path p; ifstream ifs(p); }
----------------------
Example 2 should compile but does not. The compiler complains that the symbol ifstream is ambigous. If the line #include
is removed, then Example 2 does compile. I´m using Boost 1.33.1 and MSVC 7.1 on a Windows XP computer.
IIRC, that comes from VC++ fatal bug about "using directive", and was already fixed under RC_1_34. -- Shunsuke Sogame

Shunsuke Sogame wrote:
Johan Råde wrote:
It seems that the header boost/spirit.hpp puts the entire namespace std into the global scope. That is not very nice!
[...]
IIRC, that comes from VC++ fatal bug about "using directive", and was already fixed under RC_1_34.
Spirit will never do such an evil thing, that's for sure ;) Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

Joel de Guzman wrote:
Shunsuke Sogame wrote:
Johan Råde wrote:
It seems that the header boost/spirit.hpp puts the entire namespace std into the global scope. That is not very nice!
[...]
IIRC, that comes from VC++ fatal bug about "using directive", and was already fixed under RC_1_34.
Spirit will never do such an evil thing, that's for sure ;)
I mean that is the bug of VC++. I've found the log: http://sourceforge.net/mailarchive/message.php?msg_id=14648776 I think boosters no longer use using-directive anywhere because of this bug :-( -- Shunsuke Sogame
participants (3)
-
Joel de Guzman
-
Johan Råde
-
Shunsuke Sogame