Skip to content

Commit 118e784

Browse files
authored
[unique.ptr.single] Align preconditions and postconditions with the guidelines
According to https://github.com/cplusplus/draft/wiki/Specification-Style-Guidelines#formatting-declarations-and-definitions, conditions should be expressed as `<expr> is true` instead of simply `<expr>`. It seems that `std::unique_ptr` specification does not comply with that. This PR updates all such places that I have spotted.
1 parent 66a8def commit 118e784

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

source/memory.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@
24462446
\pnum
24472447
\ensures
24482448
\tcode{get()} yields the value \tcode{u.get()}
2449-
yielded before the construction. \tcode{u.get() == nullptr}.
2449+
yielded before the construction. \tcode{u.get() == nullptr} is \tcode{true}.
24502450
\tcode{get_deleter()} returns a reference
24512451
to the stored deleter that was constructed from
24522452
\tcode{u.get_deleter()}. If \tcode{D} is a reference type then
@@ -2492,7 +2492,7 @@
24922492
\pnum
24932493
\ensures
24942494
\tcode{get()} yields the value \tcode{u.get()}
2495-
yielded before the construction. \tcode{u.get() == nullptr}.
2495+
yielded before the construction. \tcode{u.get() == nullptr} is \tcode{true}.
24962496
\tcode{get_deleter()} returns a reference
24972497
to the stored deleter that was constructed from
24982498
\tcode{u.get_deleter()}.
@@ -2549,8 +2549,8 @@
25492549

25502550
\pnum
25512551
\ensures
2552-
If \tcode{this != addressof(u)},
2553-
\tcode{u.get() == nullptr},
2552+
If \tcode{this != addressof(u)} is \tcode{true},
2553+
\tcode{u.get() == nullptr} is \tcode{true},
25542554
otherwise \tcode{u.get()} is unchanged.
25552555

25562556
\pnum
@@ -2588,7 +2588,7 @@
25882588

25892589
\pnum
25902590
\ensures
2591-
\tcode{u.get() == nullptr}.
2591+
\tcode{u.get() == nullptr} is \tcode{true}.
25922592

25932593
\pnum
25942594
\returns
@@ -2607,7 +2607,7 @@
26072607

26082608
\pnum
26092609
\ensures
2610-
\tcode{get() == nullptr}.
2610+
\tcode{get() == nullptr} is \tcode{true}.
26112611

26122612
\pnum
26132613
\returns
@@ -2644,7 +2644,7 @@
26442644
\begin{itemdescr}
26452645
\pnum
26462646
\expects
2647-
\tcode{get() != nullptr}.
2647+
\tcode{get() != nullptr} is \tcode{true}.
26482648

26492649
\pnum
26502650
\returns
@@ -2700,7 +2700,7 @@
27002700
\begin{itemdescr}
27012701
\pnum
27022702
\ensures
2703-
\tcode{get() == nullptr}.
2703+
\tcode{get() == nullptr} is \tcode{true}.
27042704

27052705
\pnum
27062706
\returns
@@ -2726,7 +2726,7 @@
27262726

27272727
\pnum
27282728
\ensures
2729-
\tcode{get() == p}.
2729+
\tcode{get() == p} is \tcode{true}.
27302730
\begin{note}
27312731
The postcondition does not hold if the call to \tcode{get_deleter()}
27322732
destroys \tcode{*this} since \tcode{this->get()} is no longer a valid expression.

0 commit comments

Comments
 (0)