Skip to content

Commit 5babbba

Browse files
committed
[except] Minor comment compaction and realignment
1 parent d7b084e commit 5babbba

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

source/exceptions.tex

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,9 @@
173173
C::C(int ii, double id)
174174
try : i(f(ii)), d(id) {
175175
// constructor statements
176+
} catch (...) {
177+
// handles exceptions thrown from the ctor-initializer and from the constructor statements
176178
}
177-
catch (...) {
178-
// handles exceptions thrown from the ctor-initializer
179-
// and from the constructor statements
180-
}
181-
182179
\end{codeblock}
183180
\end{example}
184181

@@ -216,8 +213,7 @@
216213
\begin{codeblock}
217214
try {
218215
// ...
219-
}
220-
catch(const char* p) {
216+
} catch(const char* p) {
221217
// handle character string exceptions here
222218
}
223219
\end{codeblock}
@@ -233,7 +229,7 @@
233229
}
234230
\end{codeblock}
235231
can be caught by a handler for exceptions of type
236-
\tcode{Overflow}
232+
\tcode{Overflow}:
237233
\begin{codeblock}
238234
try {
239235
f(1.2);
@@ -389,10 +385,10 @@
389385
A a;
390386
Y y;
391387
A b;
392-
return {}; // \#1
388+
return {}; // \#1
393389
} catch (...) {
394390
}
395-
return {}; // \#2
391+
return {}; // \#2
396392
}
397393
\end{codeblock}
398394
At \#1, the returned object of type \tcode{A} is constructed.
@@ -540,9 +536,9 @@
540536
try {
541537
g();
542538
} catch (Overflow oo) {
543-
// ...
539+
// ...
544540
} catch (Matherr mm) {
545-
// ...
541+
// ...
546542
}
547543
}
548544
\end{codeblock}
@@ -799,11 +795,11 @@
799795
\end{note}
800796
\begin{example}
801797
\begin{codeblock}
802-
extern void f(); // potentially-throwing
798+
extern void f(); // potentially-throwing
803799

804800
void g() noexcept {
805-
f(); // valid, even if \tcode{f} throws
806-
throw 42; // valid, effectively a call to \tcode{std::terminate}
801+
f(); // valid, even if \tcode{f} throws
802+
throw 42; // valid, effectively a call to \tcode{std::terminate}
807803
}
808804
\end{codeblock}
809805
The call to
@@ -914,7 +910,7 @@
914910
};
915911
struct B {
916912
B() throw();
917-
B(const B&) = default; // implicit exception specification is \tcode{noexcept(true)}
913+
B(const B&) = default; // implicit exception specification is \tcode{noexcept(true)}
918914
B(B&&, int = (throw Y(), 0)) noexcept;
919915
~B() noexcept(false);
920916
};

0 commit comments

Comments
 (0)