Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-09-02 14:36:22

on Tue Sep 02 2008, Arno Schödl <> wrote:

>> > The RangeEx documentation writes something like "what algorithms are to
>> > containers, adaptor ranges are to ranges". Whenever you are applying one
>> > (non-permutating) algorithm to a container, and then another and then
> another,
>> > you can stack range adaptors. It's like lazy evaluation of a Haskell list.
>> Sheesh; give me a little credit, please. I know what range adaptors do.
> So why are you asking these questions then?

I'm trying to find out what the specific example applications are. I
have a suspicion that range adapters or single-level iterator adaptors
may not be the best way to address these applications and may even
sacrifice significant performance, but I can't tell until I know what
the applications are. Just so, single-level iterators (or ordinary
range adapters, which don't add anything conceptually to iterators) are
not the best way to address iteration over hierarchical data structures,
which is why we have segmented iterators.

> With smart compilers, generic programming is supposed to produce code
> that is pretty close to handcrafted code. That is what people expect,
> and that is what generic programming is sold on.

Generic Programming is supposed to be driven by concrete implementations
and real use cases.

  It is as if mathematicians would start with axioms. You do not start
  with axioms - you start with proofs. Only when you have found a bunch
  of related proofs, can you come up with axioms. You end with
  axioms. The same thing is true in programming: you have to start with
  interesting algorithms. Only when you understand them well, can you
  come up with an interface that will let them work.

Dave Abrahams
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at