Boost logo

Boost :

From: Herve Bronnimann (hbr_at_[hidden])
Date: 2002-12-11 16:11:20


Hi Toon:

On Tue, Dec 10, 2002 at 01:18:24PM -0500, Toon Knapen wrote:
> Long time ago I inquired if it would be a good idea to provide STL extensions
> in boost that are not implemented by all STL's. IIRC David A responded that
> boost/compatibility was intended for this.

There was also some work on algorithms. I have taken a very close look
at binary trees, and priority queues (Dietmar Kuehl's beta submission),
and linear-time sorting (radix, etc.) which is in the sandbox. I've also
implemented a full-fledged policy-based vector (again in the sandbox).

> So I finally started with implementing is_sorted and iota. Also as David
> Abrahams suggested, I've put them in the boost namespace (but they reuse the
> implementation in the std namespace if available). The definitions are also
> located in a file with the same name (except for the attached .hpp
> extension) as defined by the SGI/STL.

Before you duplicate existing work, I should signal that Jeremy created
a sequence_algo in boost-sandbox, and I contributed a more compact
implementation of is_sorted there. In addition, there is:

  template <class ForwardIterator, class T>
  void iota(ForwardIterator first, ForwardIterator last, T value);

  template <typename InputIterator, typename T>
  bool contains(InputIterator first, InputIterator last, T value);

  template <typename InputIterator, typename Predicate>
  bool all(InputIterator first, InputIterator last, Predicate p);

  template <typename InputIterator, typename Predicate>
  bool none(InputIterator first, InputIterator last, Predicate p);

  template <typename InputIterator, typename Predicate>
  bool any_if(InputIterator first, InputIterator last, Predicate p);

  template<class ForwardIterator>
  bool is_sorted(ForwardIterator first, ForwardIterator last);

  template<class ForwardIterator, class StrictWeakOrdering>
  bool is_sorted(ForwardIterator first, ForwardIterator last,
                 StrictWeakOrdering comp);

Then again, perhaps your implementation differs and/or complements
those.

> I propose to put these in the boost/compatibility directory. Opinions ?

Please take a look at boost-sandbox/boost/sequence_algo/, especially:
  algorithm.hpp
  container_algo.hpp
  non-modifying.hpp
as well as at boost-sandbox/boost/linear_sort, and
boost-sandbox/boost/policy_vector if you like.

Best,

-- 
Herve'

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