如何导出模板类而不显式实例化它? [英] How to export a template class without explicitly instantiating it?

查看:46
本文介绍了如何导出模板类而不显式实例化它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何导出模板类而不显式实例化它?如果除了实例化之外我们无法导出,请考虑这种情况.
我正在像这样进行显式实例化
模板类CInput<测试(ctest是一个类)..但是我不应该在此解决方案中包含包含CTest定义的头文件..有什么办法吗?

Hi,

How to export a template class without explicitly instantiating it? If we can''t export other than instantiating it,please consider this situation..
i am doing explicit instantiation like this
template class CInput< CTest > (ctest is a class) ..but i shouldn''t include the header file containing definition of CTest in this solution..is there any way to do so?

推荐答案

我想没有办法.

如果需要早期绑定(例如模板),我们需要类定义.
I guess, there are no such way.

In case for early binding like templates, we need the class definition.


这篇关于如何导出模板类而不显式实例化它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆