xref: /llvm-project/libcxx/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp (revision 2cd516e049e4fc1dd8e33c6990841f5b6300ef6c)
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <queue>
11 
12 // void swap(queue& c)
13 //     noexcept(__is_nothrow_swappable<container_type>::value);
14 
15 // This tests a conforming extension
16 
17 // UNSUPPORTED: c++98, c++03
18 
19 #include <queue>
20 #include <utility>
21 #include <cassert>
22 
23 #include "MoveOnly.h"
24 
25 int main()
26 {
27     {
28         typedef std::queue<MoveOnly> C;
29         static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
30     }
31 }
32