//for testing
#include <iostream>
#include <vector>

#include <string>
#include <string>
#include <cxxabi.h>

template<typename T>
std::string type_name()
{
	std::string tname = typeid(T).name();
	#if defined(__clang__) || defined(__GNUG__)
	int status;
	char *demangled_name = abi::__cxa_demangle(tname.c_str(), NULL, NULL, &status);
	if(status == 0)
	{
		tname = demangled_name;
		std::free(demangled_name);
	}
	#endif
	return tname;
}

//just testing it
struct MyStruct {};

int main()
{
	std::cout<<type_name<int>()<<"\n"
	<<type_name<bool(MyStruct,MyStruct)>()<<"\n"
	<<type_name<std::vector<int>>();
	return 0;
}