blob: f29f5e368ef5714d5a062ef11fbdb3678b24cffa [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
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
23int main()
24{
Howard Hinnant73d21a42010-09-04 23:28:19 +000025#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000026 {
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 Hinnant73d21a42010-09-04 23:28:19 +000046#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000047}