且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++是否已经有了某种反映?

更新时间:2023-11-28 23:29:40

取决于编译器。显然,编译器很容易发现每个抛出,并将每个抛出对象的类型编码为可执行文件。

It's compiler dependant. Obviously, it's easy for the compiler to spot every throw, and encode the type of every thrown object into the executable. But there is no requirement that they should do this.

考虑一下,抛出异常时必须将异常复制到与实现相关的怪异空间中。因此,可以通过这种机制访问特定编译器的类型名称。

And thinking about it, exceptions have to be copied into a weird implementation-dependent space when they are thrown. So it makes sense that the name of their type is accessible via this mechanism to the runtime of a specific compiler.