Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <unordered_set> |
| 11 | |
| 12 | // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, |
| 13 | // class Alloc = allocator<Value>> |
| 14 | // class unordered_set |
| 15 | |
| 16 | // void insert(initializer_list<value_type> il); |
| 17 | |
| 18 | #include <unordered_set> |
| 19 | #include <cassert> |
| 20 | |
| 21 | #include "../../iterators.h" |
| 22 | |
| 23 | int main() |
| 24 | { |
Howard Hinnant | 73d21a4 | 2010-09-04 23:28:19 +0000 | [diff] [blame^] | 25 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 26 | { |
| 27 | typedef std::unordered_set<int> C; |
| 28 | typedef int P; |
| 29 | C c; |
| 30 | c.insert( |
| 31 | { |
| 32 | P(1), |
| 33 | P(2), |
| 34 | P(3), |
| 35 | P(4), |
| 36 | P(1), |
| 37 | P(2) |
| 38 | } |
| 39 | ); |
| 40 | assert(c.size() == 4); |
| 41 | assert(c.count(1) == 1); |
| 42 | assert(c.count(2) == 1); |
| 43 | assert(c.count(3) == 1); |
| 44 | assert(c.count(4) == 1); |
| 45 | } |
Howard Hinnant | 73d21a4 | 2010-09-04 23:28:19 +0000 | [diff] [blame^] | 46 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 47 | } |