From 118e7841043d12a8e95471594e675d5d050c87b3 Mon Sep 17 00:00:00 2001 From: Mikail Bagishov Date: Sun, 22 Jun 2025 18:21:27 +0300 Subject: [PATCH 1/2] [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 ` is true` instead of simply ``. It seems that `std::unique_ptr` specification does not comply with that. This PR updates all such places that I have spotted. --- source/memory.tex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index aad6384825..ac0d91c75c 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -2446,7 +2446,7 @@ \pnum \ensures \tcode{get()} yields the value \tcode{u.get()} -yielded before the construction. \tcode{u.get() == nullptr}. +yielded before the construction. \tcode{u.get() == nullptr} is \tcode{true}. \tcode{get_deleter()} returns a reference to the stored deleter that was constructed from \tcode{u.get_deleter()}. If \tcode{D} is a reference type then @@ -2492,7 +2492,7 @@ \pnum \ensures \tcode{get()} yields the value \tcode{u.get()} -yielded before the construction. \tcode{u.get() == nullptr}. +yielded before the construction. \tcode{u.get() == nullptr} is \tcode{true}. \tcode{get_deleter()} returns a reference to the stored deleter that was constructed from \tcode{u.get_deleter()}. @@ -2549,8 +2549,8 @@ \pnum \ensures -If \tcode{this != addressof(u)}, -\tcode{u.get() == nullptr}, +If \tcode{this != addressof(u)} is \tcode{true}, +\tcode{u.get() == nullptr} is \tcode{true}, otherwise \tcode{u.get()} is unchanged. \pnum @@ -2588,7 +2588,7 @@ \pnum \ensures -\tcode{u.get() == nullptr}. +\tcode{u.get() == nullptr} is \tcode{true}. \pnum \returns @@ -2607,7 +2607,7 @@ \pnum \ensures -\tcode{get() == nullptr}. +\tcode{get() == nullptr} is \tcode{true}. \pnum \returns @@ -2644,7 +2644,7 @@ \begin{itemdescr} \pnum \expects -\tcode{get() != nullptr}. +\tcode{get() != nullptr} is \tcode{true}. \pnum \returns @@ -2700,7 +2700,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{get() == nullptr}. +\tcode{get() == nullptr} is \tcode{true}. \pnum \returns @@ -2726,7 +2726,7 @@ \pnum \ensures -\tcode{get() == p}. +\tcode{get() == p} is \tcode{true}. \begin{note} The postcondition does not hold if the call to \tcode{get_deleter()} destroys \tcode{*this} since \tcode{this->get()} is no longer a valid expression. From 1f2cbc2fcafe59a126bfcf38ce30941fd6b022a0 Mon Sep 17 00:00:00 2001 From: Mikail Bagishov Date: Sun, 22 Jun 2025 18:41:29 +0300 Subject: [PATCH 2/2] Another set of changes --- source/memory.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index ac0d91c75c..fdb42c2101 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -2330,7 +2330,7 @@ \pnum \ensures -\tcode{get() == nullptr}. \tcode{get_deleter()} +\tcode{get() == nullptr} is \tcode{true}. \tcode{get_deleter()} returns a reference to the stored deleter. \end{itemdescr} @@ -2358,7 +2358,7 @@ \pnum \ensures -\tcode{get() == p}. \tcode{get_deleter()} +\tcode{get() == p} is \tcode{true}. \tcode{get_deleter()} returns a reference to the stored deleter. \end{itemdescr} @@ -2390,7 +2390,7 @@ \pnum \ensures -\tcode{get() == p}. +\tcode{get() == p} is \tcode{true}. \tcode{get_deleter()} returns a reference to the stored deleter. If \tcode{D} is a reference type then \tcode{get_deleter()} returns a reference to the lvalue \tcode{d}.