sp_catch_paren
Add or remove space between catch
and (
in catch (something) { }
. If set to ignore, sp_before_sparen is used.
Possible values are ignore, add, remove and force. Default ignore.
Examples
add
Before:
try {
std::cout << "Throwing an integer exception...\n";
throw 42;
} catch(int i) {
std::cout << " the integer exception was caught, with value: " << i << '\n';
}
Code after:
try {
std::cout << "Throwing an integer exception...\n";
throw 42;
} catch (int i) {
std::cout << " the integer exception was caught, with value: " << i << '\n';
}
ignore (with sp_before_sparen as remove)
Config:
sp_before_sparen = remove
sp_catch_paren = ignore
Before:
try {
std::cout << "Throwing an integer exception...\n";
throw 42;
} catch (int i) {
std::cout << " the integer exception was caught, with value: " << i << '\n';
}
Code after:
try {
std::cout << "Throwing an integer exception...\n";
throw 42;
} catch(int i) {
std::cout << " the integer exception was caught, with value: " << i << '\n';
}
remove
Before:
try {
std::cout << "Throwing an integer exception...\n";
throw 42;
} catch (int i) {
std::cout << " the integer exception was caught, with value: " << i << '\n';
}
Code after:
try {
std::cout << "Throwing an integer exception...\n";
throw 42;
} catch(int i) {
std::cout << " the integer exception was caught, with value: " << i << '\n';
}
See also
- sp_before_sparen - More common rule, add or remove space before
(
of control statements (if
,for
,switch
,while
etc.). - sp_catch_brace - Add or remove space before the
{
of acatch
statement, if the{
andcatch
are on the same line, as incatch (decl) <here> {
.