| //===----------------------------------------------------------------------===// |
| // ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure |
| // This file is distributed under the University of Illinois Open Source |
| // License. See LICENSE.TXT for details. |
| //===----------------------------------------------------------------------===// |
| // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, |
| // class Alloc = allocator<pair<const Key, T>>> |
| // void reserve(size_type n); |
| void test(const std::unordered_map<int, std::string>& c) |
| assert(c.at(1) == "one"); |
| assert(c.at(2) == "two"); |
| assert(c.at(3) == "three"); |
| assert(c.at(4) == "four"); |
| typedef std::unordered_map<int, std::string> C; |
| typedef std::pair<int, std::string> P; |
| C c(a, a + sizeof(a)/sizeof(a[0])); |
| assert(c.bucket_count() >= 5); |
| assert(c.bucket_count() == 5); |
| assert(c.bucket_count() >= 2); |
| assert(c.bucket_count() == 17); |