opnsense-src/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp

32 lines
721 B
C++
Raw Normal View History

2015-09-06 14:46:46 -04:00
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <stack>
// void swap(stack& c)
// noexcept(__is_nothrow_swappable<container_type>::value);
// This tests a conforming extension
// UNSUPPORTED: c++98, c++03
2015-09-06 14:46:46 -04:00
#include <stack>
#include <cassert>
#include "MoveOnly.h"
int main()
{
{
typedef std::stack<MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
}