Boost logo

Boost :

Subject: Re: [boost] Review Request: Creasing (Sequence Properties)
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2010-01-27 16:11:09


2010/1/27 Simonson, Lucanus J <lucanus.j.simonson_at_[hidden]>
>
> Joachim Faulhaber wrote:
> > Hi Grant,
> >
> > 2010/1/24 Grant Erickson <gerickson_at_[hidden]>:
> >> 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?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk