This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning on C++ catch by value on non primitive types


Kai Henningsen wrote:

So what you say is that any decent modern C++ coding guide/list wants to forbid catching the C++ standard exceptions, and anything derived from them?



no, only catch by value is problematic, as it can lead to slicing.

catch by reference is perfectly fine.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]