Boost logo

Boost Users :

Subject: [Boost-users] [utility] prior(it, n) for n being an unsigned type
From: Adam Romanek (romanek.adam_at_[hidden])
Date: 2014-06-13 08:39:15


Hi!

I've just finished investigating an issue in my code which led it to an
assert/abort in certain cases. It turned out it was caused by the use of
boost::prior(it, n) where n was unsigned int with some non-zero value.

I found a question [1] on the mailing list back in 2004 which describes
this issue. Additionally a solution to this problem was also posted in
one of the replies [2].

My question is - why hasn't it made into the repository yet? The current
behavior of boost::prior(it, n) when n is unsigned type is far from the
one expected by its potential users so I think it should either be
properly documented (warned) or fixed immediately.

Am I not seeing something?

WBR,
Adam Romanek

[1] http://lists.boost.org/Archives/boost/2004/02/61556.php
[2] http://lists.boost.org/Archives/boost/2004/02/61578.php


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