
2010/1/27 Simonson, Lucanus J <lucanus.j.simonson@intel.com>
Joachim Faulhaber wrote:
Hi Grant,
2010/1/24 Grant Erickson <gerickson@nuovations.com>:
The creasing algorithm templates define four template functions for determining the order properties of sequences, specifically:
* Increasing * Decreasing * Strictly Increasing * Strictly Decreasing
in your implementation of 'creasing' you provide the four specific algorithms is_[strictly_]{in_,de_}creasing while hiding the general algorithm is_creasing in namespace detail.
I'd suggest to implement only the latter. This would make your extension both more minimal and more general.
[..]
Nobody is at a loss as to how to code up something to figure out whether elements in an iterator range are sorted, and nobody would or even should look in boost for such a simple thing.
'is_sorted' is an important predicate. But it lives as an invariant to be maintained rather than a function to computed. So we have happily coded all kinds of sorted things without explicitly using and not necessarily needing it. My question: Other than inside BOOST_ASSERTS, where do we really need is_sorted in production code. Are there convincing use cases?