-
Notifications
You must be signed in to change notification settings - Fork 2
Update wording. WIP #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -603,34 +603,6 @@ the allocators are not swapped. | |||||
|
|
||||||
| 4. _Throws_: Any exception thrown by the called function. | ||||||
|
|
||||||
| <!-- | ||||||
| ```cpp | ||||||
| constexpr void swap(protocol& lhs, protocol& rhs) noexcept(noexcept(lhs.swap(rhs))); | ||||||
| ``` | ||||||
|
|
||||||
| 4. _Effects_: Equivalent to lhs.swap(rhs). | ||||||
|
|
||||||
| ?? | ||||||
|
|
||||||
| ```cpp | ||||||
| template<class I, class Allocator> | ||||||
| void swap(protocol<I, Allocator>& x, protocol<I, Allocator>& y) | ||||||
| noexcept(noexcept(x.swap(y))); | ||||||
| ``` | ||||||
|
|
||||||
| 4. _Effects_: Calls `x.swap(y)`. | ||||||
| --> | ||||||
|
|
||||||
| <!-- | ||||||
| #### X.Y.9 Allocator support [protocol.alloc] | ||||||
|
|
||||||
| ```cpp | ||||||
| constexpr allocator_type get_allocator() const; | ||||||
| ``` | ||||||
|
|
||||||
| 1. _Returns_: `alloc`. | ||||||
| --> | ||||||
|
|
||||||
| ### X.Z Class template protocol_view [protocol_view] | ||||||
|
|
||||||
| #### X.Z.1 Class template protocol_view general [protocol_view.general] | ||||||
|
|
@@ -662,14 +634,18 @@ class protocol_view { | |||||
| template<class T> | ||||||
| constexpr protocol_view(T& t) noexcept; | ||||||
|
|
||||||
| template<class T> | ||||||
| protocol_view(T&&) = delete; | ||||||
|
|
||||||
| template<class Allocator> | ||||||
| constexpr protocol_view(protocol<I, Allocator>& p) noexcept; | ||||||
|
|
||||||
| template<class Allocator> | ||||||
| protocol_view(protocol<I, Allocator>&&) = delete; | ||||||
|
|
||||||
| constexpr protocol_view(const protocol_view&) noexcept = default; | ||||||
|
|
||||||
| constexpr protocol_view& operator=(const protocol_view&) noexcept = default; | ||||||
| private: | ||||||
| I* data_; // exposition only | ||||||
| }; | ||||||
|
|
||||||
| template <class I> | ||||||
|
|
@@ -680,19 +656,31 @@ class protocol_view<const I> { | |||||
| template<class T> | ||||||
| constexpr protocol_view(const T& t) noexcept; | ||||||
|
|
||||||
| template<class T> | ||||||
| protocol_view(const T&&) = delete; | ||||||
|
|
||||||
| template<class Allocator> | ||||||
| constexpr protocol_view(protocol<I, Allocator>& p) noexcept; | ||||||
|
|
||||||
| template<class Allocator> | ||||||
| protocol_view(protocol<I, Allocator>&&) = delete; | ||||||
|
|
||||||
| template<class Allocator> | ||||||
| constexpr protocol_view(const protocol<I, Allocator>& p) noexcept; | ||||||
|
|
||||||
| template<class Allocator> | ||||||
| protocol_view(const protocol<I, Allocator>&&) = delete; | ||||||
|
|
||||||
| constexpr protocol_view(const protocol_view<I>& view) noexcept; | ||||||
|
|
||||||
| protocol_view(protocol_view<I>&&) = delete; | ||||||
|
|
||||||
| constexpr protocol_view(const protocol_view&) noexcept = default; | ||||||
|
|
||||||
| constexpr protocol_view& operator=(const protocol_view&) noexcept = default; | ||||||
| private: | ||||||
| const I* data_; // exposition only | ||||||
| //private: | ||||||
| //void* object_ptr_; // exposition only | ||||||
| //const void* dispatch_table_; // exposition only | ||||||
| }; | ||||||
| ``` | ||||||
|
|
||||||
|
|
@@ -707,24 +695,38 @@ constexpr protocol_view(T& t) noexcept; | |||||
|
|
||||||
| 2. _Preconditions_: `t` shall refer to an object that is valid and remains valid for the lifetime of `*this`. | ||||||
|
|
||||||
| 3. _Effects_: Initializes `data_` to `std::addressof(t)`. | ||||||
| 3. _Effects_: Stores a reference to the object `t`. | ||||||
|
|
||||||
| ```cpp | ||||||
| template<class T> | ||||||
| protocol_view(T&&) = delete; | ||||||
| ``` | ||||||
|
|
||||||
| 4. _Remarks_: Rvalue references are deleted to prevent dangling references to temporary objects. | ||||||
|
|
||||||
| ```cpp | ||||||
| template<class Allocator> | ||||||
| constexpr protocol_view(protocol<I, Allocator>& p) noexcept; | ||||||
| ``` | ||||||
|
|
||||||
| 4. _Preconditions_: protocol `p` is not valueless. | ||||||
| 4. _Preconditions_: protocol `p` is not valueless after move. | ||||||
|
||||||
| 4. _Preconditions_: protocol `p` is not valueless after move. | |
| 5. _Preconditions_: protocol `p` is not valueless after move. |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In [protocol_view.const.ctor], numbering is inconsistent after the new deleted rvalue overloads (e.g., "4. Preconditions" appears again after "4. Remarks", then jumps to "6."/"9."/"10."). Please renumber the items across this subclause to avoid duplicate or skipped item numbers.
| 4. _Preconditions_: protocol `p` is not valueless after move. | |
| 5. _Preconditions_: protocol `p` is not valueless after move. |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remark for deleting protocol_view(protocol_view<I>&&) says it prevents dangling references, but moving/copying a protocol_view does not create a dangling reference to the underlying object (it still refers to the same object). Either adjust the rationale (if the intent is different) or consider allowing construction from an rvalue protocol_view<I> since it is effectively the same as copying.
| 13. _Remarks_: Rvalue references are deleted to prevent dangling references. | |
| 13. _Remarks_: This constructor is deleted to disallow initialization from temporary `protocol_view` objects. |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The stored reference is not null" is internally inconsistent: references cannot be null. Either describe the representation as storing a pointer (and keep a non-null precondition), or reword the precondition to only require that the referenced object remains valid for the view’s lifetime.
| 2. _Preconditions_: The stored reference is not null and refers to a valid object. | |
| 2. _Preconditions_: The referenced object is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The synopsis now has the representation for
protocol_view<const I>commented out (including theprivate:label), andprotocol_view<I>no longer shows any exposition-only state. This makes later wording like "stored reference"/member-access preconditions harder to interpret. Consider restoring a consistentprivate:section with exposition-only members (as done forprotocolin [protocol.syn]) or removing representation-dependent wording elsewhere.