Google C++ style guide's No-exceptions rule; STL?

后端 未结 8 1745
故里飘歌
故里飘歌 2020-12-08 01:56

Google\'s C++ style guide says \"We do not use exceptions\". The style does not mention STL with respect to usage of exception. Since STL allocators can fail, how do they ha

8条回答
  •  醉梦人生
    2020-12-08 02:07

    They say that they don't use exceptions, not that nobody should use them. If you look at the rationale they also write:

    Because most existing C++ code at Google is not prepared to deal with exceptions, it is comparatively difficult to adopt new code that generates exceptions.

    The usual legacy problem. :-(

提交回复
热议问题