//#(compile) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// https://godbolt.org/z/Psdz9s9Gc
#include <iostream>
#include <string>
#include <tuple>
using namespace std;
template<typename Tuple>
auto back(Tuple &&tuple) {
using Noref = typename remove_reference<Tuple>::type; // falls Tuple&
constexpr auto sz = tuple_size<Noref>::value;
return get<sz-1>(forward<Tuple>(tuple));
}
int main() {
tuple<string,int,string> enterprise = make_tuple("NCC", 1701, "D");
cout << back(enterprise) << "\n"; // Ausgabe: D
}