ctor_default.pass.cpp 662 B

12345678910111213141516171819202122232425262728
  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. // <stack>
  10. // stack();
  11. #include <stack>
  12. #include <vector>
  13. #include <cassert>
  14. #include "test_allocator.h"
  15. int main()
  16. {
  17. std::stack<int, std::vector<int, limited_allocator<int, 10> > > q;
  18. assert(q.size() == 0);
  19. q.push(1);
  20. q.push(2);
  21. assert(q.size() == 2);
  22. assert(q.top() == 2);
  23. }