Commit 896eef37 authored by Lynn Garren's avatar Lynn Garren
Browse files

catch uses reference, not copy

parent 24f15697
......@@ -28,10 +28,10 @@ int main() {
cerr << "Got past: ZMthrow( Oops(\"Ouch\") ) -- not good!" << endl;
#ifndef DEFECT_NO_EXCEPTIONS
}
catch ( const Oops egad ) {
catch ( const Oops &egad ) {
cerr << "Caught: Oops" << endl;
}
catch ( const ZMexception egad ) {
catch ( const ZMexception &egad ) {
cerr << "Caught: ZMexception" << endl;
}
catch ( ... ) {
......
......@@ -31,10 +31,10 @@ int main() {
cerr << "Got past: ZMthrow( Oops(\"Ouch\") ) -- not good!" << endl;
#ifndef DEFECT_NO_EXCEPTIONS
}
catch ( const Oops egad ) {
catch ( const Oops &egad ) {
cerr << "Caught: Oops" << endl;
}
catch ( const ZMexception egad ) {
catch ( const ZMexception &egad ) {
cerr << "Caught: ZMexception" << endl;
}
catch ( ... ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment