#include<boost/type_index.hpp>
using namespace std;
template<typename T>
void f(T&& t)
{
cout << "---------------" << endl;
using boost::typeindex::type_id_with_cvr;
cout << type_id_with_cvr<T>().pretty_name() << endl;
cout << type_id_with_cvr<decltype(t)>().pretty_name() << endl;
}
int main()
{
using boost::typeindex::type_id_with_cvr;
cout << type_id_with_cvr<decltype(sizeof(3))>().pretty_name() << endl;
system("pause");
return 0;
}
c++借助boost库的资源测试对象类型的代码示例
最新推荐文章于 2024-06-12 18:28:23 发布