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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
13 // void swap(any &, any &) noexcept
15 // swap(...) just wraps any::swap(...). That function is tested elsewhere.
20 #include "test_macros.h"
27 static_assert(noexcept(swap(a
, a
)), "swap(any&, any&) must be noexcept");
35 assert(std::any_cast
<int>(a1
) == 2);
36 assert(std::any_cast
<int>(a2
) == 1);