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-13 00:57:58


> It's historical: length() can be used with the "special" values -1 and -2 to
> obtain the length of prefix() and suffix(), that's deprecated, and I don't
> *think* it's documented anywhere anymore, but was retained for backwards
> compatibility.
>
> I guess after all this time it could be changed now, but I don't see it's
> causing any great harm either,

Can we at least fix the documentation of position() that has the wrong
signature? My issue was that position(0) was ambiguous so I tried
position(0U) as I read in the doc it was an unsigned int but this
worked only on win32, not in linux x86_64! Then I discovered it was a
size_type in the code. I know I could use the default value (0)
instead so that it would not be ambiguous with char but it looks
strange to me to call position() with no number.

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