possible conflict with new mpl

Hi, After merging the new MPL version, an error popped out in vc7 tests of string_algo lib. http://tinyurl.com/3t6zc It seems that std::distance is conflicting with something else. I'm using both "using namespace std;" and "using namespace boost;" in the tests. This problem do not appear with other compilers. I can possibly fix it with the explicit qualification, but it may just hide some other problem. Any suggestions? Regards, Pavol

Pavol Droba writes:
Hi,
After merging the new MPL version, an error popped out in vc7 tests of string_algo lib.
It seems that std::distance is conflicting with something else. I'm using both "using namespace std;" and "using namespace boost;" in the tests.
Pavol, I don't see anything MPL-related in the output from the link above: find_test.cpp ..\libs\algorithm\string\test\find_test.cpp(52) : error C2275: 'std::basic_string<_Elem,_Traits,_Ax>::const_iterator' : illegal use of this type as an expression with [ _Elem=char, _Traits=std::char_traits<char>, _Ax=std::allocator<char> ] ..\libs\algorithm\string\test\find_test.cpp(57) : error C2275: 'std::basic_string<_Elem,_Traits,_Ax>::const_iterator' : illegal use of this type as an expression with [ _Elem=char, _Traits=std::char_traits<char>, _Ax=std::allocator<char> ] [...] Did the errors you've talked about go away, or am I missing something? -- Aleksey Gurtovoy MetaCommunications Engineering

On Tue, Sep 07, 2004 at 07:20:12AM -0500, Aleksey Gurtovoy wrote:
Pavol Droba writes:
Hi,
After merging the new MPL version, an error popped out in vc7 tests of string_algo lib.
It seems that std::distance is conflicting with something else. I'm using both "using namespace std;" and "using namespace boost;" in the tests.
Pavol,
I don't see anything MPL-related in the output from the link above:
find_test.cpp ..\libs\algorithm\string\test\find_test.cpp(52) : error C2275: 'std::basic_string<_Elem,_Traits,_Ax>::const_iterator' : illegal use of this type as an expression with [ _Elem=char, _Traits=std::char_traits<char>, _Ax=std::allocator<char> ] ..\libs\algorithm\string\test\find_test.cpp(57) : error C2275: 'std::basic_string<_Elem,_Traits,_Ax>::const_iterator' : illegal use of this type as an expression with [ _Elem=char, _Traits=std::char_traits<char>, _Ax=std::allocator<char> ]
[...]
Did the errors you've talked about go away, or am I missing something?
I might be wrong, but this error was not there before the change of the mpl. If you have a look into the code, the errors are shown at std::distance<> with explicit type specification. I assumed, that there migh be a conflict with mpl::distance. I have checked in a version with explicit std:: qualification. If it will help, it will confirm, that there is some conflict there. Regards, Pavol

Pavol Droba wrote:
I might be wrong, but this error was not there before the change of the mpl. If you have a look into the code, the errors are shown at std::distance<> with explicit type specification. I assumed, that there migh be a conflict with mpl::distance.
This is a compiler bug. Once a class template named distance<> has been introduced at any context, the VC6/7 parser interprets distance< as referring to a class template. This is part of the "implicit typename" heuristic.

On Tue, Sep 07, 2004 at 04:31:00PM +0300, Peter Dimov wrote:
Pavol Droba wrote:
I might be wrong, but this error was not there before the change of the mpl. If you have a look into the code, the errors are shown at std::distance<> with explicit type specification. I assumed, that there migh be a conflict with mpl::distance.
This is a compiler bug. Once a class template named distance<> has been introduced at any context, the VC6/7 parser interprets distance< as referring to a class template. This is part of the "implicit typename" heuristic.
I see, thanks for explanation. So then mpl is not buggy. Is my workaround correct? Regards, Pavol
participants (3)
-
Aleksey Gurtovoy
-
Pavol Droba
-
Peter Dimov