Boost logo

Boost :

From: ncmcantrip (ncm-yahoospam_at_[hidden])
Date: 2001-12-27 03:55:47


On Wed, 26 Dec 2001 20:05:14 -0500, "Beman Dawes" <bdawes_at_[hidden]> wrote:

> At 03:26 AM 12/26/2001, Nathan wrote:
>
> >I have uploaded to the Boost files section a couple of archives
> >containing an implementation of a class template extent_set;
> >look in the folder "extent_set":
> >
> > http://groups.yahoo.com/group/boost/files/extent_set/
> > ...
> >This is the initial submission. Please 'ave a look.
>
> Interesting.
>
> Did you consider asserting or throwing on b < e precondition violations?

As a precondition, it is a logical error to insert into the set elements
that are already present. The type std::set<> doesn't throw if you try
to insert the same element again. Passing a range to std::set<> with the
iterators reversed does not result in an exception.

I cannot imagine how client code could respond meaningfully to such an
exception.

> What is the rationale for the insert precondition !has_any(b, e),
> and the erase precondition has_all(b, e)? (I'm just curious and
> not suggesting that looser preconditions would be better.)

The preconditions radically simplify the logic of the insert and erase
members. They correspond, logically, to the requirement the same memory
not be passed to free() twice. More general functions that don't impose
such preconditions must contain a loop. They would be easy to add (along
with general set union, intersection, and complement-intersection), and I
expect that will happen eventually, but they would not be a substitute for
the more basic operations.

> The portion of the license which reads "Permission is granted for
> any use free of charge provided..." can be read two ways:
> ...

I have edited the license to eliminate any ambiguity:

// Copyright 2001 by Nathan C. Myers <ncm-nospam_at_[hidden]>.
// Permission is granted free of charge for any use provided that (1)
// this copyright notice is retained unchanged in its entirety, and
// (2) the author is indemnified, held harmless, and released from all
// responsibility for any consequences of such use.

As I understand it this is the minimal license that allows unrestricted
use without exposing me to liability.

Nathan Myers
ncm at cantrip dot org


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