Skip to content

Commit 652ea19

Browse files
committed
[concepts.swappable] Correct example
1 parent 90ec5bc commit 652ea19

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/concepts.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,16 +706,18 @@
706706
User code can ensure that the evaluation of \tcode{swap} calls
707707
is performed in an appropriate context under the various conditions as follows:
708708
\begin{codeblock}
709+
#include <cassert>
710+
#include <concepts>
709711
#include <utility>
710712

711-
template <class T, SwappableWith<T> U>
713+
template <class T, std::SwappableWith<T> U>
712714
void value_swap(T&& t, U&& u) {
713715
using std::swap;
714716
swap(std::forward<T>(t), std::forward<U>(u)); // OK: uses ``swappable with'' conditions
715717
// for rvalues and lvalues
716718
}
717719

718-
template <Swappable T>
720+
template <std::Swappable T>
719721
void lv_swap(T& t1, T& t2) {
720722
using std::swap;
721723
swap(t1, t2); // OK: uses swappable conditions for

0 commit comments

Comments
 (0)