RTTI和异常之间有关系吗? [英] Is there a relation between RTTI and exceptions?

查看:144
本文介绍了RTTI和异常之间有关系吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得在禁用RTTI和例外的平台上,以及在启用了它们的其他平台上编码。然而,我不记得在一个平台上启用一个并禁用另一个的编码。



这两个概念之间有什么依赖关系吗?换句话说,异常是否需要RTTI来运行?或者相反?

解决方案

不,异常不需要RTTI功能,反之亦然都是独立的功能。



一些实现可能允许你禁用异常(gcc中的-fnoexceptions),但我不知道任何需要RTTI的异常实现,反之亦然。 / p>

I remember coding on platforms that had both RTTI and exceptions disabled, and on others that had them both enabled. However, I cannot remember coding on a platform that would enable one and disable the other one.

Is there any kind of dependency between the two concepts? Said differently, do exceptions need RTTI to function? Or the contrary?

解决方案

No, Exceptions do not need RTTI functionality neither vice versa both are separate features.

Some of the implementations might allow you to disable exceptions(-fnoexceptions in gcc) but I don't know of any implementation which needs RTTI for exceptions or vice versa.

这篇关于RTTI和异常之间有关系吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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