Class Conversions
The following functions allow any collection class to be converted into an RWBag, RWSet, RWOrdered, or a SortedCollection (that is, an RWBinaryTree):
 
RWBag asBag() const;
RWSet asSet() const;
RWOrdered asOrderedCollection() const;
RWBinaryTree asSortedCollection() const
Note that since these functions mimic similar Smalltalk methods, they return a copy of the new collection by value. For large collections, this can be very expensive. Consider using operator+=() instead.