|
Boost : |
From: nbecker_at_[hidden]
Date: 2002-02-01 08:41:37
Sorry, I realize I should clarify this. The problem is the
desired behaviour of a cirular container is ambiguous. If I tell you
to copy (a, b, c), and a > b (base iterator), what do I really want?
The interpretation I used is that I want you to iterate starting at a
and continuing to b. This means that
distance (a, b) = (b - a) >= 0 ? (b - a) : (b - a + sizeof
(container))
However, I can see that a different interpretation is also valid.
With this interpretation, the distance (a, b) is signed, and in this
case we can only use data from 1/2 of the container at a time. In
other words, copy (a, b, c) would only be able to copy at most 1/2 of
the container.
Note that if you do nothing, and inherit the default policy, you will
get neither of these behaviours. You get a behaviour that I think is
not useful.
I think in most cases it is the first behaviour that I would want from
my circular containters. This means that I know when I write
copy (a, b, c), that b is always logically ahead of a.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk