Logo

Programming-Idioms

History of Idiom 165 > diff from v51 to v52

Edit summary for version 52 by Stanley:
New Cpp implementation by user [Stanley]

Version 51

2019-09-27, 09:08:26

Version 52

2019-09-27, 09:42:14

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Imports
#include <iterator>
Code
auto x = *std::crbegin(items);
Comments bubble
Requires C++14
Doc URL
https://en.cppreference.com/w/cpp/iterator/rbegin