ITree<TKey,TValue>.erase 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從容器中移除元素。
多載
| 名稱 | Description |
|---|---|
| erase(TKey) |
移除容器中與指定鍵符相符的元素。 |
| erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>) |
從容器中移除由給定迭代器指定的元素。 |
| erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>) |
從容器中移除指定迭代器之間的元素。 |
備註
更多資訊請參閱 hash_map::擦除(STL/CLR)、hash_multimap::擦除(STL/CLR)、hash_set::擦除(STL/CLR)及hash_multiset::抹除(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::擦除(STL/CLR)、hash_multimap::擦除(STL/CLR)、hash_set::擦除(STL/CLR)及hash_multiset::抹除(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::擦除(STL/CLR)、hash_multimap::擦除(STL/CLR)、hash_set::擦除(STL/CLR)及hash_multiset::抹除(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::擦除(STL/CLR)、hash_multimap::擦除(STL/CLR)、hash_set::擦除(STL/CLR)及hash_multiset::抹除(STL/CLR)。