[Boost-bugs] [ boost-Bugs-891499 ] Compiling problems with MSVC++ 7

Bugs item #891499, was opened at 2004-02-05 21:07 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=891499&group_id=7586 Category: regex Group: None Status: Open Resolution: None Priority: 5 Submitted By: John Eddy (johneddy) Assigned to: John Maddock (johnmaddock) Summary: Compiling problems with MSVC++ 7 Initial Comment: hello VC++ will not compile the following code with the newest version of the regex library whereas it would with the previous version (g++ 3.2.2 does not have a problem with it). #include <locale> using namespace std; #include <boost/regex.hpp> int main (int argc, char **argv) { return 0; } The error produced is: regbase.hpp(120) : error C2955: 'std::collate' : use of class template requires template argument list The offending line of code is inside an enumeration declaration and looks like this: collate = ::boost::regbase::collate, It seems that VC++ cannot resolve the difference between the enumeration constant and the STL collate class. The same error can be produced with the following code (or anything like it). #include <vector> using namespace std; enum SomeEnum { vector = 0 }; int main (int argc, char **argv) { return 0; } I cannot think of a good way around this short of changing the collate constant name and re-building. The examples are boiled down and it would not be possible for me to change the order of the includes nor would it be easy remove the using delcaration. John ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=891499&group_id=7586 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Boost-bugs mailing list Boost-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/boost-bugs

VC++ will not compile the following code with the newest version of the regex library whereas it would with the previous version (g++ 3.2.2 does not have a problem with it).
It seems that VC++ cannot resolve the difference between the enumeration constant and the STL collate class. The same error can be produced with the following code (or anything like it).
#include <vector> using namespace std; enum SomeEnum { vector = 0 };
int main (int argc, char **argv) { return 0; }
I cannot think of a good way around this short of changing the collate constant name and re-building. The examples are boiled down and it would not be possible for me to change the order of the includes nor would it be easy remove the using delcaration.
I can't rename that constant: we've agreed the use of that name with the C++ committee as part of the regex standardisation proposal. You can get your code to compile either by: 1) switching to a conforming compiler (both gcc and VC.NET 2003 handle the code correctly). 2) moving the using namespace std; clause to after the include of the regex header. I realise that neither of these may be attractive options for an existing project, and I've tried to find a workaround, but so far to no avail. John.
participants (2)
-
John Maddock
-
SourceForge.net