I agree that exception should by caught by reference and not re-thrown as a copy ... in general.
But when the exception is a fundamental types like an enum or a int... it costs less than a reference.
I was wondering if an exception could be made in a case of enum, integers, or any simple type with a size smaller than a pointer ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree that exception should by caught by reference and not re-thrown as a copy ... in general.
But when the exception is a fundamental types like an enum or a int... it costs less than a reference.
I was wondering if an exception could be made in a case of enum, integers, or any simple type with a size smaller than a pointer ?
Can you share some example code? This is clean:
ok, my bad...
in my analyse, cppcheck didn't have access to the definition of the enum E (in your example).
all is good, sorry for the noise.