Boost logo

Boost Users :

Subject: Re: [Boost-users] [regex] match_results: signatures of position(sub) and length(sub) are different, why?
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2012-12-12 08:46:54


> On the following link, we can see that length and position member
> functions have different signatures:
> http://www.boost.org/doc/libs/1_52_0/libs/regex/doc/html/boost_regex/ref/match_results.html
>
> difference_type length(int sub = 0) const;
> difference_type position(unsigned int sub = 0) const;
>
> Why int for length(sub) and unsigned int for position(sub)?

In fact, the documentation is wrong, but there is still an issue. This
is what is in match_results.hpp:
difference_type length(int sub = 0) const;
difference_type position(size_type sub = 0) const;

why such a difference?

Frédéric


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