|
Boost Users : |
From: john.wismar_at_[hidden]
Date: 2004-02-20 16:54:00
Earlier, I wrote:
>
> <Using VC7.0>
>
> I'm converting to V4 of Regex, and I thought I might be able to
> count regex matches using this snippet:
<snip>
> boost::sregex_iterator itBegin(first, last, e);
> boost::sregex_iterator itEnd;
> ptrdiff_t pd = std::distance(itBegin, itEnd);
>
> I get these errors:
>
> xutility(312) : error C2665: 'std::_Iter_cat' : none of the 12 overloads
> can convert parameter 1 from type 'boost::sregex_iterator'
<snip different _Iter_cat overloads taking integral types>
> Anyone have any thoughts? Is it a VC7.0 issue? Is there a better or
> different way of doing the same thing?
I should have mentioned that I'm using boost 1.31.0.
After some further research, I found that this DOES appear to be a
VC7.0-only problem. It doesn't happen in VC7.1, notably.
The problem seems to be with VC7.0's implementation of the standard
library. In particular, there's another overload of std::_Iter_cat that
takes a std::iterator as a parameter; this overload wasn't considered by
the compiler when it generated the error message above.
It looks like instead of relying on iterators to define typedefs for
iterator_category, value_type, et al., the library assumes that an iterator
must actually derive from std::iterator. This assumption has been removed
from the library implementation in VC7.1.
Given all of this, it seems like my options are to modify my copy of
regex_iterator.hpp, modify my copy of <xutility>, or hope that someone has
a third option. (Upgrading to vc7.1 is not an option this week. :-)
--------------------------------
John Wismar
jwismar_at_[hidden]
------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.
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