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

Avi Kivity avi@argo.co.il
Sun Oct 16 19:35:00 GMT 2005


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.



More information about the Gcc mailing list