void add_indices (const ForwardIterator &begin,
const ForwardIterator &end);
+ /**
+ * Add the given IndexSet @p other to the
+ * current one, constructing the union of
+ * *this and @p other.
+ */
+ void add_indices(const IndexSet & other);
+
/**
* Return whether the specified
* index is an element of the
+inline
+void
+IndexSet::add_indices(const IndexSet & other)
+{
+ if (this == &other)
+ return;
+
+ for (std::vector<Range>::iterator range = other.ranges.begin();
+ range != other.ranges.end();
+ ++range)
+ {
+ add_range(range->begin, range->end);
+ }
+
+ compress();
+}
+
+
+
inline
bool
IndexSet::is_element (const unsigned int index) const
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams