empty.pass.cpp 629 B

12345678910111213141516171819202122232425262728
  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. // bool empty() const;
  10. #include <queue>
  11. #include <cassert>
  12. #include "test_macros.h"
  13. int main(int, char**)
  14. {
  15. std::queue<int> q;
  16. assert(q.empty());
  17. q.push(1);
  18. assert(!q.empty());
  19. q.pop();
  20. assert(q.empty());
  21. return 0;
  22. }