IHash<TKey,TValue>.erase 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从容器中删除元素。
重载
| 名称 | 说明 |
|---|---|
| erase(TKey) |
从与指定键匹配的容器中删除元素。 |
| erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>) |
从容器中移除由给定迭代器指定的元素。 |
| erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>) |
从容器中删除指定迭代器之间的元素。 |
注解
有关详细信息,请参阅 hash_map::erase(STL/CLR)、hash_multimap::erase(STL/CLR)、hash_set::erase(STL/CLR)和 hash_multiset::erase(STL/CLR)。
erase(TKey)
从与指定键匹配的容器中删除元素。
public:
int erase(TKey _Keyval);
public int erase(TKey _Keyval);
abstract member erase : 'Key -> int
Public Function erase (_Keyval As TKey) As Integer
参数
- _Keyval
- TKey
要擦除的键值。
返回
删除的元素数。
注解
有关详细信息,请参阅 hash_map::erase(STL/CLR)、hash_multimap::erase(STL/CLR)、hash_set::erase(STL/CLR)和 hash_multiset::erase(STL/CLR)。
适用于
erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)
从容器中移除由给定迭代器指定的元素。
public:
void ^ erase(Microsoft::VisualC::StlClr::Generic::ContainerBidirectionalIterator<TValue> ^ % unnamedParam1, Microsoft::VisualC::StlClr::Generic::ContainerBidirectionalIterator<TValue> ^ _Where);
public void erase(ref Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> unnamedParam1, Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<TValue> _Where);
abstract member erase : ContainerBidirectionalIterator * Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<'Value> -> unit
Public Function erase (ByRef unnamedParam1 As ContainerBidirectionalIterator(Of TValue), _Where As ContainerBidirectionalIterator(Of TValue)) As Void
参数
- unnamedParam1
- ContainerBidirectionalIterator<TValue>
一个迭代器,指定除已删除元素之外的第一个元素,或者 end(ContainerBidirectionalIterator<TValue>) 不存在此类元素。
指向要擦除的元素的迭代器。
注解
有关详细信息,请参阅 hash_map::erase(STL/CLR)、hash_multimap::erase(STL/CLR)、hash_set::erase(STL/CLR)和 hash_multiset::erase(STL/CLR)。
适用于
erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)
从容器中删除指定迭代器之间的元素。
public:
void ^ erase(Microsoft::VisualC::StlClr::Generic::ContainerBidirectionalIterator<TValue> ^ % unnamedParam1, Microsoft::VisualC::StlClr::Generic::ContainerBidirectionalIterator<TValue> ^ _First_iter, Microsoft::VisualC::StlClr::Generic::ContainerBidirectionalIterator<TValue> ^ _Last_iter);
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);
abstract member erase : ContainerBidirectionalIterator * Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<'Value> * Microsoft.VisualC.StlClr.Generic.ContainerBidirectionalIterator<'Value> -> unit
Public Function erase (ByRef unnamedParam1 As ContainerBidirectionalIterator(Of TValue), _First_iter As ContainerBidirectionalIterator(Of TValue), _Last_iter As ContainerBidirectionalIterator(Of TValue)) As Void
参数
- unnamedParam1
- ContainerBidirectionalIterator<TValue>
一个迭代器,指定删除的元素以外的第一个元素,或者 end(ContainerBidirectionalIterator<TValue>) 不存在此类元素。
- _First_iter
- ContainerBidirectionalIterator<TValue>
指向要擦除的范围开头的迭代器。
- _Last_iter
- ContainerBidirectionalIterator<TValue>
一个迭代器,指向紧跟在要擦除的范围之后的位置。
注解
有关详细信息,请参阅 hash_map::erase(STL/CLR)、hash_multimap::erase(STL/CLR)、hash_set::erase(STL/CLR)和 hash_multiset::erase(STL/CLR)。