summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/associative/multimap/empty.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/containers/associative/multimap/empty.pass.cpp')
-rw-r--r--libcxx/test/std/containers/associative/multimap/empty.pass.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/associative/multimap/empty.pass.cpp b/libcxx/test/std/containers/associative/multimap/empty.pass.cpp
new file mode 100644
index 00000000000..2384960d10d
--- /dev/null
+++ b/libcxx/test/std/containers/associative/multimap/empty.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <map>
+
+// class multimap
+
+// bool empty() const;
+
+#include <map>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+ {
+ typedef std::multimap<int, double> M;
+ M m;
+ assert(m.empty());
+ m.insert(M::value_type(1, 1.5));
+ assert(!m.empty());
+ m.clear();
+ assert(m.empty());
+ }
+#if __cplusplus >= 201103L
+ {
+ typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
+ M m;
+ assert(m.empty());
+ m.insert(M::value_type(1, 1.5));
+ assert(!m.empty());
+ m.clear();
+ assert(m.empty());
+ }
+#endif
+}
OpenPOWER on IntegriCloud