1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template<Iterator Iter1, Iterator Iter2>
12 // requires HasSwap<Iter1::reference, Iter2::reference>
14 // iter_swap(Iter1 a, Iter2 b);
19 #include "test_macros.h"
22 constexpr bool test_swap_constexpr()
26 std::iter_swap(&i
, &j
);
27 return i
== 2 && j
== 1;
29 #endif // TEST_STD_VER > 17
35 std::iter_swap(&i
, &j
);
40 static_assert(test_swap_constexpr());
41 #endif // TEST_STD_VER > 17