hash_multimap::rend (STL/CLR)

指定已還原的受控制序列結尾。

    reverse_iterator rend();

備註

成員函式會傳回反向的 iterator 那些只是超出開頭受控制序列的點。因此,它會指定反向序列的 end。您要用它來取得的 Iterator 可指定以相反順序顯示的受控制序列之 current 結尾,但是,如果受控制序列的長度變更,它的狀態也可以變更。

範例

// cliext_hash_multimap_rend.cpp 
// compile with: /clr 
#include <cliext/hash_map> 
 
typedef cliext::hash_multimap<wchar_t, int> Myhash_multimap; 
int main() 
    { 
    Myhash_multimap c1; 
    c1.insert(Myhash_multimap::make_value(L'a', 1)); 
    c1.insert(Myhash_multimap::make_value(L'b', 2)); 
    c1.insert(Myhash_multimap::make_value(L'c', 3)); 
 
// display contents " [a 1] [b 2] [c 3]" 
    for each (Myhash_multimap::value_type elem in c1) 
        System::Console::Write(" [{0} {1}]", elem->first, elem->second); 
    System::Console::WriteLine(); 
 
// inspect first two items in reversed sequence 
    Myhash_multimap::reverse_iterator rit = c1.rend(); 
    --rit; 
    --rit; 
    System::Console::WriteLine("*-- --rend() = [{0} {1}]", 
        rit->first, rit->second); 
    ++rit; 
    System::Console::WriteLine("*--rend() = [{0} {1}]", 
        rit->first, rit->second); 
    return (0); 
    } 
 
  

需求

標頭: < cliext/hash_map >

Namespace: cliext

請參閱

參考

hash_multimap (STL/CLR)

hash_multimap::begin (STL/CLR)

hash_multimap::end (STL/CLR)

hash_multimap::rbegin (STL/CLR)