类的C ++运行时知识

编程入门 行业动态 更新时间:2024-10-10 17:23:19
本文介绍了类的C ++运行时知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有多个类都派生自一个基类,现在一些派生类不会被编译,这取决于平台。我有一个类,允许我返回一个基类的对象,但现在所有的派生类的名称已经硬编码。

I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded.

有办法

推荐答案

确定哪些类已经被编译,在运行时优选,以便我可以删除链接,

您在寻找C ++运行时类注册吗?我找到了以下链接: meat/ 2006/03 / cpp-runtime-class-registration /

Are you looking for C++ runtime class registration? I found this link: meat/2006/03/cpp-runtime-class-registration/

这可能会完成你想要的,我不知道动态加载的模块,或者您不能使用相同的方法注册它们。

That would probably accomplish what you want, I am not sure about the dynamically loaded modules and whether or not you can register them using the same method.

更多推荐

类的C ++运行时知识

本文发布于:2023-08-04 03:14:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1292345.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:知识

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!