Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • C++
#include<vector>
std::vector<int> items;
int last = items.back();

The vector must not be empty.
#include <iterator>
auto x = *std::crbegin(items);

Requires C++14
X := Items'Last

X must be declared earlier.

New implementation...