判断 auto 类型
注意:先要提前安装好 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;
}
注意:先要提前安装好 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;
}