From d4224942872a6a8bfaee178278acc5beb0b50c5e Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Tue, 30 Jul 2002 22:23:54 +0000 Subject: [PATCH] added subset functions [SVN r14646] --- dynamic_bitset.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dynamic_bitset.html b/dynamic_bitset.html index 93169be..33bbf74 100644 --- a/dynamic_bitset.html +++ b/dynamic_bitset.html @@ -178,6 +178,9 @@ public: unsigned long to_ulong() const; size_type size() const; + + bool is_subset_of(const dynamic_bitset& a) const; + bool is_proper_subset_of(const dynamic_bitset& a) const; }; template <typename B, typename A> @@ -1058,6 +1061,31 @@ can not be represented in an unsigned long.
+
+bool is_subset_of(const dynamic_bitset& a) const
+
+Requires: this->size() == a.size()
+Returns: true if this bitset is a subset of bitset a. +That is, it returns true if, for every bit in this bitset, the +corresponding bit in bitset a is also set. Otherwise this +function returns false.
+Throws: nothing. + +
+ +
+bool is_proper_subset_of(const dynamic_bitset& a) const
+
+Requires: this->size() == a.size()
+Returns: true if this bitset is a proper subset of bitset a. +That is, it returns true if, for every bit in this bitset, the +corresponding bit in bitset a is also set and if +this->count() < a.count(). Otherwise this +function returns false.
+Throws: nothing. + +
+
 bool operator==(const dynamic_bitset& rhs) const