Simple question: If change this:
void someMethod();
to
void someMethod() noexcept;
will it break binary compatibility, or does the method signature remain the same?
In general, you should use noexcept when you think it will actually be useful to do so. Some code will take different paths if is_nothrow_constructible is true for that type. If you're using code that will do that, then feel free to noexcept appropriate constructors.
noexcept (C++) C++11: Specifies whether a function might throw exceptions.
Does the method signature remain the same ?
Yes. https://en.cppreference.com/w/cpp/language/noexcept_spec :
Functions differing only in their exception specification cannot be overloaded (just like the return type, exception specification is part of function type, but not part of the function signature) (since C++17).
Will it break binary compability ?
Probably not, but standard doesn't guarentee anything (AFAIK).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With