eq.pass.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. // template <class T, class Container>
  10. // bool operator==(const queue<T, Container>& x,const queue<T, Container>& y);
  11. //
  12. // template <class T, class Container>
  13. // bool operator!=(const queue<T, Container>& x,const queue<T, Container>& y);
  14. #include <queue>
  15. #include <cassert>
  16. #include "test_macros.h"
  17. template <class C>
  18. C
  19. make(int n)
  20. {
  21. C c;
  22. for (int i = 0; i < n; ++i)
  23. c.push(i);
  24. return c;
  25. }
  26. int main(int, char**)
  27. {
  28. std::queue<int> q1 = make<std::queue<int> >(5);
  29. std::queue<int> q2 = make<std::queue<int> >(10);
  30. std::queue<int> q1_save = q1;
  31. std::queue<int> q2_save = q2;
  32. assert(q1 == q1_save);
  33. assert(q1 != q2);
  34. assert(q2 == q2_save);
  35. return 0;
  36. }