hash_multiset::begin (STL/CLR)

指定受控制序列的開頭。

    iterator begin();

備註

成員函式會傳回種雙向 iterator,指派受控制序列中,或只是超出空序列結尾的第一個項目。您要用它來取得的 Iterator 可指定受控制序列之 current 開頭,但是,如果受控制序列的長度變更,它的狀態也可以變更。

範例

// cliext_hash_multiset_begin.cpp 
// compile with: /clr 
#include <cliext/hash_set> 
 
typedef cliext::hash_multiset<wchar_t> Myhash_multiset; 
int main() 
    { 
    Myhash_multiset c1; 
    c1.insert(L'a'); 
    c1.insert(L'b'); 
    c1.insert(L'c'); 
 
// display initial contents " a b c" 
    for each (wchar_t elem in c1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// inspect first two items 
    Myhash_multiset::iterator it = c1.begin(); 
    System::Console::WriteLine("*begin() = {0}", *it); 
    System::Console::WriteLine("*++begin() = {0}", *++it); 
    return (0); 
    } 
 
  

需求

標頭: < cliext/hash_set >

Namespace: cliext

請參閱

參考

hash_multiset (STL/CLR)

hash_multiset::end (STL/CLR)