Skip to content

Commit afa9ade

Browse files
committed
[vector.bool.pspc] Break out into its own subclause
This change is consistent with specification of nested classes elsewhere in the standard, and allows better use of qualified names in the declaration of member functions in their own specification.
1 parent 310242f commit afa9ade

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

source/containers.tex

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10489,21 +10489,8 @@
1048910489
using reverse_iterator = std::reverse_iterator<iterator>;
1049010490
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
1049110491

10492-
// bit reference
10493-
class @\libmember{reference}{vector<bool>}@ {
10494-
public:
10495-
constexpr reference(const reference& x) noexcept;
10496-
constexpr ~reference();
10497-
constexpr reference& operator=(bool x) noexcept;
10498-
constexpr reference& operator=(const reference& x) noexcept;
10499-
constexpr const reference& operator=(bool x) const noexcept;
10500-
constexpr operator bool() const noexcept;
10501-
constexpr void flip() noexcept; // flips the bit
10502-
10503-
friend constexpr void swap(reference x, reference y) noexcept;
10504-
friend constexpr void swap(reference x, bool& y) noexcept;
10505-
friend constexpr void swap(bool& x, reference y) noexcept;
10506-
};
10492+
// \ref{vector.bool.reference}, bit reference
10493+
class reference;
1050710494

1050810495
// construct/copy/destroy
1050910496
constexpr vector() noexcept(noexcept(Allocator())) : vector(Allocator()) { }
@@ -10607,13 +10594,35 @@
1060710594
of \tcode{bool} values. A space-optimized representation of bits is
1060810595
recommended instead.
1060910596

10597+
\rSec3[vector.bool.reference]{Class \tcode{vector<bool>::reference}}%
1061010598
\pnum
1061110599
\tcode{reference}
1061210600
is a class that simulates a reference to a single bit in the sequence.
1061310601

10602+
\indexlibrarymember{reference}{vector<bool>}%
10603+
\begin{codeblock}
10604+
namespace std {
10605+
template<size_t N>
10606+
class vector<bool>::reference {
10607+
public:
10608+
constexpr reference(const reference& x) noexcept;
10609+
constexpr ~reference();
10610+
constexpr reference& operator=(bool x) noexcept;
10611+
constexpr reference& operator=(const reference& x) noexcept;
10612+
constexpr const reference& operator=(bool x) const noexcept;
10613+
constexpr operator bool() const noexcept;
10614+
constexpr void flip() noexcept; // flips the bit
10615+
10616+
friend constexpr void swap(reference x, reference y) noexcept;
10617+
friend constexpr void swap(reference x, bool& y) noexcept;
10618+
friend constexpr void swap(bool& x, reference y) noexcept;
10619+
};
10620+
}
10621+
\end{codeblock}
10622+
1061410623
\indexlibraryctor{vector<bool>::reference}%
1061510624
\begin{itemdecl}
10616-
constexpr reference::reference(const reference& x) noexcept;
10625+
constexpr reference(const reference& x) noexcept;
1061710626
\end{itemdecl}
1061810627

1061910628
\begin{itemdescr}
@@ -10624,7 +10633,7 @@
1062410633

1062510634
\indexlibrarydtor{vector<bool>::reference}%
1062610635
\begin{itemdecl}
10627-
constexpr reference::~reference();
10636+
constexpr ~reference();
1062810637
\end{itemdecl}
1062910638

1063010639
\begin{itemdescr}
@@ -10635,9 +10644,9 @@
1063510644

1063610645
\indexlibrarymember{operator=}{vector<bool>::reference}%
1063710646
\begin{itemdecl}
10638-
constexpr reference& reference::operator=(bool x) noexcept;
10639-
constexpr reference& reference::operator=(const reference& x) noexcept;
10640-
constexpr const reference& reference::operator=(bool x) const noexcept;
10647+
constexpr reference& operator=(bool x) noexcept;
10648+
constexpr reference& operator=(const reference& x) noexcept;
10649+
constexpr const reference& operator=(bool x) const noexcept;
1064110650
\end{itemdecl}
1064210651

1064310652
\begin{itemdescr}
@@ -10653,7 +10662,7 @@
1065310662

1065410663
\indexlibrarymember{flip}{vector<bool>::reference}%
1065510664
\begin{itemdecl}
10656-
constexpr void reference::flip() noexcept;
10665+
constexpr void flip() noexcept;
1065710666
\end{itemdecl}
1065810667

1065910668
\begin{itemdescr}
@@ -10681,7 +10690,7 @@
1068110690
\end{codeblock}
1068210691
\end{itemdescr}
1068310692

10684-
10693+
\rSec3[vector.bool.members]{\tcode{vector<bool>} members}
1068510694

1068610695
\indexlibrarymember{flip}{vector<bool>}%
1068710696
\begin{itemdecl}

0 commit comments

Comments
 (0)