Dela via


hash_multiset::rend (STL/CLR)

Designates the end of the reversed controlled sequence.

    reverse_iterator rend();

Remarks

The member function returns a reverse iterator that points just beyond the beginning of the controlled sequence. Hence, it designates the end of the reverse sequence. You use it to obtain an iterator that designates the current end of the controlled sequence seen in reverse order, but its status can change if the length of the controlled sequence changes.

Example

// cliext_hash_multiset_rend.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::reverse_iterator rit = c1.rend(); 
    --rit; 
    System::Console::WriteLine("*-- --rend() = {0}", *--rit); 
    System::Console::WriteLine("*--rend() = {0}", *++rit); 
    return (0); 
    } 
 
 a b c
*-- --rend() = b
*--rend() = a

Requirements

Header: <cliext/hash_set>

Namespace: cliext

See Also

Reference

hash_multiset (STL/CLR)

hash_multiset::begin (STL/CLR)

hash_multiset::end (STL/CLR)

hash_multiset::rbegin (STL/CLR)