Protobuf and exceptions

3.1k Views Asked by At

So I was reading about protobuf exception handling, and I've read the following document: https://groups.google.com/forum/#!topic/protobuf/IFcZQK0QuzI

specifically: We don't use exceptions in protobuf as exceptions are disallowed per Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html#Exceptions

As such the code likely won't work if some objects throw.

So, first of all, inside thatsame google style guide, it is mentioned that it is possible to use std::hash, but std::hash is part of the STL which throws! How can it work properly when compiling with -fno-exceptions? And the same goes for protobuf: it heavily uses std::string for example. How can they claim that they don't throw exceptions?

Thanks.

0

There are 0 best solutions below