3 ms·
All of Google's codebase, including Chromium, is OO C++ without exceptions. https://google.github.io/styleguide/cppguide.html#Exceptions https://google.github.
by cmrdporcupine 7y ago
All of Google's codebase, including Chromium, is OO C++ without exceptions.
https://google.github.io/styleguide/cppguide.html#Exceptions https://google.github.io/styleguide/cppguide.html#Exceptions
- userbinator 7y agoIn other words, that codebase is without exceptions, without exception.
- DoofusOfDeath 7y agoExceptional observation.
- saagarjha 7y agostd::bad_alloc would like to have a word with you.
- MHordecki 7y agoAn exception that proves the rule.
- pansa2 7y agoThanks - I’d seen that section before, but hadn’t noticed that elsewhere the document says “code should target C++17“. Do you know if there are any parts of the C++17 language or standard library that are disallowed in Google’s code because those parts don’t work without exceptions?
- plorkyeran 7y agoNo, nothing in C++ has a hard dependency on exceptions. Custom allocators can be used to report allocation failures in some way other than throwing an exception, and other than that the standard library only uses exceptions to report precondition violations; things which are expected to sometimes fail (such as filesystem operations) can report error codes instead.
- jcelerier 7y agoLet's insist on > On their face, the benefits of using exceptions outweigh the costs, especially in new projects. However, for existing code, the introduction of exceptions has implications on all dependent code. If exceptions can be propagated beyond a new project, it also becomes problematic to integrate the new project into existing exception-free code. 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. Also let's note that there are more new C++ projects being created today that at any previous point in time. Propagating the -fno-exceptions meme is harmful to the whole community.