@@ -10480,13 +10480,17 @@
1048010480 // bit reference
1048110481 class @\libmember{reference}{vector<bool>}@ {
1048210482 public:
10483- constexpr reference(const reference&) = default ;
10483+ constexpr reference(const reference&) noexcept ;
1048410484 constexpr ~reference();
1048510485 constexpr operator bool() const noexcept;
1048610486 constexpr reference& operator=(bool x) noexcept;
1048710487 constexpr reference& operator=(const reference& x) noexcept;
1048810488 constexpr const reference& operator=(bool x) const noexcept;
1048910489 constexpr void flip() noexcept; // flips the bit
10490+
10491+ friend constexpr void swap(reference x, reference y) noexcept;
10492+ friend constexpr void swap(reference x, bool& y) noexcept;
10493+ friend constexpr void swap(bool& x, reference y) noexcept;
1049010494 };
1049110495
1049210496 // construct/copy/destroy
1057210576 constexpr void swap(vector&)
1057310577 noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
1057410578 allocator_traits<Allocator>::is_always_equal::value);
10575- static constexpr void swap(reference x, reference y) noexcept;
1057610579 constexpr void flip() noexcept; // flips all bits
1057710580 constexpr void clear() noexcept;
1057810581 };
@@ -10594,39 +10597,89 @@
1059410597
1059510598\pnum
1059610599\tcode{reference}
10597- is a class that simulates the behavior of references of a single bit in
10598- \tcode{vector<bool>}. The conversion function returns \tcode{true}
10599- when the bit is set, and \tcode{false} otherwise. The assignment operators
10600- set the bit when the argument is (convertible to) \tcode{true} and
10601- clear it otherwise. \tcode{flip} reverses the state of the bit.
10600+ is a class that simulates a reference to a single bit in the sequence.
1060210601
10603- \indexlibrarymember{flip}{ vector<bool>}%
10602+ \indexlibraryctor{ vector<bool>::reference }%
1060410603\begin{itemdecl}
10605- constexpr void flip( ) noexcept;
10604+ constexpr reference::reference(const reference& x ) noexcept;
1060610605\end{itemdecl}
1060710606
1060810607\begin{itemdescr}
1060910608\pnum
1061010609\effects
10611- Replaces each element in the container with its complement .
10610+ Initializes \tcode{*this} to refer to the same bit as \tcode{x} .
1061210611\end{itemdescr}
1061310612
10614- \indexlibrarymember{swap}{ vector<bool>}%
10613+ \indexlibrarydtor{ vector<bool>::reference }%
1061510614\begin{itemdecl}
10616- static constexpr void swap( reference x, reference y) noexcept ;
10615+ constexpr reference::~ reference() ;
1061710616\end{itemdecl}
1061810617
1061910618\begin{itemdescr}
1062010619\pnum
1062110620\effects
10622- Exchanges the contents of \tcode{x} and \tcode{y} as if by:
10621+ None.
10622+ \end{itemdescr}
10623+
10624+ \indexlibrarymember{operator=}{vector<bool>::reference}%
10625+ \begin{itemdecl}
10626+ constexpr reference& reference::operator=(bool x) noexcept;
10627+ constexpr reference& reference::operator=(const reference& x) noexcept;
10628+ constexpr const reference& reference::operator=(bool x) const noexcept;
10629+ \end{itemdecl}
10630+
10631+ \begin{itemdescr}
10632+ \pnum
10633+ \effects
10634+ Sets the bit referred to by \tcode{*this} when \tcode{bool(x)} is \tcode{true},
10635+ and clears it otherwise.
10636+
10637+ \pnum
10638+ \returns
10639+ \tcode{*this}.
10640+ \end{itemdescr}
10641+
10642+ \indexlibrarymember{flip}{vector<bool>::reference}%
10643+ \begin{itemdecl}
10644+ constexpr void reference::flip() noexcept;
10645+ \end{itemdecl}
10646+
10647+ \begin{itemdescr}
10648+ \pnum
10649+ \effects
10650+ Equivalent to \tcode{*this = !*this}.
10651+ \end{itemdescr}
10652+
10653+ \indexlibrarymember{swap}{vector<bool>::reference}%
10654+ \begin{itemdecl}
10655+ constexpr void swap(reference x, reference y) noexcept;
10656+ constexpr void swap(reference x, bool& y) noexcept;
10657+ constexpr void swap(bool& x, reference y) noexcept;
10658+ \end{itemdecl}
10659+
10660+ \begin{itemdescr}
10661+ \pnum
10662+ \effects
10663+ Exchanges the values denoted by \tcode{x} and \tcode{y} as if by:
1062310664
1062410665\begin{codeblock}
1062510666bool b = x;
1062610667x = y;
1062710668y = b;
1062810669\end{codeblock}
10670+ \end{itemdescr}
1062910671
10672+
10673+
10674+ \indexlibrarymember{flip}{vector<bool>}%
10675+ \begin{itemdecl}
10676+ constexpr void flip() noexcept;
10677+ \end{itemdecl}
10678+
10679+ \begin{itemdescr}
10680+ \pnum
10681+ \effects
10682+ Replaces each element in the container with its complement.
1063010683\end{itemdescr}
1063110684
1063210685\begin{itemdecl}
0 commit comments