I have an inherited VC++ program that I am trying to port to Microsoft
Visual Studio 2003 (it compiles and runs fine in Visual Studio 6.0). I've
downloaded the 1.30.0 release, and the following problem still occurs.
The (exceptionally) verbose error message I receive from the compiler is:
error C2664: 'bool
boost::regex_match,Allocator,char
,boost::regex_traits<charT>,std::allocator<_Ty>>(const
std::basic_string<_Elem,_Traits,_Ax>
&,boost::match_results &,const
boost::reg_expression &,unsigned int)' :
cannot convert parameter 2 from 'boost::cmatch' to
'boost::match_results &'
with
[
_Ty=char,
Allocator=std::allocator<char>,
charT=char,
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>,
iterator=std::basic_string
::const_iterator,
traits=boost::regex_traits<char>
]
and
[
iterator=std::basic_string
::const_iterator,
Allocator=std::allocator<char>
]
The Code fragment I get the error on is:
// lpcszDeviceName is a function parameter defined as LPCTSTR
lpcszDeviceName
TSTRING strName = lpcszDeviceName;
boost::regex expr("IW\\s+[A-Za-z]+\\s+([0-9]+)");
boost::cmatch matches;
if (boost::regex_match(strName, matches, expr))
{
...
}
with the error message pointing to:
if (boost::regex_match(strName, matches, expr))
This may be related to a Microsoft note:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html
/vclrfsomeiteratorsarenolongersameaspointers.asp
but, then again, it may not.
Anyone have any suggestions? I am well out of my depth in trying to
understand the incantations here, and have a dozen spots in the code where
this occurs.
TIA,
/frank