|
PIP
1.7.1
Platform-Independent Primitives
|
Set of any type. More...
Inherits PIMap< Key, T >.
Public Member Functions | |
| PISet () | |
| Contructs an empty set. | |
| PISet (const T &value) | |
| Contructs set with one element "value". | |
| PISet (const T &v0, const T &v1) | |
| Contructs set with elements "v0" and "v1". | |
| PISet (const T &v0, const T &v1, const T &v2) | |
| Contructs set with elements "v0", "v1" and "v2". | |
| PISet (const T &v0, const T &v1, const T &v2, const T &v3) | |
| Contructs set with elements "v0", "v1", "v2" and "v3". | |
| PISet (const PIVector< T > &values) | |
| Contructs set from vector of elements. | |
| PISet (const PIDeque< T > &values) | |
| Contructs set from deque of elements. | |
| bool | operator[] (const T &t) const |
| Returns if element "t" exists in this set. | |
| PISet< T > & | remove (const T &t) |
| Returns if element "t" exists in this set. | |
| PISet< T > & | unite (const PISet< T > &v) |
| Unite set with "v". | |
| PISet< T > & | subtract (const PISet< T > &v) |
| Subtract set with "v". | |
| PISet< T > & | intersect (const PISet< T > &v) |
| Intersect set with "v". | |
| PISet< T > & | operator+= (const PISet< T > &v) |
| Unite set with "v". | |
| PISet< T > & | operator|= (const PISet< T > &v) |
| Unite set with "v". | |
| PISet< T > & | operator-= (const PISet< T > &v) |
| Subtract set with "v". | |
| PISet< T > & | operator&= (const PISet< T > &v) |
| Intersect set with "v". | |
| PIVector< T > | toVector () const |
| Returns content of set as PIVector. | |
| PIDeque< T > | toDeque () const |
| Returns content of set as PIDeque. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename T > | |
| PISet< T > | operator+ (const PISet< T > &v0, const PISet< T > &v1) |
| Returns unite of two sets. | |
| template<typename T > | |
| PISet< T > | operator- (const PISet< T > &v0, const PISet< T > &v1) |
| Returns subtraction of two sets. | |
| template<typename T > | |
| PISet< T > | operator| (const PISet< T > &v0, const PISet< T > &v1) |
| Returns unite of two sets. | |
| template<typename T > | |
| PISet< T > | operator & (const PISet< T > &v0, const PISet< T > &v1) |
| Returns intersetion of two sets. | |
Set of any type.
This class used to store collection of unique elements of any type. You can only add values to set with operator<< or with function insert(). You can discover if value already in set with operator[] or with function find(). These function has logarithmic complexity.