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 //===----------------------------------------------------------------------===//
12 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
13 // class Alloc = allocator<pair<const Key, T>>>
14 // class unordered_multimap
16 // iterator begin() {return __table_.begin();}
17 // iterator end() {return __table_.end();}
18 // const_iterator begin() const {return __table_.begin();}
19 // const_iterator end() const {return __table_.end();}
20 // const_iterator cbegin() const {return __table_.begin();}
21 // const_iterator cend() const {return __table_.end();}
23 #include <unordered_map>
27 #include "test_macros.h"
32 typedef std::unordered_multimap<int, std::string> C;
33 typedef std::pair<int, std::string> P;
43 C c(a, a + sizeof(a)/sizeof(a[0]));
44 LIBCPP_ASSERT(c.bucket_count() == 7);
45 assert(c.size() == 6);
46 assert(std::distance(c.begin(), c.end()) == c.size());
47 assert(std::distance(c.cbegin(), c.cend()) == c.size());
48 C::iterator i = c.begin();
50 assert(i->second == "ONE");
54 typedef std::unordered_multimap<int, std::string> C;
55 typedef std::pair<int, std::string> P;
65 const C c(a, a + sizeof(a)/sizeof(a[0]));
66 LIBCPP_ASSERT(c.bucket_count() == 7);
67 assert(c.size() == 6);
68 assert(std::distance(c.begin(), c.end()) == c.size());
69 assert(std::distance(c.cbegin(), c.cend()) == c.size());