#include <cstring>
#include <iostream>
#include <string>
#include <string_view>
#include <vector>
using namespace std;
template <typename T> constexpr string_view type_name() {
const string s = __PRETTY_FUNCTION__;
const int prefixSize = s.find("[with T = ") + strlen("[with T = ");
return string_view(s.data() + prefixSize, s.find(';') - prefixSize);
}
int main() {
int i[]{1, 2, 3};
cout << type_name<decltype(i)>() << endl;
cout << type_name<decltype(data(i))>() << endl;
cout << "------ 1" << endl;
string s{"abc"};
cout << type_name<decltype(s)>() << endl;
cout << type_name<decltype(data(s))>() << endl;
cout << "------ 2" << endl;
vector<int> v{1, 2, 3};
cout << type_name<decltype(v)>() << endl;
cout << type_name<decltype(data(v))>() << endl;
return 0;
}