move_assign_noexcept.pass.cpp 743 B

123456789101112131415161718192021222324252627282930
  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. // <queue>
  10. // queue& operator=(queue&& c)
  11. // noexcept(is_nothrow_move_assignable<container_type>::value);
  12. // This tests a conforming extension
  13. #include <queue>
  14. #include <cassert>
  15. #include "MoveOnly.h"
  16. int main()
  17. {
  18. #if __has_feature(cxx_noexcept)
  19. {
  20. typedef std::queue<MoveOnly> C;
  21. static_assert(std::is_nothrow_move_assignable<C>::value, "");
  22. }
  23. #endif
  24. }