boost regex 1.32/VC7.1 compile problem
I am trying to move my code from vc6.0 to vc71. Here is the part of
code using boost regex:
boost::wregex ee(L"[E|e],(\\w+),(.+)$");
boost::wcmatch mr;
TString value=L"some char";
if (boost::regex_match(value, mr, ee))
{
...
}
Those code compiled with UNICODE and was ok on vc6.0. But when I
compile with VC71, it gives me error c2664:
============
d:\s\AEM\AEM6.0\source\AEMCore\AEMRulesCfgReg.cpp(176): error C2664:
'bool boost::regex_match
Please try to use "wsmatch" instead of "wcmatch."
It will work well.
But I don't know why such a error occurs...
frank fu
I am trying to move my code from vc6.0 to vc71. Here is the part of code using boost regex:
boost::wregex ee(L"[E|e],(\\w+),(.+)$"); boost::wcmatch mr; TString value=L"some char"; if (boost::regex_match(value, mr, ee)) { ... }
Those code compiled with UNICODE and was ok on vc6.0. But when I compile with VC71, it gives me error c2664:
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- TAKAHASHI Daisuke d_takahashi@sannet.ne.jp -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
I found why such a error occurs.
According to your call "boost::regex_match(value, mr, ee)",
the type of the first parameter is wstring (not const wchar_t*),
and of the second is match_results
boost::wregex ee(L"[E|e],(\\w+),(.+)$"); boost::wcmatch mr; TString value=L"some char"; if (boost::regex_match(value, mr, ee)) { ... }
Those code compiled with UNICODE and was ok on vc6.0. But when I compile with VC71, it gives me error c2664:
With VC7.1 basic_string::const_iterator is no longer a pointer type, so wcmatch is the wrong typedef to use: use wsmatch instead (you should have been using it before, it's just that your code compiled "by accident" with VC6). John.
Thanks a lot!
On Wed, 2 Mar 2005 10:59:56 -0000, John Maddock
boost::wregex ee(L"[E|e],(\\w+),(.+)$"); boost::wcmatch mr; TString value=L"some char"; if (boost::regex_match(value, mr, ee)) { ... }
Those code compiled with UNICODE and was ok on vc6.0. But when I compile with VC71, it gives me error c2664:
With VC7.1 basic_string::const_iterator is no longer a pointer type, so wcmatch is the wrong typedef to use: use wsmatch instead (you should have been using it before, it's just that your code compiled "by accident" with VC6).
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
frank fu
-
John Maddock
-
TAKAHASHI Daisuke