GRETA and STLPort?

  • Thread starter Jürgen Devlieghere
  • Start date
J

Jürgen Devlieghere

Hi,

We try to use GRETA in combination with STLPort (Due to the inherent
multi-threading problems of the Dumkinware STL in Visual Studio 6 when using
the Multithreaded dll runtime).
The source file of the offending statement looks like this (the last line
causes the compilation error):

TCHAR szBuffer[100] = _T("");
regex::match_results results;
regex::rpattern PVT("version = ([\\d\\.]+)");
PVT.match(szBuffer, results);

In debug, we get the following compilation error:

Components\regexpr2.h(4338) : error C2079:
'iterator_types_are_not_convertible' uses undefined struct
'static_assert<0>'
F:\VSS\Development\Components\vocalcords30\Application\speakf\VoxSpeakf.cpp(119)
: see reference to function template instantiation 'const class
regex::backref_tag<struct _STL::_DBG_iter<class
_STL::_Nondebug_string<char,class _STL::char_traits<char>,class
_STL::allocator<char> >,struct _STL::_Const_traits<char> > > &__thiscall
regex::basic_rpattern<struct _STL::_DBG_iter<class
_STL::_Nondebug_string<char,class _STL::char_traits<char>,class
_STL::allocator<char> >,struct _STL::_Const_traits<char> >,class
regex::perl_syntax<char> >::match(char *,struct
regex::basic_match_results<struct _STL::_DBG_iter<class
_STL::_Nondebug_string<char,class _STL::char_traits<char>,class
_STL::allocator<char> >,struct _STL::_Const_traits<char> >,class
_STL::allocator<char> > &) const' being compiled

In the header file, this leads to this section of code:

// If your compile breaks here, it is because CharT* is not
// convertible to type IterT. Check the declaration of your rpattern object.
detail::static_assert< detail::is_convertible<CharT*,IterT>::value > const
iterator_types_are_not_convertible;

So, the comment seems to suggest that _STL::string should be convertible to
char *. Is that right? It can hardly mean it really needs the cast (char *),
because the MS implementation (well, the Dumkinware one) also doesn't allow
that cast.

I'm a bit lost in trying to find why the compilation breaks there.

Thanks!

Jürgen Devlieghere

Voxtron
 
J

Jürgen Devlieghere

One extra given: the problem only occurs when defining _STLP_DEBUG, so that
the debugging version of STL strings are used.

Jürgen Devlieghere
 
E

Eric Niebler

Jürgen Devlieghere said:
TCHAR szBuffer[100] = _T("");
regex::match_results results;
regex::rpattern PVT("version = ([\\d\\.]+)");
PVT.match(szBuffer, results);

In debug, we get the following compilation error:

Components\regexpr2.h(4338) : error C2079:
'iterator_types_are_not_convertible' uses undefined struct
'static_assert<0>'



It means you have parameterized the basic_rpattern object on
string::iterator, but you are passing a char* to match(). The iterator
type of your pattern must match the iterator type of the input sequence.
If you want to match a sequence of characters stored in a
null-terminated C-style string, try using "rpattern_c" for your pattern
instead of "rpattern".

And in the future, direct GRETA-related questions to the maintainers as
listed on GRETA's homepage
(http://research.microsoft.com/projects/greta). I doubt the maintainers
check this list. Also note that, although I wrote GRETA, I am no longer
the maintainer.


Shameless plug:
Check out xpressive, my new regex library
http://boost-sandbox.sf.net/libs/xpressive

Download xpressive.zip from:
http://boost-sandbox.sf.net/vault/index.php?directory=eric_niebler

And check back in a few days, as I'm about to release a new version.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top