c++借助boost库的资源测试对象类型的代码示例

#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;
}

猜你喜欢

转载自blog.csdn.net/zhangzhangkeji/article/details/132984608
今日推荐