Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-07-29 10:37:55


Hi Dave,

On Sat, 27 Jul 2002, David Abrahams wrote:
dave> How about operator-() for set difference? That seems like an obvious
dave> need...

One small problem with this is that one metaphor for dynamic_bitset is
that of a big integer. All the current operators are borrowed from the
builtin operators on an unsigned int. The problem is that operator-
doesn't mean set difference for unsigned int, but subtraction.

One idea I've had in the past is to create a "Set" concept, which would
include things like union, difference, intersection, etc. For the general
idea of what the interface would look like, see:

boost/graph/detail/set_adaptor.hpp

Under this framework, it would make sense to implement this "Set"
interface for dynamic_bitset, in addition to other classes that can be
thought of as implementing sets, such as std::set.

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


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