
com_print_typeinfo 함수는 std::type_info 객체를 인자로 받는 함수입니다. 하지만 std::string은 std::type_info 객체가 아니므로 오류가 발생합니다.
해결 방법은 std::string을 std::type_info 객체로 변환하는 것입니다. 다음 예제를 참고하세요.
#hostingforum.kr
cpp
#include
#include
#include
class Test {
public:
virtual ~Test() {}
};
int main() {
Test test;
std::cout << com_print_typeinfo(typeid(test)) << std::endl;
return 0;
}
위 예제에서 typeid(test) 함수를 사용하여 Test 클래스의 타입 정보를 std::type_info 객체로 변환한 후 com_print_typeinfo 함수에 전달합니다.
2025-03-14 01:08