Is there a way to get std::type_info
from the type's name? For example,
std::type_info f(std::string name) {
std::type_info info;
...
return info;
}
int main() {
const std::string name = typeid(double).name();
std::type_info info = f(name);
assert(info==typeid(double));
}
What would the function f
be?