-
Notifications
You must be signed in to change notification settings - Fork 805
[template.bitset.general][vector.bool.pspc] Make subclauses for reference nested classes
#8661
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
Open
AlisdairM
wants to merge
1
commit into
cplusplus:main
Choose a base branch
from
AlisdairM:create_subclause_for_reference_types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10533,22 +10533,8 @@ | |
| namespace std { | ||
| template<size_t N> class bitset { | ||
| public: | ||
| // bit reference | ||
| class reference { | ||
| public: | ||
| constexpr reference(const reference& x) noexcept; | ||
| constexpr ~reference(); | ||
| constexpr reference& operator=(bool x) noexcept; // for \tcode{b[i] = x;} | ||
| constexpr reference& operator=(const reference& x) noexcept; // for \tcode{b[i] = b[j];} | ||
| constexpr const reference& operator=(bool x) const noexcept; | ||
| constexpr operator bool() const noexcept; // for \tcode{x = b[i];} | ||
| constexpr bool operator~() const noexcept; // flips the bit | ||
| constexpr reference& flip() noexcept; // for \tcode{b[i].flip();} | ||
|
|
||
| friend constexpr void swap(reference x, reference y) noexcept; | ||
| friend constexpr void swap(reference x, bool& y) noexcept; | ||
| friend constexpr void swap(bool& x, reference y) noexcept; | ||
| }; | ||
| // \ref{bitset.reference}, bit reference | ||
| class reference; | ||
|
|
||
| // \ref{bitset.cons}, constructors | ||
| constexpr bitset() noexcept; | ||
|
|
@@ -10625,6 +10611,8 @@ | |
| \tcode{bitset<N>} | ||
| describes an object that can store a sequence consisting of a fixed number of | ||
| bits, \tcode{N}. | ||
| The class \tcode{bitset<N>::reference} simulates a reference | ||
| to a single bit in the sequence. | ||
|
|
||
| \pnum | ||
| Each bit represents either the value zero (reset) or one (set). | ||
|
|
@@ -10644,12 +10632,54 @@ | |
| or more bits is the sum of their bit values. | ||
|
|
||
| \pnum | ||
| \tcode{reference} | ||
| is a class that simulates a reference to a single bit in the sequence. | ||
| The functions described in \ref{template.bitset} can report three kinds of | ||
| errors, each associated with a distinct exception: | ||
| \begin{itemize} | ||
| \item | ||
| an | ||
| \term{invalid-argument} | ||
| error is associated with exceptions of type | ||
| \tcode{invalid_argument}\iref{invalid.argument}; | ||
| \indexlibraryglobal{invalid_argument}% | ||
| \item | ||
| an | ||
| \term{out-of-range} | ||
| error is associated with exceptions of type | ||
| \tcode{out_of_range}\iref{out.of.range}; | ||
| \indexlibraryglobal{out_of_range}% | ||
| \item | ||
| an | ||
| \term{overflow} | ||
| error is associated with exceptions of type | ||
| \tcode{overflow_error}\iref{overflow.error}. | ||
| \indexlibraryglobal{overflow_error}% | ||
| \end{itemize} | ||
|
|
||
| \rSec3[bitset.reference]{Class \tcode{bitset<N>::reference}}% | ||
| \indexlibrarymember{reference}{bitset}% | ||
| \begin{codeblock} | ||
| namespace std { | ||
| template<size_t N> class bitset<N>::reference { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put the template-head on a separate line. |
||
| public: | ||
| constexpr reference(const reference& x) noexcept; | ||
| constexpr ~reference(); | ||
| constexpr reference& operator=(bool x) noexcept; // for \tcode{b[i] = x;} | ||
| constexpr reference& operator=(const reference& x) noexcept; // for \tcode{b[i] = b[j];} | ||
| constexpr const reference& operator=(bool x) const noexcept; | ||
| constexpr operator bool() const noexcept; // for \tcode{x = b[i];} | ||
| constexpr bool operator~() const noexcept; // flips the bit | ||
| constexpr reference& flip() noexcept; // for \tcode{b[i].flip();} | ||
|
|
||
| friend constexpr void swap(reference x, reference y) noexcept; | ||
| friend constexpr void swap(reference x, bool& y) noexcept; | ||
| friend constexpr void swap(bool& x, reference y) noexcept; | ||
| }; | ||
| } | ||
| \end{codeblock} | ||
|
|
||
| \indexlibraryctor{bitset::reference}% | ||
| \begin{itemdecl} | ||
| constexpr reference::reference(const reference& x) noexcept; | ||
| constexpr reference(const reference& x) noexcept; | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
|
|
@@ -10660,7 +10690,7 @@ | |
|
|
||
| \indexlibrarydtor{bitset::reference}% | ||
| \begin{itemdecl} | ||
| constexpr reference::~reference(); | ||
| constexpr ~reference(); | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
|
|
@@ -10671,9 +10701,9 @@ | |
|
|
||
| \indexlibrarymember{operator=}{bitset::reference}% | ||
| \begin{itemdecl} | ||
| constexpr reference& reference::operator=(bool x) noexcept; | ||
| constexpr reference& reference::operator=(const reference& x) noexcept; | ||
| constexpr const reference& reference::operator=(bool x) const noexcept; | ||
| constexpr reference& operator=(bool x) noexcept; | ||
| constexpr reference& operator=(const reference& x) noexcept; | ||
| constexpr const reference& operator=(bool x) const noexcept; | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
|
|
@@ -10687,6 +10717,21 @@ | |
| \tcode{*this}. | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{flip}{bitset::reference}% | ||
| \begin{itemdecl} | ||
| constexpr reference& flip() noexcept; | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
| \pnum | ||
| \effects | ||
| Equivalent to \tcode{*this = !*this}. | ||
|
|
||
| \pnum | ||
| \returns | ||
| \tcode{*this}. | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{swap}{bitset::reference}% | ||
| \begin{itemdecl} | ||
| constexpr void swap(reference x, reference y) noexcept; | ||
|
|
@@ -10706,45 +10751,6 @@ | |
| \end{codeblock} | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{flip}{bitset::reference}% | ||
| \begin{itemdecl} | ||
| constexpr reference& reference::flip() noexcept; | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
| \pnum | ||
| \effects | ||
| Equivalent to \tcode{*this = !*this}. | ||
|
|
||
| \pnum | ||
| \returns | ||
| \tcode{*this}. | ||
| \end{itemdescr} | ||
|
|
||
| \pnum | ||
| The functions described in \ref{template.bitset} can report three kinds of | ||
| errors, each associated with a distinct exception: | ||
| \begin{itemize} | ||
| \item | ||
| an | ||
| \term{invalid-argument} | ||
| error is associated with exceptions of type | ||
| \tcode{invalid_argument}\iref{invalid.argument}; | ||
| \indexlibraryglobal{invalid_argument}% | ||
| \item | ||
| an | ||
| \term{out-of-range} | ||
| error is associated with exceptions of type | ||
| \tcode{out_of_range}\iref{out.of.range}; | ||
| \indexlibraryglobal{out_of_range}% | ||
| \item | ||
| an | ||
| \term{overflow} | ||
| error is associated with exceptions of type | ||
| \tcode{overflow_error}\iref{overflow.error}. | ||
| \indexlibraryglobal{overflow_error}% | ||
| \end{itemize} | ||
|
|
||
| \rSec3[bitset.cons]{Constructors} | ||
|
|
||
| \indexlibraryctor{bitset}% | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
please put the template-head on a separate line