Прочетете на английски Редактиране

Споделяне чрез


IHash<TKey,TValue>.erase Method

Definition

Removes elements from the container.

Overloads

erase(TKey)

Removes elements from the container that match the specified key.

erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)

Removes from the container the element that is specified by the given iterator.

erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)

Removes from the container the elements between the specified iterators.

Remarks

For more information, see hash_map::erase (STL/CLR), hash_multimap::erase (STL/CLR), hash_set::erase (STL/CLR), and hash_multiset::erase (STL/CLR).

erase(TKey)

Removes elements from the container that match the specified key.

C#
public int erase(TKey _Keyval);

Parameters

_Keyval
TKey

The key value to erase.

Returns

The number of elements removed.

Remarks

For more information, see hash_map::erase (STL/CLR), hash_multimap::erase (STL/CLR), hash_set::erase (STL/CLR), and hash_multiset::erase (STL/CLR).

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)

Removes from the container the element that is specified by the given iterator.

C#
public void erase(ref Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> unnamedParam1, Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> _Where);

Parameters

unnamedParam1
ContainerBidirectionalIterator<TValue>

An iterator that designates the first element beyond the removed element, or end(ContainerBidirectionalIterator<TValue>) if no such element exists.

_Where
ContainerBidirectionalIterator<TValue>

An iterator that points to the element to erase.

Remarks

For more information, see hash_map::erase (STL/CLR), hash_multimap::erase (STL/CLR), hash_set::erase (STL/CLR), and hash_multiset::erase (STL/CLR).

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)

Removes from the container the elements between the specified iterators.

C#
public void erase(ref Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> unnamedParam1, Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> _First_iter, Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> _Last_iter);

Parameters

unnamedParam1
ContainerBidirectionalIterator<TValue>

An iterator that designates the first element beyond the elements removed, or end(ContainerBidirectionalIterator<TValue>) if no such element exists.

_First_iter
ContainerBidirectionalIterator<TValue>

An iterator that points to the beginning of the range to erase.

_Last_iter
ContainerBidirectionalIterator<TValue>

An iterator that points to the position that immediately follows the range to erase.

Remarks

For more information, see hash_map::erase (STL/CLR), hash_multimap::erase (STL/CLR), hash_set::erase (STL/CLR), and hash_multiset::erase (STL/CLR).

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1