#include <OpSet.h>
Public Member Functions | |
bool | contains (const T &item) const throw () |
bool | contains (const OpSet< T > &ts) const throw () |
int | distance (const OpSet< T > &ts) const throw () |
OpSet< T > | operator+ (const T &tag) const throw () |
Singleton union. | |
OpSet< T > & | operator+= (const T &ts) throw () |
Singleton union. | |
OpSet< T > | operator+ (const OpSet< T > &ts) const throw () |
Set union. | |
OpSet< T > & | operator+= (const OpSet< T > &ts) throw () |
Singleton union. | |
OpSet< T > | operator- (const T &tag) const throw () |
Singleton difference. | |
OpSet< T > & | operator-= (const T &tag) throw () |
Singleton difference. | |
OpSet< T > | operator- (const OpSet< T > &ts) const throw () |
Set difference. | |
OpSet< T > & | operator-= (const OpSet< T > &ts) throw () |
Set difference. | |
OpSet< T > | operator^ (const OpSet< T > &ts) const throw () |
Set intersection. | |
OpSet< T > & | operator^= (const OpSet< T > &ts) throw () |
Set intersection. |
Example:
OpSet<string> myfavs; OpSet<string> yourfavs; myfavourite += "pear"; myfavourite += "banana"; yourfavourite += "apple"; yourfavourite += "pear"; OpSet<string> ourfavs = myfavs ^ yourfavs; OpSet<string> interesting = myfavs + yourfavs; OpSet<string> myonlyfavs = myfavs - yourfavs; for (OpSet<string>::const_iterator i = ourfavs.begin(); i != ourfavs.end(); i++) cout << *i << endl;
|
|
|
|
|
|
|
Set union.
|
|
Singleton union.
|
|
Singleton union.
|
|
Singleton union.
|
|
Set difference.
|
|
Singleton difference.
|
|
Set difference.
|
|
Singleton difference.
|
|
Set intersection.
|
|
Set intersection.
|