Skip to content

CHashSet<T>

CHashSet

CHashSet is a generic class that implements the ISet interface.

Description

The CHashSet class is an implementation of the unordered dynamic data set of type T, with the required uniqueness of each value. This class provides basic methods to work with sets and related operations, such as: the union and intersection of sets, definition of strict and non-strict subsets, and others.

Declaration

template<typename T>
   class CHashSet : public ISet<T>

Header

#include <Generic\HashSet.mqh>

Inheritance Hierarchy

ICollection

ISet

CHashSet

Class Methods

MethodDescription
AddAdds an element to a set
CountReturns the number of elements in a set
ComparerDetermines whether a set contains an element with the specified value
ContainsReturns a pointer to the IEqualityComparer interface, used to organize a set
TrimExcessSets the capacity of a set to the actual number of elements, and thus frees up unused memory
CopyToCopies all elements of a set to the specified array starting at the specified index
ClearRemoves all elements from a set
RemoveRemoves the specified element from a set
ExceptWithProduces the operation of difference between the current collection and a passed collection (array)
IntersectWithProduces the operation of intersection of the current collection and a passed collection (array)
SymmetricExceptWithProduces the operation of symmetrical difference between the current collection and a passed collection (array)
UnionWithProduces the union of the current collection and a passed collection (array)
IsProperSubsetOfDetermines whether the current set is a proper subset of the specified collection or array
IsProperSupersetOfDetermines whether the current set is a proper superset of the specified collection or array
IsSubsetOfDetermines whether the current set is a subset of the specified collection or array
IsSupersetOfDetermines whether the current set is a superset of the specified collection or array
OverlapsDetermines whether the current set overlaps the specified collection or array
SetEqualsDetermines whether the current set contains all elements of the specified collection or array
Last updated on