mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
catch by reference in all samples (#1154)
This commit is contained in:
parent
2c3d9921b6
commit
ab5f9c18bd
|
@ -15141,7 +15141,7 @@ A user-defined type is unlikely to clash with other people's exceptions.
|
|||
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();
|
||||
// ...
|
||||
}
|
||||
catch(runtime_error) { // runtime_error means "input buffer too small"
|
||||
catch(const runtime_error&) { // runtime_error means "input buffer too small"
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user