Throwing C++ exceptions outside static library?

前端 未结 3 510
面向向阳花
面向向阳花 2021-01-04 14:06

As a rule, exceptions must not propagate module boundaries as for example explained in Herb Sutters C++ Coding Standards (item 62). When compiled with different compilers or

3条回答
  •  礼貌的吻别
    2021-01-04 14:17

    Herb Sutters' description is also suitable for static library:

    There is no ubiquitous binary standard for C++ exception handling. Don't allow exceptions to propagate between two pieces of code unless you control the compiler and compiler options used to build both sides; otherwise, the modules might not support compatible implementations for exception propagation. Typically, this boils down to: Don't let exceptions propagate across module/subsystem boundaries.

提交回复
热议问题