
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