mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
catch by reference in all samples (#1154)
This commit is contained in:
@@ -15141,7 +15141,7 @@ A user-defined type is unlikely to clash with other people's exceptions.
|
|||||||
my_code();
|
my_code();
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
catch(Bufferpool_exhausted) {
|
catch(const Bufferpool_exhausted&) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15187,7 +15187,7 @@ The standard-library classes derived from `exception` should be used only as bas
|
|||||||
my_code();
|
my_code();
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
catch(runtime_error) { // runtime_error means "input buffer too small"
|
catch(const runtime_error&) { // runtime_error means "input buffer too small"
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user