Boost logo

Boost Users :

From: John Maddock (john_maddock_at_[hidden])
Date: 2002-09-12 05:28:17


> I'm trying to use Unicode with Regex in an MFC app. The preprocessor
> variable UNICODE is defined. But I obtain an error on the line :
>
> regex_search(sText, oResults, pRegExp);
> error C2665: none of the 4 overloads can convert parameter 1 from type
> 'class CString'
>
> sText is a CString which has a "const wchar_t*" operator. The problem is
why
> doesn't the regex_search prototype require a "const wchar_t*" when UNICODE
> is defined ?

You did, use sText.c_str() to get a const wchat_t*, otherwise there are too
many overloaded forms of the function for the conversion to be found
automatically.

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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