Boost logo

Boost Users :

From: Frank Schwab (yg-boost-users_at_[hidden])
Date: 2003-05-07 18:47:49


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<std::char_traits<char>,std::allocator<_Ty>,Allocator,char
,boost::regex_traits<charT>,std::allocator<_Ty>>(const
std::basic_string<_Elem,_Traits,_Ax>
&,boost::match_results<iterator,Allocator> &,const
boost::reg_expression<charT,traits,Allocator> &,unsigned int)' :
cannot convert parameter 2 from 'boost::cmatch' to
'boost::match_results<iterator,Allocator> &'
        with
        [
            _Ty=char,
            Allocator=std::allocator<char>,
            charT=char,
            _Elem=char,
            _Traits=std::char_traits<char>,
            _Ax=std::allocator<char>,

iterator=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
::const_iterator,
            traits=boost::regex_traits<char>
        ]
        and
        [

iterator=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
::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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net