From: Rene Jager (renej_at_[hidden])
Date: 2001-05-26 14:37:18


John Maddock wrote:

> >i'm using a recent snapshot of gcc/g++ v3 prerelease
> i found that in Boost.Regex that on many places it is assumed that
> std::string::iterator == char*
> however, in the libstdc++-v3 accompanying g++-v3 this is not the case
> (it is a std::iterator<char *, std::string> i believe)
> i started patching the regex sources, but got stuck when in
> re_detail/regex_compile.hpp
> a number of (const charT*)(...) casts and alike were used
> i came a long way by replacing
> const char* -> std::string::const_iterator
> const charT* -> std::basic_string<charT>::const_iterator
> etc,
> but the low-level casts... is it possible that john maddock helps out
> here?
> <
>
> You absolutely should not need to patch anything to use with
> string::iterator that is not a char* - this already works with STLPort and
> Dinkum libraries that also define the string::iterator as a structure type
> in some cases. Probably there is some config setup that's wrong - what
> error messages do you get from a compile *with*the*original*sources* ?

first off all, sorry... sorry...sorry...
I used:
    regex_match(std::string, boost::cmatch, ...)
(cmatch is match_results<const char *>)
where I should use either:
    regex_match(const char *, boost::cmatch, ...)
or:
    regex_match(std::string,
boost::match_results<std::string::const_iterator>, ...)

the problem was that g++ 2.96 typedefs std::string::const_iterator as const
char *
and I wasn't paying attention... shame on me... sorry for the needless
network traffic
and time spent on this...

renej