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 // void clear() noexcept;
19 #include "test_macros.h"
20 #include "min_allocator.h"
25 typedef std::map<int, double> M;
26 typedef std::pair<int, double> P;
38 M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
39 assert(m.size() == 8);
40 ASSERT_NOEXCEPT(m.clear());
42 assert(m.size() == 0);
44 #if TEST_STD_VER >= 11
46 typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
47 typedef std::pair<int, double> P;
59 M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
60 assert(m.size() == 8);
61 ASSERT_NOEXCEPT(m.clear());
63 assert(m.size() == 0);