[libcxx] r187915 - N3644 support for <unordered_set> and <unordered_map>

Marshall Clow mclow.lists at gmail.com
Wed Aug 7 14:30:45 PDT 2013


Author: marshall
Date: Wed Aug  7 16:30:44 2013
New Revision: 187915

URL: http://llvm.org/viewvc/llvm-project?rev=187915&view=rev
Log:
N3644 support for <unordered_set> and <unordered_map>

Modified:
    libcxx/trunk/include/__hash_table
    libcxx/trunk/test/containers/unord/unord.map/iterators.pass.cpp
    libcxx/trunk/test/containers/unord/unord.multimap/iterators.pass.cpp
    libcxx/trunk/test/containers/unord/unord.multiset/iterators.pass.cpp
    libcxx/trunk/test/containers/unord/unord.set/iterators.pass.cpp

Modified: libcxx/trunk/include/__hash_table
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=187915&r1=187914&r2=187915&view=diff
==============================================================================
--- libcxx/trunk/include/__hash_table (original)
+++ libcxx/trunk/include/__hash_table Wed Aug  7 16:30:44 2013
@@ -112,6 +112,9 @@ public:
                                                          pointer;
 
     _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT
+#if _LIBCPP_STD_VER > 11
+    : __node_(nullptr)
+#endif
     {
 #if _LIBCPP_DEBUG_LEVEL >= 2
         __get_db()->__insert_i(this);
@@ -248,6 +251,9 @@ public:
     typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator;
 
     _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT
+#if _LIBCPP_STD_VER > 11
+    : __node_(nullptr)
+#endif
     {
 #if _LIBCPP_DEBUG_LEVEL >= 2
         __get_db()->__insert_i(this);

Modified: libcxx/trunk/test/containers/unord/unord.map/iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.map/iterators.pass.cpp?rev=187915&r1=187914&r2=187915&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.map/iterators.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.map/iterators.pass.cpp Wed Aug  7 16:30:44 2013
@@ -108,4 +108,18 @@ int main()
         C::const_iterator i;
     }
 #endif
+#if _LIBCPP_STD_VER > 11
+    { // N3664 testing
+        typedef std::unordered_map<int,double> C;
+        C::iterator ii1{}, ii2{};
+        C::iterator ii4 = ii1;
+        C::const_iterator cii{};
+        assert ( ii1 == ii2 );
+        assert ( ii1 == ii4 );
+        assert ( ii1 == cii );
+        
+        assert ( !(ii1 != ii2 ));
+        assert ( !(ii1 != cii ));
+    }
+#endif
 }

Modified: libcxx/trunk/test/containers/unord/unord.multimap/iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.multimap/iterators.pass.cpp?rev=187915&r1=187914&r2=187915&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.multimap/iterators.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.multimap/iterators.pass.cpp Wed Aug  7 16:30:44 2013
@@ -114,4 +114,18 @@ int main()
         C::const_iterator i;
     }
 #endif
+#if _LIBCPP_STD_VER > 11
+    { // N3664 testing
+        typedef std::unordered_multimap<int,double> C;
+        C::iterator ii1{}, ii2{};
+        C::iterator ii4 = ii1;
+        C::const_iterator cii{};
+        assert ( ii1 == ii2 );
+        assert ( ii1 == ii4 );
+        assert ( ii1 == cii );
+
+        assert ( !(ii1 != ii2 ));
+        assert ( !(ii1 != cii ));
+    }
+#endif
 }

Modified: libcxx/trunk/test/containers/unord/unord.multiset/iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.multiset/iterators.pass.cpp?rev=187915&r1=187914&r2=187915&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.multiset/iterators.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.multiset/iterators.pass.cpp Wed Aug  7 16:30:44 2013
@@ -107,4 +107,18 @@ int main()
         C::const_iterator i;
     }
 #endif
+#if _LIBCPP_STD_VER > 11
+    { // N3664 testing
+        typedef std::unordered_multiset<int> C;
+        C::iterator ii1{}, ii2{};
+        C::iterator ii4 = ii1;
+        C::const_iterator cii{};
+        assert ( ii1 == ii2 );
+        assert ( ii1 == ii4 );
+        assert ( ii1 == cii );
+
+        assert ( !(ii1 != ii2 ));
+        assert ( !(ii1 != cii ));
+    }
+#endif
 }

Modified: libcxx/trunk/test/containers/unord/unord.set/iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/unord/unord.set/iterators.pass.cpp?rev=187915&r1=187914&r2=187915&view=diff
==============================================================================
--- libcxx/trunk/test/containers/unord/unord.set/iterators.pass.cpp (original)
+++ libcxx/trunk/test/containers/unord/unord.set/iterators.pass.cpp Wed Aug  7 16:30:44 2013
@@ -107,4 +107,18 @@ int main()
         C::const_iterator i;
     }
 #endif
+#if _LIBCPP_STD_VER > 11
+    { // N3664 testing
+        typedef std::unordered_set<int> C;
+        C::iterator ii1{}, ii2{};
+        C::iterator ii4 = ii1;
+        C::const_iterator cii{};
+        assert ( ii1 == ii2 );
+        assert ( ii1 == ii4 );
+        assert ( ii1 == cii );
+
+        assert ( !(ii1 != ii2 ));
+        assert ( !(ii1 != cii ));
+    }
+#endif
 }





More information about the cfe-commits mailing list