elements_view takes
a view of tuple-like values and a size_t, and
produces a view with a value-type of the Nth element
of the adapted view's value-type.
Given a subexpression E and constant expression N,
the expression views::elements<N>(E) is expression-equivalent to
elements_view<views::all_t<decltype((E))>, N>{E}.
[Example 1: auto historical_figures = map{
pair{"Lovelace"sv, 1815},
{"Turing"sv, 1912},
{"Babbage"sv, 1791},
{"Hamilton"sv, 1936}};
auto names = historical_figures | views::elements<0>;
for(auto&& name : names){
cout << name <<' '; // prints Babbage Hamilton Lovelace Turing }auto birth_years = historical_figures | views::elements<1>;
for(auto&& born : birth_years){
cout << born <<' '; // prints 1791 1936 1815 1912 } — end example]
keys_view is an alias for elements_view<R, 0>, and
is useful for extracting keys from associative containers.
[Example 2: auto names = historical_figures | views::keys;
for(auto&& name : names){
cout << name <<' '; // prints Babbage Hamilton Lovelace Turing } — end example]