1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // size_type size() const noexcept;
19 #include "test_macros.h"
20 #include "min_allocator.h"
25 typedef std::deque<int> C;
27 ASSERT_NOEXCEPT(c.size());
28 assert(c.size() == 0);
29 c.push_back(C::value_type(2));
30 assert(c.size() == 1);
31 c.push_back(C::value_type(1));
32 assert(c.size() == 2);
33 c.push_back(C::value_type(3));
34 assert(c.size() == 3);
36 assert(c.size() == 2);
38 assert(c.size() == 1);
40 assert(c.size() == 0);
42 #if TEST_STD_VER >= 11
44 typedef std::deque<int, min_allocator<int>> C;
46 ASSERT_NOEXCEPT(c.size());
47 assert(c.size() == 0);
48 c.push_back(C::value_type(2));
49 assert(c.size() == 1);
50 c.push_back(C::value_type(1));
51 assert(c.size() == 2);
52 c.push_back(C::value_type(3));
53 assert(c.size() == 3);
55 assert(c.size() == 2);
57 assert(c.size() == 1);
59 assert(c.size() == 0);