empty.pass.cpp 551 B

12345678910111213141516171819202122232425
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // <stack>
  10. // bool empty() const;
  11. #include <stack>
  12. #include <cassert>
  13. int main()
  14. {
  15. std::stack<int> q;
  16. assert(q.empty());
  17. q.push(1);
  18. assert(!q.empty());
  19. q.pop();
  20. assert(q.empty());
  21. }