move_assign_noexcept.pass.cpp 796 B

1234567891011121314151617181920212223242526272829303132
  1. //===----------------------------------------------------------------------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // <queue>
  9. // queue& operator=(queue&& c)
  10. // noexcept(is_nothrow_move_assignable<container_type>::value);
  11. // This tests a conforming extension
  12. // UNSUPPORTED: c++98, c++03
  13. #include <queue>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. #include "MoveOnly.h"
  17. int main(int, char**)
  18. {
  19. {
  20. typedef std::queue<MoveOnly> C;
  21. static_assert(std::is_nothrow_move_assignable<C>::value, "");
  22. }
  23. return 0;
  24. }