Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HashSet<T> Constructor

Initializes a new instance of the HashSet<T> class.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Supported by Portable Class Library HashSet<T>() Initializes a new instance of the HashSet<T> class that is empty and uses the default equality comparer for the set type.
Public method Supported by Portable Class Library HashSet<T>(IEnumerable<T>) Initializes a new instance of the HashSet<T> class that uses the default equality comparer for the set type, contains elements copied from the specified collection, and has sufficient capacity to accommodate the number of elements copied.
Public method Supported by Portable Class Library HashSet<T>(IEqualityComparer<T>) Initializes a new instance of the HashSet<T> class that is empty and uses the specified equality comparer for the set type.
Public method Supported by Portable Class Library HashSet<T>(IEnumerable<T>, IEqualityComparer<T>) Initializes a new instance of the HashSet<T> class that uses the specified equality comparer for the set type, contains elements copied from the specified collection, and has sufficient capacity to accommodate the number of elements copied.
Protected method HashSet<T>(SerializationInfo, StreamingContext) Initializes a new instance of the HashSet<T> class with serialized data.
Top
Show:
© 2015 Microsoft