Skip to content

Commit 9505870

Browse files
burblebeetkoeppe
authored andcommitted
LWG3204 sub_match::swap only swaps the base class
1 parent b386fd0 commit 9505870

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

source/regex.tex

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,8 @@
18671867
int compare(const sub_match& s) const;
18681868
int compare(const string_type& s) const;
18691869
int compare(const value_type* s) const;
1870+
1871+
void swap(sub_match& s) noexcept(@\seebelow@);
18701872
};
18711873
}
18721874
\end{codeblock}
@@ -1952,6 +1954,31 @@
19521954
\tcode{str().compare(s)}.
19531955
\end{itemdescr}
19541956

1957+
\indexlibrarymember{sub_match}{swap}%
1958+
\begin{itemdecl}
1959+
void swap(sub_match& s) noexcept(@\seebelow@);
1960+
\end{itemdecl}
1961+
1962+
\begin{itemdescr}
1963+
\pnum
1964+
\expects
1965+
\tcode{BidirectionalIterator} meets
1966+
the \oldconcept{Swappable} requirements\iref{swappable.requirements}.
1967+
1968+
\pnum
1969+
\effects
1970+
Equivalent to:
1971+
\begin{codeblock}
1972+
this->pair<BidirectionalIterator, BidirectionalIterator>::swap(s);
1973+
std::swap(matched, s.matched);
1974+
\end{codeblock}
1975+
1976+
\pnum
1977+
\remarks
1978+
The exception specification is equivalent to
1979+
\tcode{is_nothrow_swappable_v<BidirectionalIter\-ator>}.
1980+
\end{itemdescr}
1981+
19551982
\rSec2[re.submatch.op]{Non-member operators}
19561983

19571984
\pnum

0 commit comments

Comments
 (0)