Re: [Boost-docs] Manual: Regex Creation from an MFC String - Typo.

Subject: Re: [Boost-docs] Manual: Regex Creation from an MFC String - Typo.
From: John Maddock (john_at_[hidden])
Date: 2008-02-21 18:09:42


Mark Kasson wrote:
> On this page:
> http://www.boost.org/libs/regex/doc/mfc_strings.html
>
> I believe there is an error in this line:
>
> return CString(what[0].first, what.length());I believe the latter
> parameter should be what[0].length(). (i.e. insert the [0])

Nope: while you can call length() on the sub-expression, match_results also
has a length member function:

difference_type length(int sub = 0) const;

which returns the length of sub-expression "sub".

HTH, John.


This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:40 UTC