set


template <class T>
class set : public Semaphore
{
 public:
  typedef int (*keyCompare)(const T&,const T&);

  typedef setIterator<T> iterator;

  typedef constSetIterator<T> const_iterator;

  set(keyCompare C=compare);

  set(const set<T>& copy);

  set(const set& A, const set& B, Unsigned operation);

  template<class I>
  set(I first,I last,keyCompare C=compare);

  ~set();

  set<T>& operator=(const set<T>& copy);

  set<T>& operator<<(const T& Element);

  set<T>& operator>>(const T& Element);

  bool operator[](const T& Element) const;

  operator keyCompare() const;

  void* operator new(size_t s);

  void operator delete(void* p);

  iterator after(const T& Element) const;

  iterator afterEquals(const T& Element) const;

  iterator before(const T& Element) const;

  iterator beforeEquals(const T& Element) const;

  iterator begin();

  const_iterator begin() const;

  Unsigned depth() const; 

  iterator end();

  const_iterator end() const;

  void erase();

  void erase(const T& Element);

  void erase(iterator i);

  bool exists(const T& Element) const;

  iterator find(const T& Element) const;

  iterator insert(const T& Element);

  iterator last();

  const_iterator last() const;

  Unsigned length() const;
};

template<class T>
inline set<T> operator|(const set<T>& a,const set<T>& b);

template<class T>
inline set<T> operator&(const set<T>& a,const set<T>& b);

template<class T>
inline set<T> operator^(const set<T>& a,const set<T>& b);

template<class T>
inline set<T> operator-(const set<T>& a,const set<T>& b);

template<class T>
inline bool operator==(const set<T>& a,const set<T>& b);

template<class T>
inline bool operator!=(const set<T>& a,const set<T>& b);

template<class T>
inline bool operator<=(const set<T>& a,const set<T>& b);