判断 auto 类型

hacker_dvd / 2023-05-08 / 原文

注意:先要提前安装好 boost 库

#include <iostream>
#include <boost/type_index.hpp>

int main() {
	using boost::typeindex::type_id_with_cvr;
	auto x = 100;
	std::cout << type_id_with_cvr<decltype(x)>().pretty_name() << std::endl;

	return 0;
}