map::const_iterator
提供雙向 Iterator 可讀取對應中的一個 const 元素的型別。
typedef implementation-defined const_iterator;
備註
const_iterator 型別無法用來修改項目的值。
是 value_type物件項目的對應所指定的 const_iterator ,則為型別 pair<const Key, [型別]>,第一個成員是索引鍵的項目,第二個成員是這個項目保有的對應資料。
若要解除參考 const_iterator 指向對應中的項目的cIter ,請使用 -> 運算子。
存取索引鍵值項目、使用 cIter ->first的,相當於cIter(*)。first。
存取對應的資料值項目、使用 cIter ->second的,相當於cIter(*)。 second。
範例
提供使用 const_iterator的範例的參閱 啟動 範例。
需求
標頭:<map>
命名空間: std