swap_noexcept.pass.cpp (830B)
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(priority_queue& c) 13 // noexcept(__is_nothrow_swappable<container_type>::value && 14 // __is_nothrow_swappable<Compare>::value); 15 16 // This tests a conforming extension 17 18 // UNSUPPORTED: c++98, c++03 19 20 #include <queue> 21 #include <utility> 22 #include <cassert> 23 24 #include "MoveOnly.h" 25 26 int main() 27 { 28 { 29 typedef std::priority_queue<MoveOnly> C; 30 static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); 31 } 32 }