
On Tue, Jul 19, 2011 at 12:08 PM, John Maddock <boost.regex@virgin.net> wrote:
The only real fix is to redesign them to be range-based, so we can add the additional checks necessary, but of course this also makes them more heavyweight than they are at present. I guess I was hoping we would have had a proper Unicode library for this by now (in Boost that is, not the sandbox ;)
Oh well, maybe I should just bite the bullet and change/fix this hole.
What about moving portions of Mathias Gaunard's Unicode library into detail? Have you looked at his code in the sandbox?
No, which directory is it under?
Actually, the best link is probably http://mathias.gaunard.com/unicode/doc/html/index.html
Actually, I'm thinking that the fix may be easier than I thought after all - if I add a 2-arg "range-checked" constructor as an overload, then the iterator's constructor can validate the end-points of the underlying sequence during construction, and there's no need to otherwise change the implementation or add overhead by checking every increment/decrement for movement out-of-range because we'll know that it can't happen.
Ah! Nice solution! Go for it! --Beman