PIP  0.4.0_beta2
Platform-Independent Primitives
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PISet< Type, Compare, Allocator > Class Template Reference

Set of any type. More...

Inherits set< Type, Compare, Allocator >.

Public Member Functions

 PISet ()
 Contructs an empty set.
 
 PISet (const Type &value)
 Contructs set with one element "value".
 
 PISet (const Type &v0, const Type &v1)
 Contructs set with elements "v0" and "v1".
 
 PISet (const Type &v0, const Type &v1, const Type &v2)
 Contructs set with elements "v0", "v1" and "v2".
 
 PISet (const Type &v0, const Type &v1, const Type &v2, const Type &v3)
 Contructs set with elements "v0", "v1", "v2" and "v3".
 
int size_s () const
 Returns elements count.
 
bool isEmpty () const
 Returns if set is empty.
 
void clear ()
 Clear th set.
 
void insert (const Type &t)
 Insert element "t" if it doesn`t exists in this set.
 
bool operator[] (const Type &t)
 Returns if element "t" exists in this set.
 
PIVector< Type > toVector ()
 Returns content of set as PIVector.
 

Detailed Description

template<typename Type, typename Compare = std::less<Type>, typename Allocator = std::allocator<Type>>
class PISet< Type, Compare, Allocator >

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.