Upstream version 8.36.169.0
[platform/framework/web/crosswalk.git] / src / third_party / libc++ / trunk / test / containers / unord / unord.map / unord.map.cnstr / assign_copy.pass.cpp
index 928377b..fa01056 100644 (file)
@@ -73,6 +73,24 @@ int main()
         assert(c.max_load_factor() == 1);
     }
     {
+        typedef std::unordered_map<int, std::string> C;
+        typedef std::pair<const int, std::string> P;
+        const P a[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C *p = &c;
+        c = *p;
+        assert(c.size() == 4);
+        assert(std::is_permutation(c.begin(), c.end(), a));
+    }
+    {
         typedef other_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,