deque::rend (STL/CLR)
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at deque::rend (STL/CLR).
Designates the end of the reversed controlled sequence.
Syntax
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_deque_rend.cpp
// compile with: /clr
#include <cliext/deque>
int main()
{
cliext::deque<wchar_t> c1;
c1.push_back(L'a');
c1.push_back(L'b');
c1.push_back(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
cliext::deque<wchar_t>::reverse_iterator rit = c1.rend();
--rit;
System::Console::WriteLine("*-- --rend() = {0}", *--rit);
System::Console::WriteLine("*--rend() = {0}", *++rit);
// alter first two items and reinspect
*--rit = L'x';
*++rit = L'y';
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
a b c
*-- --rend
() = b
*--rend
() = a
y x c
Requirements
Header: <cliext/deque>
Namespace: cliext
See Also
deque (STL/CLR)
deque::begin (STL/CLR)
deque::end (STL/CLR)
deque::rbegin (STL/CLR)