Click to Rate and Give Feedback
TechNet
TechNet Library
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework Class Library
HashSet<(Of <(T>)>) Constructor (IEqualityComparer<(Of <(T>)>))

Initializes a new instance of the HashSet<(Of <(T>)>) class that is empty and uses the specified equality comparer for the set type.

Namespace:  System.Collections.Generic
Assembly:  System.Core (in System.Core.dll)
Visual Basic
Public Sub New ( _
    comparer As IEqualityComparer(Of T) _
)
C#
public HashSet(
    IEqualityComparer<T> comparer
)
Visual C++
public:
HashSet(
    IEqualityComparer<T>^ comparer
)
F#
new : 
        comparer:IEqualityComparer<'T> -> HashSet

Parameters

comparer
Type: System.Collections.Generic..::.IEqualityComparer<(Of <(T>)>)
The IEqualityComparer<(Of <(T>)>) implementation to use when comparing values in the set, or nullNothingnullptra null reference (Nothing in Visual Basic) to use the default EqualityComparer<(Of <(T>)>) implementation for the set type.

The capacity of a HashSet<(Of <(T>)>) object is the number of elements that the object can hold. A HashSet<(Of <(T>)>) object's capacity automatically increases as elements are added to the object.

This constructor is an O(1) operation.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker